How to display dependency updates only for release versions

后端 未结 2 770
说谎
说谎 2021-02-13 00:02

When I\'m running versions:display-dependency-updates, it will show all the newest beta / milestone versions of my dependencies. I prefer using \"release\" packages

2条回答
  •  甜味超标
    2021-02-13 00:49

    Two steps

    Add rulesUri to the plugin configuration

    
        org.codehaus.mojo
        versions-maven-plugin
        2.3
        
            file:///${project.basedir}/rules.xml
        
        
            
            compile
            
                display-dependency-updates
                display-plugin-updates
            
            
        
    
    

    Add the rules.xml file to your project root directory.

    
    
        
            
            (?i).*Alpha(?:-?\d+)?
            (?i).*a(?:-?\d+)?
            (?i).*Beta(?:-?\d+)?
            (?i).*-B(?:-?\d+)?
            (?i).*RC(?:-?\d+)?
            (?i).*CR(?:-?\d+)?
            (?i).*M(?:-?\d+)?
        
        
        
    
    

    The regex filters out the unstable releases. You can also target rules for specific dependencies, see:

    http://blog.xebia.com/keeping-dependencies-up-to-date-in-maven/

    https://gist.github.com/seahrh/b13f4f3d618ad7c817038e0bc124ef29

    Version rules will also stay for future releases of the plugin.

提交回复
热议问题