You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mattias Andersson (JIRA)" <ji...@apache.org> on 2018/02/27 15:24:00 UTC

[jira] [Created] (SCM-871) Unable to release Maven artefacts that is not in the root of the Git repository

Mattias Andersson created SCM-871:
-------------------------------------

             Summary: Unable to release Maven artefacts that is not in the root of the Git repository
                 Key: SCM-871
                 URL: https://issues.apache.org/jira/browse/SCM-871
             Project: Maven SCM
          Issue Type: Bug
          Components: maven-scm-provider-jgit
    Affects Versions: 1.9.5
         Environment: Linux, Java version 1.8.0_144
            Reporter: Mattias Andersson
         Attachments: pom.xml

I have a Maven project that is not in the root of the Git repository. When I run a release:prepare the pom.xml is changed but never checked in.
{code:java}
07:52:47 [INFO] Checking in modified POMs...
07:52:47 [INFO] push changes to remote... refs/heads/master:refs/heads/master
07:52:47 [INFO] fetch url: ssh://myurl
07:52:47 [INFO] push url: ssh://myurl
{code}
In another project where the pom.xml is in the root of the repo i get following line printed after the “Checking in modified POMs…” line.
{code:java}
09:28:24 [INFO] commit done: [maven-release-plugin] prepare release my-prod-1.0.0
{code}
For a maven project in the following directory: {{/home/me/git/my-repo/src/pom.xml}}

The problem seems to be that in {{org.apache.maven.scm.provider.git.jgit.command.JGitUtils.addAllFiles(Git, ScmFileSet)}}. The baseUri of the fileSet is /home/me/git/my-repo/src so the relativized path become pom.xml. But {{org.eclipse.jgit.api.AddCommand.addFilepattern(String)}} expects a repository relative path, i.e. src/pom.xml.

 

This patch [https://github.com/apache/maven-scm/compare/master...attiand:fix] relativize the path against the Git repo rather than the fileset, works for me.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)