I have a project that fails mvn package
in Azure Pipelines even if the same branch builds successfully locally. The issue is a missing dependency.
Locally, Maven downloads the dependency from
In Azure Pipelines it tries to download the dependency from
- https://repository-master.mulesoft.org/nexus/content/repositories/releases
- https://repository.mulesoft.org/nexus/content/repositories/public
The dependency is org.mule.connectors:mule-soap-engine:jar:1.6.11
, which does exist in Mulesoft Nexus EE repository, used locally, but doesn't exist in the public repositories used in Azure DevOps.
Both builds are using the same pom.xml
(same reflog). Since Mulesoft Nexus EE is a private repository, I have credentials configured in my local settings.xml
and I use MavenAuthenticate@0
to refer to the service connections in Azure Pipelines. MavenAuthenticate@0
seems to be working.
##[debug]mavenServiceConnections=4ff28bb5-a556-4220-9260-a1d89c8c7c6b
##[debug]4ff28bb5-a556-4220-9260-a1d89c8c7c6b=https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/
##[debug]4ff28bb5-a556-4220-9260-a1d89c8c7c6b exists true
##[debug]4ff28bb5-a556-4220-9260-a1d89c8c7c6b auth scheme = UsernamePassword
##[debug]4ff28bb5-a556-4220-9260-a1d89c8c7c6b data REPOSITORYID = MuleRepository
##[debug]Found username/password service connection for package source https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/
##[debug]Generating configs for 1 external repositories.
##[debug]Detected username/password credentials for 'https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/'
##[debug]Agent.Version=3.220.5
##[debug]set task variable: userM2SettingsXmlPath=/home/vsts/.m2/settings.xml
##[debug]Processed: ##vso[task.settaskvariable variable=userM2SettingsXmlPath;issecret=false;]/home/vsts/.m2/settings.xml
##[debug]Adding authentication to settings file /home/vsts/.m2/settings.xml.
##[debug]Agent.Version=3.220.5
##[debug]set task variable: backupUserM2SettingsFilePath=/home/vsts/.m2/_settings.xml
##[debug]Processed: ##vso[task.settaskvariable variable=backupUserM2SettingsFilePath;issecret=false;]/home/vsts/.m2/_settings.xml
##[debug]Writing new settings.xml with added authentication.
What I don't get is why Maven in Azure Pipelines is trying in different repositories, that aren't even mentioned in the pom.xml
or MavenAuthenticate@0
. I'm out of ideas on how to debug this.