You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Elliotte Rusty Harold (Jira)" <ji...@apache.org> on 2019/12/20 14:37:00 UTC

[jira] [Updated] (MRELEASE-960) release:prepare does not tag each module when using commitByProject with flat multimodule

     [ https://issues.apache.org/jira/browse/MRELEASE-960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Elliotte Rusty Harold updated MRELEASE-960:
-------------------------------------------
    Priority: Minor  (was: Major)

> release:prepare does not tag each module when using commitByProject with flat multimodule
> -----------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-960
>                 URL: https://issues.apache.org/jira/browse/MRELEASE-960
>             Project: Maven Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.5.3
>            Reporter: Alexander Muthmann
>            Priority: Minor
>
> Hi,
> Given the following project-setup with a single git repository for each artifact:
> * module 1 (depends on m2 and m3)
> * module 2 (depends on m3)
> * module 3
> * complete (aggregates all modules into a single deliverable)
> Based on my experience with other projects I'd expect to be able to perform a release in complete:
> {quote}
> [INFO] Checking dependencies and plugins for snapshots ...
> What is the release version for "commitByProject-m3"? (de.dev.eth0.commitByProject:commitByProject-m3) 1.0: :
> What is the release version for "commitByProject-m2"? (de.dev.eth0.commitByProject:commitByProject-m2) 1.0: :
> What is the release version for "commitByProject-m1"? (de.dev.eth0.commitByProject:commitByProject-m1) 1.0: :
> What is the release version for "complete"? (de.dev.eth0.commitByProject:complete) 1.0: :
> What is SCM release tag or label for "complete"? (de.dev.eth0.commitByProject:complete) complete-1.0: :
> What is the new development version for "commitByProject-m3"? (de.dev.eth0.commitByProject:commitByProject-m3) 1.1-SNAPSHOT: :
> What is the new development version for "commitByProject-m2"? (de.dev.eth0.commitByProject:commitByProject-m2) 1.1-SNAPSHOT: :
> What is the new development version for "commitByProject-m1"? (de.dev.eth0.commitByProject:commitByProject-m1) 1.1-SNAPSHOT: :
> What is the new development version for "complete"? (de.dev.eth0.commitByProject:complete) 1.1-SNAPSHOT: :
> {quote}
> But this fails as the commit command tries to commit the updated pom.xml of each project in a single command:
> {quote}
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project complete: Unable to commit files
> [ERROR] Provider message:
> [ERROR] The git-add command failed.
> [ERROR] Command output:
> [ERROR] fatal: D:\Develop\commitByProject\commitByProject-m3\pom.xml: 'D:\Develop\commitByProject\commitByProject-m3\pom.xml' is outside repository
> {quote}
> The solution I found here is to use commitByProject (http://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#commitByProject). I'd expect, that this will simply split the command for each project and I'd be fine here.
> BUT: as far as I can see, this does not work with a flat project structure as the tagging is not done in each project but in the parent folder:
> {quote}
> [INFO] Checking in modified POMs...
> [INFO] Executing: cmd.exe /X /C "git add -- pom.xml"
> [INFO] Working directory: D:\Develop\commitByProject-m3
> [INFO] Executing: cmd.exe /X /C "git status"
> [INFO] Working directory: D:\Develop\commitByProject-m3
> [INFO] Executing: cmd.exe /X /C "git add -- pom.xml"
> [INFO] Working directory: D:\Develop\commitByProject-m2
> [INFO] Executing: cmd.exe /X /C "git status"
> [INFO] Working directory: D:\Develop\commitByProject-m2
> [INFO] Executing: cmd.exe /X /C "git add -- pom.xml"
> [INFO] Working directory: D:\Develop\commitByProject-m1
> [INFO] Executing: cmd.exe /X /C "git status"
> [INFO] Working directory: D:\Develop\commitByProject-m1
> [INFO] Executing: cmd.exe /X /C "git add -- pom.xml"
> [INFO] Working directory: D:\Develop\commitByProject-complete
> [INFO] Executing: cmd.exe /X /C "git status"
> [INFO] Working directory: D:\Develop\commitByProject-complete
> [INFO] Tagging release with the label complete-1.0...
> [INFO] Executing: cmd.exe /X /C "git tag -F C:\Users\foo\AppData\Local\Temp\maven-scm-134839918.commit complete-1.0"
> [INFO] Working directory: D:\Develop
> {quote}
> At this point I'd expect the release plugin to enter each module, create a tag and that's it. Instead the tag is only created in the parent of the complete parent (which is not in SCM). 
> To test this, the following repositories can be forked:
> * https://github.com/deveth0/commitByProject-complete
> * https://github.com/deveth0/commitByProject-m1
> * https://github.com/deveth0/commitByProject-m2
> * https://github.com/deveth0/commitByProject-m3



--
This message was sent by Atlassian Jira
(v8.3.4#803005)