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

Warn about use of ~/.m2/repository #2929

Merged
merged 2 commits into from Mar 25, 2024
Merged

Conversation

ghostbuster91
Copy link
Contributor

@ghostbuster91 ghostbuster91 commented Feb 15, 2024

We have just run ourselves into a weird issue with coursier where it would fail with artifact not found error. After closer inspection it turned out that it was because of use of ~/.m2/repository as a coursier repository.

I think that it would be great to add a warning to the documentation about this.

This was also mentioned here #1832 (comment)

This directory is maven internal files-system cache and afaik its layout can change without prior notice. It also can contain POMs without corresponding jars (e.g. when a transitive dependency was evicted due to a version conflict) which confuses coursier.

See problem reproduction and more details in https://github.com/ghostbuster91/demos/tree/coursier-not-found

This directory is maven internal files-system cache. Its layout can change without prior notice. It also can contain POMs without corresponding jars (e.g. when a transitive dependency was evicted due to a version conflict) which confuses coursier. 

See problem reproduction and more details in https://github.com/ghostbuster91/demos/tree/coursier-not-found
Copy link
Contributor

@lefou lefou left a comment

Choose a reason for hiding this comment

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

I saw these kind of warnings earlier in the source code and must say I don't like them as they are. That means, they are not actionable, so the used has no clue why they are risky, so they can't decide what risks they face and whether they want to deal with it or not.

The option to integrate with a local Maven repository is often the only choice to use another build tool than Maven. Therefore, this is a good feature, although it comes with some issues.

So we either add some links, e.g. the the issue you mentioned in the PR comment, or some text outlining the kind of issue a user should anticipate when using it. Maybe, also some workaround or fix actions.

@ghostbuster91
Copy link
Contributor Author

I see your point. I expanded that section a bit, let me know if this is enough.

Copy link
Contributor

@lefou lefou left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks.

Copy link
Collaborator

@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.

Thanks!

@tgodzik tgodzik merged commit 98e551c into coursier:main Mar 25, 2024
23 checks passed
@ghostbuster91 ghostbuster91 deleted the warn-about-m2 branch March 25, 2024 19:59
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.

None yet

3 participants