${project.artifactId} in parent pom.xml resolves odd

前端 未结 3 661
太阳男子
太阳男子 2021-01-02 15:16

I have a bulk full of projects which have the same URLs in their pom.xml:

https://github.com/malkusch/${project.artifactId}



        
3条回答
  •  没有蜡笔的小新
    2021-01-02 15:43

    Adding to the already great background information given, in order to still deploy with a valid scm url, since Maven 3.5 you can correct the "module" name that gets appended per the project.directory property:

    
        ${project.artifactId}
    
    

    And then you just simplify your developerConnection to not include the artifactId anymore since it will be appended as the project.directory:

    
        scm:git:git@server:
    
    

    Assuming this doesn't conflict with any other goals, that should allow a deploy goal to do its job with the correct git url for a non-multi-module Maven project where you've defined the scm.developerConnection in the parent pom.

    When I run a deploy, I see maven doing a correct push like:

    [INFO] Executing: /bin/sh -c cd /projectDir/proj && git push git@server:proj master:master
    

提交回复
热议问题