-
Notifications
You must be signed in to change notification settings - Fork 872
Home
Welcome to the frontend-maven-plugin wiki!
This wiki should be open for everyone to post examples and documentation. It may not be as updated as the README file which serves as the core documentation.
Each plugin goal has different configuration options.
-
nodeVersion
- the version of node to install -
yarnVersion
- the version of yarn to install -
nodeDownloadRoot
(optional) - where to download node from, defaults to https://nodejs.org/dist/ -
yarnDownloadRoot
(optional) - where to download yarn from, defaults to https://github.com/yarnpkg/yarn/releases/download/ -
serverId
(optional) - Server Id for download username and password, defaults to "" -
skip.installyarn
(optional) - Flag for whether or not to skip execution of this plugin
-
nodeVersion
- the version of node to install -
npmVersion
(optional with node version >= 4.0.0) - the version of npm to install. Defaults to using npm provided by node distribution -
downloadRoot
(optional) - where to download node and npm from. Defaults to http://nodejs.org/dist/ -
npmDownloadRoot
(optional) - where to download npm from. Defaults to https://registry.npmjs.org/npm/-/ if npmVersion is specified, or downloadRoot if both npmVersion and downloadRoot is specified.
-
arguments
- the arguments to pass to npm, defaults toinstall
.
-
arguments
- the arguments to pass to grunt or gulp, e.g.build
-
srcdir
(optional, for M2Eclipse integration) - a directory to check for changed files before executing in an incremental build -
triggerfiles
(optional, for M2Eclipse integration) - a list of files to check for changes before executing in an incremental build -
outputdir
(optional, for M2Eclipse integration) - a directory to refresh when the build completes, so Eclipse sees changed files
The changed file checking only occurs during an incremental build when using M2Eclipse. In any other environment those options are ignored and builds are always run.
Example:
<configuration>
<srcdir>${basedir}/src/main/frontend</srcdir>
<outputdir>${project.build.directory}/frontend</outputdir>
<triggerfiles>
<triggerfile>gulpfile.js</triggerfile>
<triggerfile>package.json</triggerfile>
</triggerfiles>
</configuration>
-
karmaConfPath
- the path to the karma configuration file, defaults tokarma.conf.js
You can add an <environmentVariables>
element to the configuration element of gulp, grunt or karma to pass additional variables that will be accessible using process.env
. For example:
<configuration>
<environmentVariables>
<OUTPUT_DIR>${project.build.directory}</OUTPUT_DIR>
</environmentVariables>
</configuration>
-
http://wicketinaction.com/2014/07/build-resources-with-node.js/ - describes how to use frontend-maven-plugin for building, watching and live reloading Less and JavaScript resources in Apache Wicket application
-
https://web.archive.org/web/20140606070610/http://supposed.nl/2014/06/02/integrate-gulp-and-grunt-into-your-maven-build.html - Integrate Gulp And Grunt Into Your Maven Build
In case you need to work with Maven 2 instead of Maven 3.1, you can use the Frontend-Maven-Plugin up to version 0.0.22 and add an additional dependency in the plugin configuration to plexus-utils like so:
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<!-- Use the latest possible version:
https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
<version>0.0.22</version> <!-- last version supported by maven 2 -->
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
...
</plugin>
...