mavenazure-devopspom.xmlazure-artifacts

lionbridge-connector on Azure Artifacts gives Dependency Error


I'm trying to migrate our Maven artifacts from Nexus to Azure Artifacts, but I've run into a problem due to the "lionbridge-connector.all.author" artefact. This artefact is zip archive, where the pom resides only within the archive. On Nexus, we were able to upload the archive as is provided, but when deploying to Azure Artifacts with "mvn deploy:deploy-file", the pom file keeps getting extracted and uploaded separately to the feed.

Because of this, when building the project, maven attempts to resolve its pom dependencies instead of treating the archive like a file.

Error:

[ERROR] Failed to execute goal on project project-3rd-party-container: Could not resolve dependencies for project com.proj.aem:project-3rd-party-container:content-package:2.18.0-SNAPSHOT: Failed to collect dependencies at com.adobe.cloud.translation.connector:lionbridge-connector.all.author:zip:5.1.1: Failed to read artifact descriptor for com.adobe.cloud.translation.connector:lionbridge-connector.all.author:zip:5.1.1: The following artifacts could not be resolved: com.adobe.cloud.translation.connector:lionbridge-connector:pom:5.1.1 (absent): Could not find artifact com.adobe.cloud.translation.connector:lionbridge-connector:pom:5.1.1 in azure-feed (https://pkgs.dev.azure.com/my-organization/project-id/_packaging/azure-feed/maven/v1)

I was unable to find a way to upload the package without the pom file and I also don't know of any way to tell maven to stop resolving the pom for this particular dependency. The parent dependency mentioned in the error "lionbridge-connector" most likely doesn't exist and isn't meant to be read. Does anyone else know of a way to solve this issue? It's been haunting me for days.

Tried uploading archive without pom file by renaming the pom file. The project skipped over the pom but failed to build successfully. Tried adding the tag to the dependency, but didn't work.


Solution

  • It seems I couldn't upload the artifact for lionbridge-connector successfully was because I wasn't using the parameter -DgeneratePom correctly.

    Nexus is a lot more permissive when it comes to managing artifact versions and allows uploading manually even without POM files. Maven deploy doesn't allow that, however. A POM file must be present for each version. lionbridge-connector is a .zip archive without a POM. If you try deploying it via mvn deploy:deploy-file with -DgeneratePom=false, Maven will actually extract the POM from the archive META-INF. This was mainly the cause for the error, the bad POM file.

    What I had to do was set -DgeneratePom=true to allow Maven to generate a default POM file for my .zip archive. This has solved my issue.