Uploaded image for project: 'Maven SCM'
  1. Maven SCM
  2. SCM-871

Unable to release Maven artifacts which are not in the root of the Git repository

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 1.9.5
    • None
    • None
    • Linux, Java version 1.8.0_144

    Description

      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.

      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
      

      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.

      09:28:24 [INFO] commit done: [maven-release-plugin] prepare release my-prod-1.0.0
      

      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.

      Attachments

        1. pom.xml
          0.6 kB
          Mattias Andersson

        Activity

          People

            Unassigned Unassigned
            attiand Mattias Andersson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: