[ 
https://issues.apache.org/jira/browse/SCM-871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17963440#comment-17963440
 ] 

ASF GitHub Bot commented on SCM-871:
------------------------------------

jira-importer opened a new issue, #1101:
URL: https://github.com/apache/maven-scm/issues/1101

   **[Mattias 
Andersson](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=attiand)**
 opened 
**[SCM-871](https://issues.apache.org/jira/browse/SCM-871?redirect=false)** and 
commented
   
   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.
   
   ```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
   ```
   
   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.
   
   ```java
   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.
   
   
   ---
   
   **Affects:** 1.9.5
   
   **Attachments:**
   - 
[pom.xml](https://issues.apache.org/jira/secure/attachment/12912286/pom.xml) 
(_610 bytes_)
   




> Unable to release Maven artifacts which are not in the root of the Git 
> repository
> ---------------------------------------------------------------------------------
>
>                 Key: SCM-871
>                 URL: https://issues.apache.org/jira/browse/SCM-871
>             Project: Maven SCM (Moved to GitHub Issues)
>          Issue Type: Bug
>          Components: maven-scm-provider-jgit
>    Affects Versions: 1.9.5
>         Environment: Linux, Java version 1.8.0_144
>            Reporter: Mattias Andersson
>            Priority: Major
>         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
(v8.20.10#820010)

Reply via email to