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 871 forks source link

Environment based execution #941

Closed theunreal closed 4 years ago

theunreal commented 4 years ago

Do you want to request a feature or report a bug? Feature/Support

What is the current behavior? No doc how to do this.

I have the following execution:

<execution>
                                <id>angular cli build</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                                <phase>generate-resources</phase>
                                <configuration>
                                    <arguments>run build-prod-high-memory</arguments>
                                </configuration>
                            </execution>

I also want to add my e2e tests before the build execution, e.g:

<execution>
                                <id>angular e2e tests</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                                <phase>generate-resources</phase>
                                <configuration>
                                    <arguments>run e2e</arguments>
                                </configuration>
                            </execution>

The question - How I can conditionally set this execution, only in case an environment variable is set? I don't want to run the e2e tests for everyone, only on a specific machine.

Any idea? Thanks!

eirslett commented 4 years ago

You can probably use Maven profiles for this.