Maven 3.0's “mvn release:perform” doesn't like a pom.xml that isn't in its git repo's root directory

后端 未结 3 1756
孤城傲影
孤城傲影 2021-02-08 15:46

I have a question about Maven, the maven-release-plugin, git integration, pom.xml\'s, and having pom.xml\'s in subdirectories of the repo\'s local copy rather than in the root.<

3条回答
  •  有刺的猬
    2021-02-08 16:43

    You can do it in the same way you normally tell Maven to run from a POM that's somewhere else: the -f option. mvn --help describes it thusly:

    -f,--file     Force the use of an alternate POM
                       file.
    

    To do that in a release, you just need to pass the appropriate option to the release plugin. You can use the perform goal's "arguments" property to do that. This property just tells the release plugin some additional arguments to append to the mvn command it runs when doing the release. You can set it from the command line by appending -D arguments="-f path/to/pom" or set it permanently in the pom in the release plugin's configuration, something like

    
        maven-release-plugin
        2.3
        
            -f path/to/pom
        
    
    

提交回复
热议问题