Sunday, August 5, 2012

Maven: pom.xml template for new projects

In this post I'll show you a snippet that I use for every new maven project. Thanks to this configuration you can minimize the always verbose pom.xml. Using the right properties you can automatically set default values for many maven plugins, so you can avoid writing configuration tags for every plugin. Using the pluginManagement tag every child pom inherits plugin version and all the properties.

I hope that everyone using this pom will check for new versions of the plugins specified below and if you'll find any new version on the (official maven plugins site) please comment this post and I'll update this snippet. Remember that using the latest version of plugins can improve your building time.


    
        
            
                
                    maven-clean-plugin
                    2.5
                
                
                    maven-compiler-plugin
                    3.0
                
                
                    maven-resources-plugin
                    2.6
                
                
                    maven-dependency-plugin
                    2.6
                
                
                    maven-source-plugin
                    2.2.1
                
                
                    maven-war-plugin
                    2.3
                
                
                    maven-failsafe-plugin
                    2.13
                
                
                    maven-surefire-plugin
                    2.13
                
            
        
    
    
        UTF-8
        1.6
        1.6
    

No comments:

Post a Comment