Maven version with a property

后端 未结 8 987
不思量自难忘°
不思量自难忘° 2020-12-03 00:21

I have big Maven (Tycho) project witch about 400 plug-ins.

We have specified version of application in each POM file.

Is there a way how to specify the versi

8条回答
  •  眼角桃花
    2020-12-03 01:13

    If you have a parent project you can set the version in the parent pom and in the children you can reference sibling libs with the ${project.version} or ${version} properties.

    If you want to avoid to repeat the version of the parent in each children: you can do this:

    4.0.0
    company
    build.parent
    ${my.version}
    pom
    
    
    1.1.2-SNAPSHOT
    
    

    And then in your children pom you have to do:

        
          build.parent
          company
          ../build.parent/pom.xml
          ${my.version}
        
    
        4.0.0
        company
        artifact
        eclipse-plugin
    
        
             
               company
               otherartifact   
               ${my.version}
    or
               ${project.version}
            
        
    

    hth

提交回复
热议问题