Unique snapshot versions in Maven

Earlier today we ran into a space issue on our maven snapshot repository server, due to the fact that every automated build was publishing a new, timestamped version of the WAR for our project.

We do not actually need the history in this case; we just need the latest version available for deployment to a test server. It is possible to turn off the timestamp in the WAR name such that each new version overwrites the previous version. This is done by modifying the pom.xml as follows:

<distributionManagement>
    ...
    <snapshotRepository>
        ...
        <uniqueVersion>false</uniqueVersion>
    </snapshotRepository>
    ...
</distributionManagement>

Problem fixed!

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply