Maven build issue
I have multi module project where one project contains excel spreadsheet and it is being dropped in the target folder when maven build the project. Now when I do a mvn clean install, sometime maven throws an error that it can not delete the "abc.xls" file. So I started using maven-clean-plugin and trying to exclude this file. Still I am getting the same error. Strange problem is,开发者_开发问答 if i close my eclipse and do the build from command line then it works fine. But for that everytime i want to do clean build I have to close my eclipse. Also I am using M2ECLIPSE plugin for my project. Here is my maven-clean-plugin looks like
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>${basedir}/target/classes/</directory>
<excludes>
<exclude>**/*.xls</exclude>
</excludes>
<followSymlinks>true</followSymlinks>
</fileset>
</filesets>
<!-- <failOnError>false</failOnError> -->
</configuration>
</plugin>
Any insight would be helpful.
Thanks
That's not how to configure the clean plugin.
You need to turn on excludeDefaultDirectories
and then write a fileset that covers what you want with exclusions. What you've just done is redundantly add target/classes, but that's added on top of deleting 'target' with no exclusions.
精彩评论