Side-effects of using Maven3

After attending to Jason van Zyl’s session about Maven3 we decided to start using Maven 3 instead of the 2.2 we were using. Since it is fully backward compatible we made it run without making a change to our pom’s. However, what this version does add is generate warnings for all kinds of ‘misconfigurations’ in the poms. This does not lead to problems in this version but it might do so in future version, so it is better to solve this issues.
One warning we got was:

[WARNING] Some problems were encountered while building the effective model for net.pascalalma.framework:rs-core:jar:2.0-SNAPSHOT
[WARNING] ‘build.plugins.plugin.version’ for org.apache.maven.plugins:maven-clean-plugin is missing. @
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

So it appeared we forgot to mention the version for the clean plugin, so I added the (latest) version to the pom like shown here and went on:


However, after some time we noticed that some of our unit tests started to fail while they were valid and we hadn’t touched the code. After some investigation it appeared the problem was caused by the maven-clean-plugin. The version I chose (2.4) is not able to remove complete directories (or at least not with the configuration as we shown above). For some reason, until adding the version, the plugin was using version 2.2. and that does know how to handle my configuration. So I changed the version of the clean-plugin to 2.2 and my tests work like a charm without warnings of Maven.

So although Maven3 does work without a change it does not mean you won’t run into issues. But it must be said that we would run into this issue sooner or later without Maven3. So we would suggest to start using Maven3 (or at least give it a try) as it will only improve the quality of your builds (and runs much fasteršŸ˜‰.

About Pascal Alma

Pascal is a senior software developer and architect. Pascal has been designing and building applications since 2001. He is particularly interested in Open Source toolstack (Mule, Spring Framework, JBoss) and technologies like Web Services, SOA and Cloud technologies. Lately he is having great fun by building iOS apps with Swift. Specialties: JEE AWS XML/XSD/XSLT Web Services/SOA Mule ESB/ WSO2 ESB Maven Cloud Technology Swift/ iOS
This entry was posted in Maven, Technical and tagged . Bookmark the permalink.