gpt4 book ai didi

java - 我可以使用 Eclipse m2e UPDATE 执行 Maven 插件吗?

转载 作者:太空宇宙 更新时间:2023-11-04 10:05:06 26 4
gpt4 key购买 nike

我有一个 Maven 项目,当我右键单击 -> Maven -> 更新项目时,我想要求 Eclipse 将依赖项 jar 复制到 WEB-INF/lib ...
通过使用以下插件,我可以复制执行 mvn 验证的 jar。但我想要的是当我执行 Maven -> Update Project ... with m2e

时执行这个插件
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.test.repo</groupId>
<artifactId>myDependencyJar</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${basedir}/WebContent/WEB-INF/lib</outputDirectory>
</artifactItem>
</artifactItems>
<outputDirectory>${basedir}/WebContent/WEB-INF/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

最佳答案

Maven -> 更新项目根本不执行 Maven。它只是使用 pom.xml 文件中的数据更新 Eclipse 项目。所以我想说不可能通过这种方式执行 Maven 插件。

有关“Maven -> 更新”的更多信息 here .

关于java - 我可以使用 Eclipse m2e UPDATE 执行 Maven 插件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53042742/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com