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

add goal creates creates wrong paths if parent pom is not at root directory

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.9.5
    • None
    • None
    • Windows, mvn 3.5.2, mvn:scm 1.9.5

    Description

      For reference: https://stackoverflow.com/questions/48689960/maven-scm-plugin-and-relative-paths

       

      When the pom is not at the root directory, the add goal creates a command that includes a relative path from the pom's directory instead of the root directory. Either that, or relative paths like /.. are dropped.

       Directory structure of the project:

      • .git
        • src
          • parent
            • pom.xml
          • submodule
            • pom.xml
            • addme.product

      Example pom:

       

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      
      
          <scm>
          <developerConnection>scm:git:file://../../.git</developerConnection>
        </scm>
      
      
          <modelVersion>4.0.0</modelVersion>
          <groupId>grp</groupId>
          <artifactId>artif</artifactId>
          <version>1.0.0</version>
          <packaging>pom</packaging>
      
      
          <modules>
            <module>../submodule</module>     
          </modules>
      
          </properties>
      
          <build>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-release-plugin</artifactId>
                      <version>2.5.3</version>
                      <configuration>
                          <autoVersionSubmodules>true</autoVersionSubmodules>
                          <localCheckout>true</localCheckout>
                          <preparationGoals>
                              org.eclipse.tycho:tycho-versions-plugin:${tycho-version}:update-eclipse-metadata 
                              org.apache.maven.plugins:maven-scm-plugin:1.9.5:add 
                              <!-- org.apache.maven.plugins:maven-scm-plugin:1.9.5:checkin -->
                          </preparationGoals>
                          <completionGoals>
                              org.eclipse.tycho:tycho-versions-plugin:${tycho-version}:update-eclipse-metadata 
                              org.apache.maven.plugins:maven-scm-plugin:1.9.5:add 
                              <!-- org.apache.maven.plugins:maven-scm-plugin:1.9.5:checkin -->
                          </completionGoals>
                      </configuration>
                 </plugin>
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-scm-plugin</artifactId>
                     <version>1.9.5</version>
                     <executions>
                       <execution>
                         <id>default-cli</id>
                         <goals>
                           <goal>add</goal>
                           <goal>checkin</goal>
                         </goals>
                         <configuration>
                           <includes>**/META-INF/MANIFEST.MF,**/feature.xml,**/*.product</includes>
                           <excludes>**/target/**</excludes>
                         <message>Changing the version to reflect the pom versions for the release</message>
                         <basedir>${project.basedir}/../..</basedir>
                         <workingDirectory>${project.basedir}/../..</workingDirectory>
                         </configuration>
                       </execution>
                     </executions>
                   </plugin>
              </plugins>
      
      </project>
      

      Leads to output like this:

      [INFO] Executing: cmd.exe /X /C "git add – src\parent\src\submodule\addme.product"
      [INFO] Working directory: D:\git\project\src\parent\..\..
      [ERROR] Provider message:
      [ERROR] The git-add command failed.
      [ERROR] Command output:
      [ERROR] fatal: pathspec 'src\parent\src\submodule\addme.product' did not match any files

      I think this is the jgit provider, but am unsure how to check that it is not the gitexe provider.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            kutschkem Michael Kutschke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment