【发布时间】: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 在开发时不断调用插件,并在我等待它时将我关闭。如何让它停止?
【问题讨论】: