Skip to content

Conversation

adpi2
Copy link
Member

@adpi2 adpi2 commented Dec 21, 2022

This PR is part of sbt/sbt#7096 whose goal is to fix sbt/sbt#3410 in a smooth way. For a full description please read sbt/sbt#7096.

Copy link

@julienrf julienrf left a comment

Choose a reason for hiding this comment

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

That looks great! Is it possible to test the resolution of sbt plugins?

@eed3si9n
Copy link
Member

@adpi2 Overall looks good to me as well. As I understood the conversation on Slack, the magic is that POM's <dependency> entry is transformed based on the extra attribute information available in Maven properties in the case of sbt plugins. For future reference, could you add a note to that effect in the commit message please?

@adpi2 adpi2 force-pushed the sbt-plugins-maven-path branch from d87a1ae to cad671f Compare December 23, 2022 15:07
sbt plugins were published to an invalid path with regard to Maven's
specifictation.

As of sbt 1.9 we produce two POMs, a deprecated one and a new one,
that is valid with regard to Maven resolution. When resolving,
we first try to resolve the new valid POM and we fallback to
the invalid one if needed.

In the new POM format, we append the sbt cross-version to all
artifactIds of sbt plugins. This is because we want Maven to be
able to resolve the plugin and all its dependencies.

When parsing it, we remove the cross-version suffix so that
the result of parsing the valid POM format is exactly the same
as parsing the deprecated POM format. Hence conflict resolution
happens as intended.

More details can be found at sbt/sbt#7096
@adpi2 adpi2 force-pushed the sbt-plugins-maven-path branch from cad671f to 5a0e9b2 Compare December 23, 2022 15:09
@adpi2
Copy link
Member Author

adpi2 commented Dec 23, 2022

I added a few more comments, and I rewrote the commit message.

Also I suggest we wait a bit before merging, until we agree on the implementation in coursier/coursier#2633.

@adpi2
Copy link
Member Author

adpi2 commented Feb 22, 2023

Coursier is now ready to resolve the new Maven pattern of sbt plugins:

@eed3si9n If you agree, I need your ✔️ to merge this PR.

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

Thanks @adpi2!

@adpi2 adpi2 merged commit 67ee08e into sbt:develop Feb 23, 2023
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.

The maven pattern for sbt plugins is invalid based on the spec
3 participants