在我的項目中,我最初犯了一個錯誤,並在CVS存儲庫中提交了目標目錄;我知道沒有安全的方法來從CVS中刪除一個目錄,所以我把一個.cvsignore文件放在那裏基本上忽略了一切(我不希望開發人員甚至無法正確合併來提交他們的類......) 。Maven clean插件排除.cvsignore
問題引起了我的Jenkins CI,因爲我運行的是乾淨的測試目標;基本上clean在CVS更新之前運行,所以它總是找到要更新的文件(被clean清除的.cvsignore)並觸發一個通常無用的構建。
我覺得要走的路是用排除,但我嘗試和沒有工作:
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting file set: **************************/target (included: [**], excluded: [])
排除配置爲:
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<id>not-clean</id>
<configuration>
<filesets>
<fileset>
<directory>target</directory>
<excludes>
<exclude>*cvsignore</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
<phase>initialize</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
這段代碼簡直是錯的;正確的答案是我接受的答案 – 2011-04-28 08:21:07