【问题标题】:Stop Eclipse/Maven from invoking one particular plugin阻止 Eclipse/Maven 调用一个特定的插件
【发布时间】:2021-02-08 17:20:26
【问题描述】:

我在 Eclipse 中有一个 Maven 项目,它不仅构建主 jar 文件,还运行 frontend-maven-plugin。这个插件需要很长时间才能运行,Eclipses 坚持在启动时调用它一次,之后随机调用一次。

我需要它仅在部署时运行此插件,并在开发过程中停止打扰我。我已将每个执行绑定到部署阶段,当我从命令行运行 Maven 时,一切正常。 “mvn deploy”运行插件,“mvn install”不运行。

    <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>

问题是 Eclipse 在开发时不断调用插件,并在我等待它时将我关闭。如何让它停止?

【问题讨论】:

    标签: java eclipse maven


    【解决方案1】:

    如果您按照中所述将&lt;?m2e ignore?&gt; 应用于插件,它应该可以工作

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

    【讨论】:

      猜你喜欢
      • 2019-04-11
      • 2011-10-19
      • 1970-01-01
      • 2012-04-07
      • 1970-01-01
      • 2023-03-17
      • 1970-01-01
      • 2011-08-26
      • 1970-01-01
      相关资源
      最近更新 更多