logo grunt-maven-plugin

Grunt + Maven integration done right

homepage: github.com/allegro/grunt-maven-plugin
fresh index:
last release: 2 years ago, first release: 4 years ago
packaging: maven-plugin
get this artifact from: central
see this artifact on: search.maven.org




This chart shows how much is this artifact used as a dependency in other Maven artifacts in Central repository and GitHub:


select version:

Add this snippet into pom.xml inside tag <project><build><plugins>:




Switch to artifact.
goals:
grunt:clean (phase: clean)

Mojo executing clean task on Grunt build directory.

grunt:create-resources (phase: generate-sources)

MOJO executing maven-resources-plugin to create target/{jsTargetDir} directory containing all statics.

grunt:npm-offline (phase: compile)

Run NPM rebuild.

grunt:grunt (phase: compile)

Executes grunt.

grunt:npm (phase: compile)

Executes npm install to download all dependencies declared in package.json.

grunt:bower (phase: compile)

Executes bower install to download all dependencies declared in bower.json.

Often used code snippets:

<plugin>
  <groupId>pl.allegro</groupId>
  <artifactId>grunt-maven-plugin</artifactId>
  <version>${grunt-maven-plugin.version}</version>
  <configuration>
    <sourceDirectory>${project.basedir}/src/main/js</sourceDirectory>
    <jsSourceDirectory>.</jsSourceDirectory>
    <gruntBuildDirectory>${project.build.directory}/grunt</gruntBuildDirectory>
    <ignoreTasksErrors>false</ignoreTasksErrors>
    <ignoreAllErrors>false</ignoreAllErrors>
  </configuration>
  <executions>
    <execution>
      <id>grunt-default-task</id>
      <phase>prepare-package</phase>
      <goals>
        <goal>create-resources</goal>
        <goal>bower</goal>
      </goals>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>pl.allegro</groupId>
  <artifactId>grunt-maven-plugin</artifactId>
  <version>1.5.0</version>
  <configuration>
    <jsSourceDirectory>META-INF/resources/</jsSourceDirectory>
    <showColors>true</showColors>
    <gruntOptions>
      <gruntOption>--force</gruntOption>
    </gruntOptions>
  </configuration>
  <executions>
    <execution>
      <phase>generate-sources</phase>
      <goals>
        <goal>create-resources</goal>
        <goal>grunt</goal>
      </goals>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>pl.allegro</groupId>
  <artifactId>grunt-maven-plugin</artifactId>
  <version>1.5.0</version>
  <configuration>
    <sourceDirectory>${project.basedir}/src/main/js</sourceDirectory>
    <jsSourceDirectory>.</jsSourceDirectory>
    <gruntBuildDirectory>${project.build.directory}/grunt</gruntBuildDirectory>
    <ignoreTasksErrors>false</ignoreTasksErrors>
    <ignoreAllErrors>false</ignoreAllErrors>
  </configuration>
  <executions>
    <execution>
      <id>grunt-default-task</id>
      <phase>prepare-package</phase>
      <goals>
        <goal>create-resources</goal>
        <goal>bower</goal>
      </goals>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>pl.allegro</groupId>
  <artifactId>grunt-maven-plugin</artifactId>
  <version>1.5.1</version>
  <configuration>
    <showColors>true</showColors>
    <gruntOptions/>
    <sourceDirectory>${grunt.sourceDirectory}</sourceDirectory>
    <jsSourceDirectory>${grunt.jsSourceDirectory}</jsSourceDirectory>
    <gruntBuildDirectory>${grunt.gruntBuildDirectory}</gruntBuildDirectory>
    <warTargetDirectory>${grunt.warTargetDirectory}</warTargetDirectory>
    <gruntOptions/>
  </configuration>
  <executions>
    <execution>
      <goals>
        <goal>clean</goal>
        <goal>create-resources</goal>
        <goal>npm</goal>
        <goal>grunt</goal>
      </goals>
    </execution>
  </executions>
</plugin>

© Jiri Pinkas 2015 - 2017. All rights reserved. Admin login To submit bugs / feature requests please use this github page
related: JavaVids | Top Java Blogs | Java školení | 4npm - npm search | monitored using: sitemonitoring
Apache and Apache Maven are trademarks of the Apache Software Foundation. The Central Repository is a service mark of Sonatype, Inc.