我有一个maven问题.
我有一个GWT项目,它生成一个临时目录gwt-unitCache文件夹.我想在构建过程结束时删除它.
我有这个插件配置:
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<configuration>
<filesets>
<fileset>
<directory>src/main</directory>
<includes>
<directory>gwt-unitCache/**</directory>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
<executions>
<execution>
<id>gwt-unitCache</id>
<phase>install</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
这通过删除src/main下自动生成的gwt-unitCache文件夹来完成它的工作.但是,它还删除了包含类和war文件的目标文件夹.
我不希望删除目标文件,因此我通过删除部分修改了配置:
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<configuration>
<filesets>
<fileset>
<directory>src/main</directory>
<includes>
<directory>gwt-unitCache/**</directory>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
<executions>
<execution>
<id>gwt-unitCache</id>
<phase>install</phase>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
但这一次它不再起作用了.gwt-unitCache未被删除.看起来插件是在构建过程的开始而不是在结束时运行的.
我不擅长Maven.有人可以帮忙吗?如何配置它以便:
我使用命令:maven clean install
建立它.
非常感谢.
小智 6
没有经过测试,但maven-clean-plugin暴露了一个excludeDefaultDirectories可以帮助完成工作.就像是:
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<configuration>
<filesets>
<fileset>
<directory>src/main</directory>
<includes>
<directory>gwt-unitCache/**</directory>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
</configuration>
<executions>
<execution>
<id>gwt-unitCache</id>
<phase>install</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
另外,我不明白为什么你需要清除这个目录,你不能在你的SCM中忽略它吗?
| 归档时间: |
|
| 查看次数: |
6639 次 |
| 最近记录: |