github / maven-plugins

Official GitHub Maven Plugins
MIT License
584 stars 198 forks source link

Cannot download from dependency as all artifacts uploaded has a different name because of date suffix #123

Closed donkeysharp closed 7 years ago

donkeysharp commented 7 years ago

Hi, When I run mvn clean deploy it uploads my artifacts successfully to my repository. I have these settings on my pom.xml for uploading:

        ... 
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.mycompany.app</groupId>
        <artifactId>my-app</artifactId>
        <packaging>jar</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>my-app</name>
   ...
       <distributionManagement>
            <repository>
                <id>internal.repo</id>
                <name>Temporary Staging Repository</name>
                <url>file://${project.build.directory}/mvn-repo</url>
            </repository>
        </distributionManagement>
        <properties>
          <github.global.server>github</github.global.server>
        </properties>
        <build>
          <plugins>
            <plugin>
              <artifactId>maven-deploy-plugin</artifactId>
              <version>2.8.1</version>
              <configuration>
                <altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo</altDeploymentRepository>
              </configuration>
            </plugin>
            <plugin>
              <groupId>com.github.github</groupId>
              <artifactId>site-maven-plugin</artifactId>
              <version>0.12</version>
              <configuration>
                <message>Maven artifacts for ${project.version}</message>
                <noJekyll>true</noJekyll>
                <outputDirectory>${project.build.directory}/mvn-repo</outputDirectory>
                <branch>refs/heads/mvn-repo</branch>
                <!-- If you remove this then the old artifact will be removed and new
                  one will replace. But with the merge tag you can just release by changing
                  the version -->
                <merge>true</merge>
                <includes>
                  <include>**/*</include>
                </includes>

                <!-- github settings -->
                <!-- <host>github.com</host> -->
                <repositoryName>repo-maven-poc</repositoryName>
                <repositoryOwner>donkeysharp</repositoryOwner>
              </configuration>
              <executions>
                <execution>
                  <goals>
                    <goal>site</goal>
                  </goals>
                  <phase>deploy</phase>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </build>
.....

And in other project I want to use this dependency I have this pom.xml:

    <repositories>
      <repository>
           <id>donkeysharp</id>
           <name>repo-maven-poc</name>
           <url>https://raw.github.com/donkeysharp/repo-maven-poc/mvn-repo/</url>
           <snapshots>
                  <enabled>true</enabled>
                  <updatePolicy>always</updatePolicy>
               </snapshots>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.mycompany.app</groupId>
            <artifactId>myapp</artifactId>
            <version>1.0</version>
        </dependency>
    </dependencies>

When running mvn clean install on this other project it tries to download: https://raw.github.com/donkeysharp/repo-maven-poc/mvn-repo/com/mycompany/app/myapp/1.0/myapp-1.0.pom but on there is no such file but others like

I saw that on maven-metadata.xml this last version is set but when maven tries to download it cannot add this date suffix.

The logs when trying to build is this:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Hello World Web Application Repository 1.0.0
[INFO] ------------------------------------------------------------------------
Downloading: https://raw.github.com/donkeysharp/repo-maven-poc/mvn-repo/com/mycompany/app/myapp/1.0/myapp-1.0.pom
Downloading: https://repo.maven.apache.org/maven2/com/mycompany/app/myapp/1.0/myapp-1.0.pom
[WARNING] The POM for com.mycompany.app:myapp:jar:1.0 is missing, no dependency information available
Downloading: https://raw.github.com/donkeysharp/repo-maven-poc/mvn-repo/com/mycompany/app/myapp/1.0/myapp-1.0.jar
Downloading: https://repo.maven.apache.org/maven2/com/mycompany/app/myapp/1.0/myapp-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.974 s
[INFO] Finished at: 2017-01-04T18:40:10-04:00
[INFO] Final Memory: 11M/150M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project hello-world-war: Could not resolve dependencies for project com.efsavage:hello-world-war:war:1.0.0: Could not find artifact com.mycompany.app:myapp:jar:1.0 in donkeysharp (https://raw.github.com/donkeysharp/repo-maven-poc/mvn-repo/) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
donkeysharp commented 7 years ago

I'm very sorry, it was my bad at all, the problem was I was not specifying the name well so maven-metadata.xml couldn't download and read latest version. I hope I could delete this issue but it's not possible. I'm closing this issue

nancybansal-xperts commented 6 years ago

Hi , I am getting same error .Could you please let me know where you have mentioned the wrong file name??

nancybansal-xperts commented 6 years ago

Actually, I am trying to load the 13 jar files from github into my maven project via Teamcity tool .However , I am facing issues in downloading the jars of exact size from github.