You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
API does not force ignoring of transitive repositories / mirros in plugins, e.g. assembly pluginΒ #13732
When upgrading to 3.10.0 or 4.0.0-rc-*, resolver 2 changed how dependency resolution works.
Without -Daether.remoteRepositoryFilter.prefixes.resolvePrefixFiles=false, some plugins, like assembly-plugin, will try to load prefixes from remote repos defined in dependencies.
Instead, I expected mirror configuration to be used (or remote repository filtering, as I defined).
So, this is interesting problem. As I see, we face multiple issues here. For start, the CLI -itr option (as can be seen in related changes #1469) is used by Resolver only, only during collection.
It uses Maven ProjectBuilder to build MavenProject for each dependency (!). Maven's project build treat (the dependency POM) as "current project", and obeys whatever stands in it, even repository definitions. Finally, the dependency is resolved using project repositories, and, as you noted, one dependency does define jvnet-nexus-releases repository. So, the artifact is being resolved with ProjectBuilder found repositories (this is how jvnet-nexus-releases comes into play), and RRF immediately kicks in, as "there is new repository seen", as at that moment, Resolver does not knows, does it or will it be used (will not, all is in Central).
OTOH1, just today on Slack someone brought up dependency handling in use cases like "as project" and "as dependency" (is declared as dependency). And in this case, we clearly violate this, as we use ProjectBuilder to build MavenProject "as project" of a dependency, only to later resolve it (again, there is no collection happening at all). To me, this looks wrong. In fact, build "as project" the dependency POM to me looks very heavy handed, as if you look why we need MavenProject down the road (only to get some interpolators), all of this looks a bit weird to me.
OTOH3, I hope it is visible how intents are overlapping/mixing here: we build dependency POMs "as project", and we want them behave "as dependency", which, MavenProject does not know of. This is a misuse of ProjectBuilder IMO, and a long discussion of "how to get effective model of some artifact".
OTOH4, so one could start tinkering to make ProjectBuilder "smarter" by making ProjectBuildingRequest (pbr) carry some flag "as dependency", and when it is turned on (-itr given on CLI), then ProjectBuilder should take measures to cut remote repositories, but this is becoming nonsensical, as pbr is already so much overloaded that is crazy. Also, even if MIMA MMR-like solution used, one still needs logic handling -itr as even MMR will hand over you the effective POM that will contain the repository, but some code should strip it off, when -itr is set.
Good question. It is a behavioural change that will cause timeouts on air gapped environments with no clear message what happens and why something happens. I find that actionable.
For sure something needs to be done, but IMHO not in 3.10.1 timeframe. We should keep this issue, maybe update it, as IMO same stands for 3.9.x lineage as well (it also has -itr, is not new in 3.10.x).... oh, but that version does not auto-resolve prefixes... right. Also, you provided a circumvention for this case (stop prefix auto resolution).
I'd say, we should remove this issue from 3.10.1 milestone.
Good question. It is a behavioural change that will cause timeouts on air gapped environments with no clear message what happens and why something happens. I find that actionable.
Or am I missing something?
Timeouts in an air gapped environment is exactly what's impacting me with I think this exact issue. Though as you guys have mentioned its a bit hard to tell if it is exactly this case. . Simply downgrading to 3.9 has been sufficient for now. CI build times exploded moving to 3.10 and I'm currently blaming these timeouts.
I am unfamiliar with -Daether.remoteRepositoryFilter.prefixes.resolvePrefixFiles=false. Are there any downsides to using this or should I just stick to 3.9.x
No downside of using it, you just get the "3.9 feel", as prefix files will not be auto-resolved for you. You can still provide them manually, if needed (but they, especially for Central, tend to be big).
No downside of using it, you just get the "3.9 feel", as prefix files will not be auto-resolved for you. You can still provide them manually, if needed (but they, especially for Central, tend to be big).
Any idea what to do for 3.10.2? I am not sure just given out the info about that "resolvePrefix" parameter would be sufficient and feasible. I am not sure what would be a good solution...
There is IMHO no "good solution" as long plugins use ProjectBuilder to build effective models of dependencies.
Again, this is why MIMA MMR exists, plus, the logic to obey -itr still needs to be added (to one getting effective model, so in this case m-assembly-p).
Activity
cstamas commentedon Oct 28, 2026
So, this is interesting problem. As I see, we face multiple issues here. For start, the CLI
-itroption (as can be seen in related changes #1469) is used by Resolver only, only during collection.The problem stems from m-assembly-p, and no Resolver collection is involved at all. Here is the problem:
https://github.com/apache/maven-assembly-plugin/blob/8ab476175f9343498394b1b871d355e043cefb9f/src/main/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTask.java#L151
It uses Maven ProjectBuilder to build
MavenProjectfor each dependency (!). Maven's project build treat (the dependency POM) as "current project", and obeys whatever stands in it, even repository definitions. Finally, the dependency is resolved using project repositories, and, as you noted, one dependency does definejvnet-nexus-releasesrepository. So, the artifact is being resolved with ProjectBuilder found repositories (this is howjvnet-nexus-releasescomes into play), and RRF immediately kicks in, as "there is new repository seen", as at that moment, Resolver does not knows, does it or will it be used (will not, all is in Central).OTOH1, just today on Slack someone brought up dependency handling in use cases like "as project" and "as dependency" (is declared as dependency). And in this case, we clearly violate this, as we use
ProjectBuilderto buildMavenProject"as project" of a dependency, only to later resolve it (again, there is no collection happening at all). To me, this looks wrong. In fact, build "as project" the dependency POM to me looks very heavy handed, as if you look why we needMavenProjectdown the road (only to get some interpolators), all of this looks a bit weird to me.OTOH2, this is why MIMA MMR extension exists, to be able to get "effective models" of dependencies (the "as dependency" use case), as explained in README: https://github.com/maveniverse/mima/tree/main/extensions/mmr
OTOH3, I hope it is visible how intents are overlapping/mixing here: we build dependency POMs "as project", and we want them behave "as dependency", which, MavenProject does not know of. This is a misuse of ProjectBuilder IMO, and a long discussion of "how to get effective model of some artifact".
OTOH4, so one could start tinkering to make ProjectBuilder "smarter" by making ProjectBuildingRequest (pbr) carry some flag "as dependency", and when it is turned on (
-itrgiven on CLI), then ProjectBuilder should take measures to cut remote repositories, but this is becoming nonsensical, as pbr is already so much overloaded that is crazy. Also, even if MIMA MMR-like solution used, one still needs logic handling-itras even MMR will hand over you the effective POM that will contain the repository, but some code should strip it off, when-itris set.bmarwell commentedon Oct 29, 2026
Question, would it obey global mirror configuration?
bmarwell commentedon Oct 29, 2026
I tried both configurations, and both worked:
Using a mirror config
I added
jvnet-nexus-releasesto the list of mirrors, which worked.Next was
sonatype-nexus-snapshots, but this one was not visible as INFO message. I had to use-Xor any suitable logger configuration.For this I added a repotiory configuration in
~/.m2/settings.xml, which also worked.cstamas commentedon Nov 8, 2026
Do we have anything actionable here? IMHO no, but @bmarwell as reporter should confirm.
bmarwell commentedon Nov 8, 2026
Good question. It is a behavioural change that will cause timeouts on air gapped environments with no clear message what happens and why something happens. I find that actionable.
Or am I missing something?
cstamas commentedon Nov 8, 2026
For sure something needs to be done, but IMHO not in 3.10.1 timeframe. We should keep this issue, maybe update it, as IMO same stands for 3.9.x lineage as well (it also has
-itr, is not new in 3.10.x).... oh, but that version does not auto-resolve prefixes... right. Also, you provided a circumvention for this case (stop prefix auto resolution).I'd say, we should remove this issue from 3.10.1 milestone.
cstamas commentedon Nov 8, 2026
btw, consider https://github.com/airlift/provisio as replacement for m-assembly-p, I really wonder what it does in this case.
@wendigo Any experience with provisio and 3.10.0?
tklasik commentedon Nov 9, 2026
Timeouts in an air gapped environment is exactly what's impacting me with I think this exact issue. Though as you guys have mentioned its a bit hard to tell if it is exactly this case. . Simply downgrading to 3.9 has been sufficient for now. CI build times exploded moving to 3.10 and I'm currently blaming these timeouts.
I am unfamiliar with
-Daether.remoteRepositoryFilter.prefixes.resolvePrefixFiles=false. Are there any downsides to using this or should I just stick to 3.9.xcstamas commentedon Nov 10, 2026
No downside of using it, you just get the "3.9 feel", as prefix files will not be auto-resolved for you. You can still provide them manually, if needed (but they, especially for Central, tend to be big).
bmarwell commentedon Nov 12, 2026
Any idea what to do for 3.10.2? I am not sure just given out the info about that "resolvePrefix" parameter would be sufficient and feasible. I am not sure what would be a good solution...
cstamas commentedon Nov 17, 2026
There is IMHO no "good solution" as long plugins use
ProjectBuilderto build effective models of dependencies.Again, this is why MIMA MMR exists, plus, the logic to obey
-itrstill needs to be added (to one getting effective model, so in this case m-assembly-p).