dependencyManagement and scope

前端 未结 4 1441
既然无缘
既然无缘 2020-12-24 04:41

I usually put a section in parent-project/pom.xml. This section contains dec

4条回答
  •  没有蜡笔的小新
    2020-12-24 05:21

    There is no gain in adding a single dependency to the dependency management, for any scope. All you have is the duplication. If you want to have the version configurable, add a property and use it in your dependency:

    
            4.10 
        ...
        
            junit
            junit
            ${junit.version}
        
    
    

    However, there are cases where the dependency management shines - when you are using boms in order to orchestrate the versions for a larger collections of artifacts, like using a certain version of a Java EE implementation:

    
        
            
                org.jboss.bom
                jboss-javaee-6.0-with-tools
                ${javaee6.with.tools.version}
                pom
                import
            
    ....
    

提交回复
热议问题