我有一个由GWT客户端和Tomcat服务器端组成的项目.一切都是使用maven设置的.但是,我希望将客户端的HTML和CSS文件(位于resources文件夹中)复制到服务器项目webapp目录中.我一直在看maven-dependency-plugin,但无法让它工作.我似乎找不到指定源和目标路径的方法.如果有人能指出我正确的方向,我会很感激.
谢谢.
<!-- Use the following to extract all files from the dependent jar or war (see type) : -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.group.id</groupId>
<artifactId>artifact-id</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>target/exploded-artifact-id-jar</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- then copy the neccessary files to the webapp directory -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-webapp-resources</id>
<phase>generate-resources</phase>
<configuration>
<tasks>
<copy todir="target/webapp" filtering="false">
<fileset dir="target/exploded-artifact-id-jar/path-to-files"/>
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5236 次 |
| 最近记录: |