eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.25k stars 870 forks source link

mvn frontend:npm doesn't take <arguments> into account #231

Closed nodje closed 9 years ago

nodje commented 9 years ago
                 <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>grunt-cli</arguments>
                        </configuration>
                 </execution>

just doesn't work: mvn frontend:npm will execute npm --no-color install anyway.

eirslett commented 9 years ago

I have no idea why... if you have time to debug it, maybe you can find out why? I also thought the way to run it was mvn frontend-maven-plugin:npm, but apparently not...

singhtalwin commented 9 years ago
                <execution>
                    <id>server-build</id>
                    <goals>
                        <goal>gulp</goal>
                    </goals>
                    <configuration>
                        <arguments>server-build</arguments>
                    </configuration>
                </execution>

I'm having the same issue when setting arguments in the configuration within execution. It is simply ignored unless it is within the plugin level configuration:

        <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <version>0.0.23</version>
            <configuration>
                <workingDirectory>src/main/jcr_root/etc/designs/${project.artifactId}/clientlibs/${project.type}/</workingDirectory>
                <nodeVersion>v0.10.26</nodeVersion>
                <npmVersion>1.4.3</npmVersion>
                <arguments>server-build</arguments>
            </configuration>

But this way it will add it for every goal. My current workaround is to set the 'server-build' task as my default. Any ideas how to fix this?

nodje commented 9 years ago

This behavior is consistent across all execution tasks in the plugin config.

I've come to realize that are taken into accounts when the plugin is triggered by Maven through the generate-resources phase. But not when called manually with mvn frontend:xxx

I'll try to look into it.

eirslett commented 9 years ago

I think this is a general problem with Maven. Reopen the case if you find out more!