Reputation: 86687
My project compiled folder is /project/target/appname-0.24-SNAPSHOT/
, which will
will result in appname-0.24-SNAPSHOT.war
on mvn package
.
How can I clean/regenerate this specific target folder before packaging?
I cannot execute mvn clean
as this would clear the whole target
folder, which I'd like to prevent because it contains lots of auto-generated webservice classes, which then in turn also would have to be regenerated and take a lot of time.
I'd only like to regenerate my project resources in ${project.build.directory}
. Is that possible?
maven config:
<filesets>
<fileset>
<directory>target</directory>
<excludes>
<exclude>generated/*</exclude>
<exclude>classes/*</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
Upvotes: 0
Views: 3100
Reputation: 1463
you can do that using the maven-clean-plugin
with a combination of
excludeDefaultDirectories
to stop it from deleting the whole directoryfilesets
to tell it what to deleteref: http://maven.apache.org/plugins/maven-clean-plugin/clean-mojo.html
Upvotes: 2