ccleve
ccleve

Reputation: 15779

Stop Eclipse/Maven from invoking one particular plugin

I've got a Maven project in Eclipse that builds not only the main jar file, but also runs the frontend-maven-plugin. This plugin take forever to run, and Eclipses insists on invoking it once on startup and at random times thereafter.

I need it to run this plugin only on deployment, and to stop interrupting me during development. I have bound each of the executions to the deploy phase, and when I run Maven from the command line everything works correctly. A "mvn deploy" runs the plugin, and a "mvn install" does not.

    <plugin>
        <!-- This is from https://blog.codecentric.de/en/2018/04/spring-boot-vuejs/ 
            It does the front end build by invoking the npm build. -->
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>1.8.0</version>

        <configuration>
            <workingDirectory>admin</workingDirectory>
        </configuration>

        <executions>
            <!-- Install our node and npm version to run npm/node scripts -->
            <execution>
                <id>install node and yarn</id>
                <goals>
                    <goal>install-node-and-yarn</goal>
                </goals>
                <phase>deploy</phase>
                <configuration>
                    <nodeVersion>v14.15.1</nodeVersion>
                    <yarnVersion>v1.22.10</yarnVersion>
                </configuration>
            </execution>
            <!-- Install all project dependencies -->
            <execution>
                <id>yarn install</id>
                <goals>
                    <goal>yarn</goal>
                </goals>
                <phase>deploy</phase>
                <!-- optional: default phase is "generate-resources" -->
            </execution>
            <!-- Build and minify static files -->
            <execution>
                <!-- Yarn/Nuxt still uses npm run build to build the dist -->
                <id>yarn run build</id>
                <goals>
                    <goal>yarn</goal>
                </goals>
                <phase>deploy</phase>
                <configuration>
                    <arguments>run build</arguments>
                </configuration>
            </execution>
        </executions>
    </plugin>

The problem is that Eclipse keeps invoking the plugin at development time and shuts me down while I wait for it. How do I get it to stop?

Upvotes: 1

Views: 142

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35785

It should work if you apply <?m2e ignore?> to the plugin as described in

https://www.eclipse.org/m2e/documentation/release-notes-17.html

Upvotes: 2

Related Questions