Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mvn license:add-third-party fails when trying to fetch dependency from AWS CodeArtifact #426

Open
joonapo opened this issue Mar 31, 2022 · 0 comments

Comments

@joonapo
Copy link

joonapo commented Mar 31, 2022

We are storing some of our built java apps in AWS CodeArtifact and normal maven build (mvn install) is able to fetch those dependencies from the CodeArtifact. However in post build steps the license-maven-plugin fails to do so. I get the following error from the post build (redacted sensitive information):

Failed to execute goal org.codehaus.mojo:license-maven-plugin:2.0.0:add-third-party (default-cli) on project <project_name>: could not execute goal AddThirdPartyMojo for reason : ArtifactResolutionException: Unable to locate third party descriptor: Could not transfer artifact <artifact_name> from/to <aws_domain>-<aws_repo> (<aws_codeartifact_url>): Transfer failed for <aws_codeartifact_url>/<artifact_name>-third-party.properties 400 Bad Request -> [Help 1]

Some previous debugging on the CodeArtifact authentication taught me that HTTP 400 means that the request to the CodeArtifact didn't include auth token that is needed (document about the token). Basic usage of CodeArtifact with Maven build can be found here (basically store the auth token in env variable and in settings.xml give that varible's name to Maven). I would assume that currently the license plugin won't for some reason include the auth token to the CodeArtifact request, CodeArtifact returns HTTP 400 and plugin won't know how to handle that (related to this issue). Is there some way to configure license plugin to use that same authentication method as the mvn install uses? Or am I on a completely wrong track here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant