我有2個模塊的maven prj:一個JAR和一個依賴於JAR的WAR。如何將戰爭的罐子移動(或複製)到另一個戰爭的文件夾?
MAVEN INSTALL後我有一個經典的WEB-INF/lib文件夾,其中包含所有jar依賴項(包括第一個模塊的JAR)。
我需要將第一個模塊的JAR移動到另一個文件夾,例如WEB-INF/resources。 盡我所能?
我能夠移動jar但只在目標內,WAR保持不變。 我用下面的插件:
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>copy-installed</id>
<phase>install</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>groupId</groupId>
<artifactId>artifactId</artifactId>
<version>1.0</version>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/.../WEB-INF/services</outputDirectory>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/.../WEB-INF/services</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
我認爲你必須創建一個新的模塊,並同時做MVN清潔安裝 – 2014-10-21 11:07:46