Maven version with a property

后端 未结 8 988
不思量自难忘°
不思量自难忘° 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:03

    With a Maven version of 3.5 or higher, you should be able to use a placeholder (e.g. ${revision}) in the parent section and inside the rest of the pom, you can use ${project.version}.

    Actually, you can also omit project properties outside of parent which are the same, as they will be inherited. The result would look something like this:

    
        
        build.parent
        company
        ../build.parent/pom.xml
        ${revision}  
        
    
        4.0.0
        artifact
        
        eclipse-plugin
    
        ...
    
    

    For more information, especially on how to resolve the placeholder during publishing, see Maven CI Friendly Versions | Multi Module Setup.

提交回复
热议问题