-
Task
-
Resolution: Cannot Reproduce
-
Minor
-
Apache Maven 3.0.5, OS 'linux' Version "3.10.0-693.11.6.el7_4.x86_64/jre, Maven-dependency-plugin:3.1.0
Context:
Trying to move .zip file from Nexus Maven repository using Jenkins' withMaven plugin. However, Jenkins incorrectly references Parent POM file when there isn't a POM file in the repository.
Error Message (With redacted URL):
Failed to execute goal org.apache.maven.plugins:maven-dependency- plugin:3.1.0:get (default-cli) on project standalone-pom: Couldn't download artifact: Failed to read artifact descriptor for com.company.app.apigee:template-api:zip:dev:LATEST: Could not transfer artifact com.company.app.apigee:parent-pom:pom:1.0 from/to maven-snapshots (http://app-apigw-devops-nexus.srv.company:8081/repository/maven- snapshots/): Failed to transfer file: http://app-apigw-devops- nexus.srv.company:8081/repository/maven- snapshots/com/company/app/apigee/parent-pom/1.0/parent-pom-1.0.pom. Return code is: 400 , ReasonPhrase:Repository version policy: SNAPSHOT does not allow version: 1.0. -> [Help 1]
Input to Jenkins' Pipeline configuration:
node { stage('Deploy from Nexus') { withMaven(maven: 'M3') { sh 'mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.0:get ' + '-Dartifact=com.company.app.apigee:template-api:LATEST:zip:dev ' + '-DremoteRepositories=maven-snapshots::default::http://app-apigw-devops-nexus.srv.company:8081/repository/maven-snapshots/ ' + '-Dtransitive=false -e -X' } } }
Additional Info:
Content of Template-api-1.0-20180509.042951-1.pom:
<?xml version="1.0" encoding="UTF-8"?> <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"> <modelVersion>4.0.0</modelVersion> <groupId>com.company.app.apigee</groupId> <artifactId>template-api</artifactId> <version>1.0-SNAPSHOT</version> <packaging>zip</packaging> </project>
Content of maven-metadata.xml:
<?xml version="1.0" encoding="UTF-8"?> <metadata> <groupId>com.company.app.apigee</groupId> <artifactId>template-api</artifactId> <versioning> <versions> <version>1.0-SNAPSHOT</version> </versions> <lastUpdated>20180509050620</lastUpdated> </versioning> </metadata>