I’ve been using Maven for years, but once in a while forget to ‘
clean‘ before building, resulting in old artifacts being included in the output. This can be problematic when refactoring for security items. Thankfully, it is very easy to add a ‘
clean‘ step to your
pom.xml to force clean each build.
BONUS – the plugin has some additional capabilities, specifically you can specify files outside of ‘target’ to be removed. This can be useful for any custom reporting or logging that you might create.
The Maven clean plug-in can be added to the pom.xml as such:
I’ve run into this a few times as my web applications got larger. Often this has been seen when builds automated by Jenkins start failing as they increase in size. It has also occurred to me when doing manual deployments as the Jenkins WAR itself is larger than 50MB lately.
Let’s just go in and increase the maximum expected file size…
This change should work on any platform, but the following is from my experience with Ubuntu.
sudo vi /opt/tomcat7/webapps/manager/WEB-INF/web.xml
<!-- 50MB -->
Change to something a bit larger (to your liking):
<!-- 50MB max 62428800, 100MB = 104857600 -->
Restart with either…
sudo /etc/init.d/tomcat7 restart
sudo service tomcat7 restart