0

I have an aggregator POM file and two Maven projects:

  1. sample-project-runner-parent - This is the Parent Artifact

    a) sample-project-runner-model - The first child module

    b) sample-project-runner - The second child module

I am using mvn clean package deploy and I see the three artifacts being uploaded to the artifactory (http://vdi-setup-repo.com/artifactory/codemanagement-maven)

For deployment to server I have another maven project which uses the Maven dependency plugin to pull/copy the JAR from artifactory (jFrog in my case) and use the downloaded files for further deployment.

For some reason maven tries to download the JAR from https://vdi-setup-repo.com/artifactory/libs-snapshot instead of http://vdi-setup-repo.com/artifactory/codemanagement-maven

Console Logs:

Downloaded: http://vdi-setup-repo.com/artifactory/codemanagement-maven/com/sample/codes/sample-project/sample-project-runner/1.0.6-SNAPSHOT/sample-project-runner-1.0.6-20201020.172731-2.pom (5 KB at 69.5 KB/sec)
Downloading: https://vdi-setup-repo.com/artifactory/libs-snapshot/com/sample/codes/sample-project/sample-project-runner-parent/1.0.6-SNAPSHOT/sample-project-runner-parent-1.0.6-20201020.172713-2.pom
         
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.659 s
[INFO] Finished at: 2020-10-20T17:27:38+00:00
[INFO] Final Memory: 28M/892M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy (copy) on project deploy-sample-project-runner: Unable to find/resolve artifact. Failed to read artifact descriptor for com.sample.codes.sample-project:sample-project-runner:jar:1.0.6-SNAPSHOT: Could not find artifact com.sample.codes.sample-project:sample-project-runner-parent:pom:1.0.6-20201020.172713-2 in snapshots (https://vdi-setup-repo.com/artifactory/libs-snapshot) -> [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/MojoExecutionException

I do have the repository specified in all the POM files as below:

<repositories>
        <repository>
            <id>codemanagement-maven</id>
            <url>http://vdi-setup-repo.com/artifactory/codemanagement-maven</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>codemanagement-maven</id>
            <name>codemanagement-maven</name>
            <url>http://vdi-setup-repo.com/artifactory/codemanagement-maven</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

The copy plugin from Deployer POM File:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.1.2</version>
                <executions>
                  <execution>
                    <id>copy</id>
                    <phase>package</phase>
                    <goals>
                      <goal>copy</goal>
                    </goals>
                    <configuration>
                      <artifactItems>
                        <artifactItem>
                          <groupId>com.sample.codes.sample-project</groupId>
                          <artifactId>sample-project-runner</artifactId>                          
                          <version>${currentProjectVersion}</version>
                          <type>jar</type>                        
                          <overWrite>true</overWrite>
                          <outputDirectory>.</outputDirectory>
                          <destFileName>${customFilename}</destFileName>
                        </artifactItem>
                      </artifactItems>
                      <!-- other configurations here -->
                    </configuration>
                  </execution>
                </executions>
              </plugin>

I am unable to figure out why maven tries to download the artifact from libs-snapshot even when the repository is specified. Earlier this issue was happening intermittently but off lately its failing for every execution with this error.

Am I missing on any additional configuration?

Any help is appreciated.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.