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

Fix resolution of test-jar artifacts #1747

Merged
merged 3 commits into from
Jul 1, 2022

Conversation

keynmol
Copy link
Collaborator

@keynmol keynmol commented Jun 30, 2022

Update: this is indeed a separate issue with the fix provided in 3a1d935


context:

The problem I saw is related to #1727, but in the case of a test-jar external dependency - it wasn't being added to test scope classpath at all.

While tinkering at it, I also noticed that manual translation between Aether and Maven's Artifact types is not required, as there seems to be a method for that, used in Maven's own sources. Turns out it's not part of public API so it's better not to use it.

And finally, I added a test to specifically verify that <...>-tests.jar is resolved.

I think this "fix" is somewhat different to #1727, and is worth a separate review.

@keynmol keynmol changed the title Use Maven's RepositoryUtils to convert Artifact types Fix resolution of test-jar artifacts Jun 30, 2022
artifact.getVersion()
)
)
request.setArtifact(RepositoryUtils.toArtifact(artifact))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java#L56-L60 I can see it's an internal tool and shouldn't be used, hence I will revert it.

Will need to duplicate some of its logic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 8a606df

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks 🎉

@tgodzik tgodzik merged commit 2b7064d into scalacenter:main Jul 1, 2022
@keynmol keynmol deleted the use-RepositoryUtils branch July 1, 2022 20:30
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

Successfully merging this pull request may close these issues.

2 participants