-
Notifications
You must be signed in to change notification settings - Fork 32
spawn EACCES error when running imagemin task #85
Comments
Here's my pom.xml config: <plugin>
<groupId>pl.allegro</groupId>
<artifactId>grunt-maven-plugin</artifactId>
<version>1.5.0</version>
<configuration>
<gruntExecutable>node_modules/grunt-cli/bin/grunt</gruntExecutable>
<runGruntWithNode>true</runGruntWithNode>
<sourceDirectory>src/main</sourceDirectory>
<jsSourceDirectory>app</jsSourceDirectory>
<!-- example options usage to get verbose output in logs -->
<gruntOptions>
<gruntOption>--verbose</gruntOption>
</gruntOptions>
<!-- example npm install env variable -->
<npmEnvironmentVar>
<PHANTOMJS_CDNURL>http://cnpmjs.org/downloads</PHANTOMJS_CDNURL>
</npmEnvironmentVar>
<!-- example options usage to filter variables in given resource -->
<filteredResources>
<filteredResource>maven-properties.json</filteredResource>
</filteredResources>
</configuration>
<executions>
<execution>
<goals>
<goal>create-resources</goal>
<goal>npm</goal>
<!-- or npm-offline if npm failure is not an option -->
<goal>bower</goal>
<goal>grunt</goal>
</goals>
</execution>
</executions>
</plugin> |
Hi, I've heard it's related to permission, but I cannot get it to work even with sudo. Have you got any progress on this? When I run grunt from the source folder it works. Regards |
The configuration is pretty standard, so i would rather look at generated stuff. If you run grunt from |
I'm sorry I haven't updated this issue, but after a while I figured out it was some problem with my local environment. After deleting a node_modules folder that had been previously generated it all went fine. I hope this helps. |
ah :) Thats great to hear! So we only need to solve @eduardoarantes problem now. |
I tried to run
I've also tried with root user and I've got another error. [INFO] Additional error details: http://www.joyent.com/blog/installing-node-and-npm You can however run a command with sudo using --allow-root option |
running Maven with -e switch I get this info [ERROR] Failed to execute goal pl.allegro:grunt-maven-plugin:1.5.0:grunt (default) on project ROOT: Unable to execute mojo: Command execution failed. Process exited with an error: 3 (Exit value: 3) -> [Help 1] |
I think this is something with grunt build itself, i would not involve maven here - it's reproducable when running pure grunt from |
Adam, I does happen when I run grunt on the It's weird. Any suggestion? Anything else to check? Regards, |
I managed to get it to work Instead of having the grunt running on the |
I have the same problem. I suspect the create-resources copies the resources without preserve permissions. Therefor the imagemin cannot execute the binary because *nix systems require the +x permission in order to execute the binary. I only work on OS X and Linux systems. I asked a co-worker to build the project on Windows and it did build successfully. Windows systems do not require a permission on a .exe file. Regards, Pieter |
I managed to get it working, it is a executable permission problem! The executable files do not have execute rights. Workaround: copy the sources with antrun and disable the create-resources goal <build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-resources-grunt</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete dir="${project.basedir}/target-grunt"/>
<!--<copy todir="${project.basedir}/target-grunt">-->
<!--<fileset dir="${project.basedir}/src/main/dashboard"/>-->
<!--</copy>-->
<exec executable="cp">
<arg value="-r"/>
<arg value="-p"/>
<arg value="${project.basedir}/src/main/dashboard"/>
<arg value="${project.basedir}/target-grunt"/>
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>pl.allegro</groupId>
<artifactId>grunt-maven-plugin</artifactId>
<configuration>
<sourceDirectory>${project.basedir}/src</sourceDirectory>
<jsSourceDirectory>main/dashboard</jsSourceDirectory>
</configuration>
<executions>
<execution>
<goals>
<!--<goal>create-resources</goal>-->
<goal>npm</goal>
<goal>bower</goal>
<goal>grunt</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build> |
Hm, okay, but will it work on any other platform than Unix? I could replace create-resources with this one, but dont have access to Windows machine. |
You could create two ant targets one for windows and one for *nix systems. With antrun you kan read the environment and execute the current tasks for *nix systems and execute: <copy todir="${project.basedir}/target-grunt">
<fileset dir="${project.basedir}/src/main/dashboard"/>
</copy> in the windows target. I do not have an example laying around but check ant documentation and stackoverflow how to do that. |
I already have the diff for *nix and Windows systems, so yeah, that might do it. |
Handy, could you paste your pom.xml snippet when you have it running. We have developers that run in Windows (they are almost extinct) over here :) But they would really appreciate your implementation! |
Oh, i have it in plugin code, never tried to use it in pom, but its based on |
Super! When you are done we wil remove the complete workaround! |
What's the status of this? I'm encountering a very similar issue, but using After some trials, I'm almost certain it has to do with the tar unpack. |
Hi!
I am having the following issue when running mvn clean install:
If I just run the grunt build, the imagemin task runs just fine without any issues, but when running within the maven build it doesn't seem to be able to run. I also have the svgmin grunt task running and this doesn't have any problems.
Everyone seem to point to permissions problems, but I don't think that's the case here as I can run the imagemin task just fine if not from the maven build.
Any idea?
Thanks in advance.
The text was updated successfully, but these errors were encountered: