buildfrontend-maven-plugin

Installs and run node, npm and yarn as part of your maven build

MIT License

Stars
2

buildfrontend-maven-plugin

Installs and run node, npm or yarn as part of your maven build. The buildfrontend-maven-plugin will do the following steps for you:

  • download the specified tools
  • installs them to your local maven repository
  • extract the archives from the local maven repository
  • invoke the tools with the configured parameters

Continuous integration

Travis (Linux & Mac OS X):

Appveyor (Windows):

Demo

Demo projects can be found here.

Usage

<build>
  <plugins>
    
    <plugin>
      <groupId>com.github.sdorra</groupId>
      <artifactId>buildfrontend-maven-plugin</artifactId>
      <version>2.1.0</version>
      <configuration>
        <node>
          <version>8.11.4</version>
        </node>
        <pkgManager>
          <type>YARN</type>
          <version>1.9.4</version>
        </pkgManager>
        <script>run</script>
      </configuration>
      <executions>
        <execution>
          <id>install</id>
          <phase>process-resources</phase>
          <goals>
            <goal>install</goal>
          </goals>
        </execution>
        <execution>
          <id>run</id>
          <phase>process-resources</phase>
          <goals>
            <goal>run</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    
  </plugins>
</build>

Differences to version 1.x

The project does not longer support steps for each tool (e.g.: bower, npm, karma, ...), version 2.x focuses on the usage of scripts inside the package.json. If you want to run bower or karma just add a script to your package.json and use the run goal.

Version 2.x uses an abstraction for node package manager, so you can decide if you want to use npm or yarn.

Why not eirslett/frontend-maven-plugin?

The buildfrontend-maven-plugin is heavily inspired from the great work of eirslett. The main differences between both projects is that buildfrontend-maven-plugin installs the downloaded components into the local maven repository before extraction. This gives a better performance during a clean build, because we don't have to download the artifacts again.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Package Rankings
Top 37.53% on Repo1.maven.org
Badges
Extracted from project README
Quality Gates Coverage Maven Central License: MIT Build Status Build status