Maven2 inheritance

后端 未结 5 2069
迷失自我
迷失自我 2021-02-12 23:26

If I have a parent pom and want to inherit this to several projects. I usually do this by adding in top of the project ... . What I do

5条回答
  •  长情又很酷
    2021-02-12 23:55

    You can use the Maven Release Plugin when doing a release. It will update all the version numbers automatically and create a tag in your source control (if you have SCM configured in the POM).

    My commands for performing a release are typically as follows, after which I export the tag from SCM and build it with "mvn clean package" or "mvn clean deploy".

      svn update   (or whatever SCM you use)
      mvn clean
      mvn release:prepare -DautoVersionSubmodules=true
      mvn release:clean
    

    So for example if you version is first "1.0-SNAPSHOT", then the release plugin will create a tag "projectname-1.0" with version "1.0", and finally increase the current version to "1.1-SNAPSHOT". The plugin will ask you for the versions and tag name, so you can override the defaults.

提交回复
热议问题