Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to SKIP a maven plugin execution from Eclipse Build Workspace

I am using a frontend-maven-plugin, more info here.

In order to run GRUNT tasks on maven build and, as I am using Eclipse, it builds the Workspace every time I change something in the code.

The problem is that the Eclipse build process executes the maven plugins every time, and it makes the process very slow. So I would like to know how can I skip the maven plugin execution from Eclipse Build workspace. Any ideas?

Thanks in advance,

like image 609
sandro augusto Avatar asked Oct 22 '16 20:10

sandro augusto


2 Answers

Yes: You can tell Eclipse to ignore selected Maven plugins in either two ways:

  • From Eclipse: Open Window > Preferences > Maven > Lifecycle mappings.
  • From Maven: Add to your POM a org.eclipse.m2e:lifecycle-mapping plugin.

Check out this example.

like image 72
Little Santi Avatar answered Nov 14 '22 21:11

Little Santi


To expand on Little Santi's answer, I added this to my POM:

    ...
    </plugins>

    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>com.github.eirslett</groupId>
                                    <artifactId>frontend-maven-plugin</artifactId>
                                    <versionRange>1.6</versionRange>
                                    <goals>
                                        <goal>install-node-and-npm</goal>
                                        <goal>npm</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
like image 29
Alex D Avatar answered Nov 14 '22 22:11

Alex D