I have an ADO release pipeline where I'd like to establish a connection with Maven and download a package as part of the release pipeline. However, I see the following error.
Error log
[ERROR] Plugin .apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for .apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact .apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (): transfer failed for .5/maven-clean-plugin-2.5.pom: Remote host terminated the handshake: SSL peer shut down incorrectly -> [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]
I have added "MavenAuthenticate@0" and "Maven@3" as part of the release pipeline, and also added a pom.xml to the project directory, but cannot figure out why the SSL connection with the Maven endpoint fails to be established.
pom.xml
<project xmlns=".0.0" xmlns:xsi="; xsi:schemaLocation=".0.0 .0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.TEAMNAME</groupId>
<artifactId>maven-artifact-generator</artifactId>
<version>1.0.0</version>
<repositories>
<repository>
<id>OUR AZURE ARTIFACTS FEED NAME</id>
<url>URL FOR THE PROJECT</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>central</id>
<url>/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>.openapitools</groupId>
<artifactId>openapi-generator-cli</artifactId>
<version>7.9.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Steps added to pipeline (.yml)
# Maven Authenticate v0
- task: MavenAuthenticate@0
displayName: Maven Authenticate
inputs:
artifactsFeeds: OUR AZURE ARTIFACTS FEED NAME, central
# Maven install
- task: Maven@3
inputs:
mavenPomFile: '$(Build.SourcesDirectory)\src\pom.xml'
goals: 'clean install'
options: '--batch-mode -X'
javaHomeOption: 'JDKVersion'
mavenVersionOption: 'Default'
I only noticed the SSL connection failing for a release pipeline and not a development pipeline, so I initially thought it may have something to do from a security perspective, so I followed the steps here but still no luck.
How can I establish a connection to Maven in a release ADO pipeline?