如何讓Eclipse識別出我使用maven-dependency-plugin
並執行之前通過WTP向Tomcat部署資源?使Eclipse尊重Maven-Dependency-Plugin
在a previous question我配置了Maven以將一些工件複製到war
應用程序中,因此我可以將它們提供給Web客戶端。將它們複製到target/${project.artifactId}-${project.version}
的方法在通過Maven命令行進行打包時起作用。不幸的是,使用Eclipse的Tomcat集成時沒有這樣的運氣。
Maven插件配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy</id>
<phase>compile</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<overWrite>false</overWrite>
<destFileName>optional-new-name.jar</destFileName>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
謝謝,這是詳細的,看起來很有希望。當我有機會嘗試時,我會告訴你! –