[英]Can I execute maven plugin whith Eclipse m2e UPDATE?
我有一個Maven項目,當我右鍵單擊-> Maven->更新項目時,我想請Eclipse將依賴項jar復制到WEB-INF / lib。
通過使用以下插件,我可以復制jar進行mvn驗證。 但是我想用m2e執行Maven-> Update Project ...時執行此插件
<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->更新”的更多信息,請點擊這里 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.