[MNG-7471] 3.9.x Make Resolver util and connector-basic provided#732
[MNG-7471] 3.9.x Make Resolver util and connector-basic provided#732cstamas wants to merge 2 commits intomaven-3.9.xfrom
Conversation
The util is exportedArtifact AND exportedPackage The connector-basic is only exportedArtifact. Reasoning: * exportedArtifact -- prevents "own" artifact to be added to realm * exportedPackage -- makes it "visible" in realm So, this basically prevents bad versions of util and connector-basic enter the plugin realm (as they will be not added to it), while util remains "visible" to plugins, as the intent was, most common due GenericVersions etc.
|
What does this logically change and the reasoning? |
Did you read PR description fully? 😄 |
|
Now I did. Honestly, I have no clue here. I totally trust your judgement. |
…resolver-provided
|
Stupid question: Do we need an IT which proves that these changes are required? |
|
|
The CI failed on macOS as for some reason Bootstrap failed, and hence, many unrelated ITs failed as well (as things were not present in local repo) |
reason: try re-run filed build |
Whatever the reason is, it is unrelated to change in this PR, that was my point. Probably some networking issue on GH side... |
exactly GH issue ... |
|
Testing again... |
Problem: resolver spi, impl and connector-basic has changes in 1.8.0 (SPI interface RepositoryLayout got new method, that is implemented in connector-basic, and code from impl is using it). But, Maven core exports only resolver api, spi and impl packages, while the rest is at mercy of a plugin. This means ,that these artifacts (api, spi and impl) will always come from Maven core, whatever version plugin declares, while the "rest" (connector-basic and util) will be of version that plugin declares. The current state hence prevented ANY KIND of changes on SPI interfaces that would be implemented in connector-basic (which is the case in Resolver 1.8.0). Solution: make all these resolver artifacts "provided" (to behave like maven-core or maven-plugin-api is behaving): simply put, whatever resolver artifact plugin depends on, it should NOT use it's own version, but the version from Maven. This ensures that api-spi-impl-connector-basic as "aligned" and are same version. Details: The change is to make util is exportedArtifact AND exportedPackage, while connector-basic is only exportedArtifact. Reasoning: * exportedArtifact -- prevents "own" artifact to be added to realm * exportedPackage -- makes it "visible" in realm So, this basically prevents bad versions of util and connector-basic enter the plugin realm (as they will be not added to it), while util remains "visible" to plugins, as the intent was, most common due GenericVersions etc. This change also results in simpler expectations to plugin developers: resolver libraries should really behave like maven-core or maven-compat: when plugin declares dependency on these (w/ scope provided as best practice), they really get version of these that are of version that maven runs in, not version they declare. So same thing happens now with resolver: you will get same version of resolver that maven uses your plugin runs in. Before this change, it was a mixed bag: api, spi and impl was from maven, while util and connector-basic was version you pulled in as dep.
Problem: resolver spi, impl and connector-basic has changes in 1.8.0 (SPI interface RepositoryLayout got new method, that is implemented in connector-basic, and code from impl is using it). But, Maven core exports only resolver api, spi and impl packages, while the rest is at mercy of a plugin. This means ,that these artifacts (api, spi and impl) will always come from Maven core, whatever version plugin declares, while the "rest" (connector-basic and util) will be of version that plugin declares. The current state hence prevented ANY KIND of changes on SPI interfaces that would be implemented in connector-basic (which is the case in Resolver 1.8.0). Solution: make all these resolver artifacts "provided" (to behave like maven-core or maven-plugin-api is behaving): simply put, whatever resolver artifact plugin depends on, it should NOT use it's own version, but the version from Maven. This ensures that api-spi-impl-connector-basic as "aligned" and are same version. Details: The change is to make util is exportedArtifact AND exportedPackage, while connector-basic is only exportedArtifact. Reasoning: * exportedArtifact -- prevents "own" artifact to be added to realm * exportedPackage -- makes it "visible" in realm So, this basically prevents bad versions of util and connector-basic enter the plugin realm (as they will be not added to it), while util remains "visible" to plugins, as the intent was, most common due GenericVersions etc. This change also results in simpler expectations to plugin developers: resolver libraries should really behave like maven-core or maven-compat: when plugin declares dependency on these (w/ scope provided as best practice), they really get version of these that are of version that maven runs in, not version they declare. So same thing happens now with resolver: you will get same version of resolver that maven uses your plugin runs in. Before this change, it was a mixed bag: api, spi and impl was from maven, while util and connector-basic was version you pulled in as dep.
…#158) An IT for Maven 3.9+ that "exercise" both resolver transport: wagon and native (so we have 2 tests both forcing transport with `-Dmaven.resolver.transport` one wagon (which is default, but setting is there to be explicit) and once native. It builds a project that needs a plugin (to pull it will use set transport), and that plugin will use resolver as well to resolve set artifact. If any of these fails, maven project fails. Related fix: apache/maven#732 (jn maven-3.9.x and master)
|
Hi @cstamas, why was the package of |
|
Service locator is deprecated, will be removed, so stay away from it. See instead this https://github.com/maveniverse/mima |
…apache#158) An IT for Maven 3.9+ that "exercise" both resolver transport: wagon and native (so we have 2 tests both forcing transport with `-Dmaven.resolver.transport` one wagon (which is default, but setting is there to be explicit) and once native. It builds a project that needs a plugin (to pull it will use set transport), and that plugin will use resolver as well to resolve set artifact. If any of these fails, maven project fails. Related fix: apache#732 (jn maven-3.9.x and master)
|
Resolve #9282 |
Problem: resolver spi, impl and connector-basic has changes in 1.8.0 (SPI interface RepositoryLayout got new method, that is implemented in connector-basic, and code from impl is using it). But, Maven core exports only resolver api, spi and impl packages, while the rest is at mercy of a plugin. This means ,that these artifacts (api, spi and impl) will always come from Maven core, whatever version plugin declares, while the "rest" (connector-basic and util) will be of version that plugin declares. The current state hence prevented ANY KIND of changes on SPI interfaces that would be implemented in connector-basic (which is the case in Resolver 1.8.0).
Solution: make all these resolver artifacts "provided" (to behave like maven-core or maven-plugin-api is behaving): simply put, whatever resolver artifact plugin depends on, it should NOT use it's own version, but the version from Maven. This ensures that api-spi-impl-connector-basic as "aligned" and are same version.
Details:
The change is to make util is exportedArtifact AND exportedPackage, while connector-basic is only exportedArtifact.
Reasoning:
So, this basically prevents bad versions of util and connector-basic
enter the plugin realm (as they will be not added to it), while
util remains "visible" to plugins, as the intent was, most
common due GenericVersions etc.
This change also results in simpler expectations to plugin developers:
resolver libraries should really behave like maven-core or maven-compat:
when plugin declares dependency on these (w/ scope provided as best
practice), they really get version of these that are of version that
maven runs in, not version they declare. So same thing happens now with
resolver: you will get same version of resolver that maven uses your plugin
runs in.
Before this change, it was a mixed bag: api, spi and impl was from maven,
while util and connector-basic was version you pulled in as dep.
https://issues.apache.org/jira/browse/MNG-7471