[
https://issues.apache.org/jira/browse/MRESOLVER-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17689671#comment-17689671
]
Tamas Cservenak edited comment on MRESOLVER-322 at 2/16/23 10:11 AM:
---------------------------------------------------------------------
This is not a resolver bug at all, but accumulated legacy and deprecated code
usage in flatten plugin sadly. Created PR
[https://github.com/mojohaus/flatten-maven-plugin/pull/336] as proof, but I
myself have no time to finish it off right now. With that PR flatten plugin
should work not only with split repo, but with every other new resolver feature
as well.
was (Author: cstamas):
This is not a resolver bug at all, but accumulated legacy and deprecated code
usage in flatten plugin sadly. Created PR
[https://github.com/mojohaus/flatten-maven-plugin/pull/336] as proof, by myself
have no time to finish it right now.
> Local repository split (releases/snapshots) fails with flatten-maven-plugin
> and imported dependencies
> -----------------------------------------------------------------------------------------------------
>
> Key: MRESOLVER-322
> URL: https://issues.apache.org/jira/browse/MRESOLVER-322
> Project: Maven Resolver
> Issue Type: Bug
> Components: Resolver
> Affects Versions: 1.9.4
> Environment: maven 3.9.0, OpenJDK 1.8.0_362_b09, macos Ventura 13.2.1
> Reporter: Christian Domsch
> Priority: Major
> Attachments: resolver-bug.zip
>
>
> When you enable the enhanced LRM with the split for snapshot and release
> versions and have a project in which the
> [flatten-maven-plugin|https://www.mojohaus.org/flatten-maven-plugin/] is used
> and have a imported dependency (junit5 e.g.) the flatten plugin will fail
> with what looks like resolver issues to me.
> {noformat}
> [INFO] Scanning for projects...
> [INFO]
> [INFO] -------------------< com.assentis.test:resolver-bug
> >-------------------
> [INFO] Building resolver-bug 1.0.0-SNAPSHOT
> [INFO] from pom.xml
> [INFO] --------------------------------[ jar
> ]---------------------------------
> [INFO]
> [INFO] --- clean:3.2.0:clean (default-clean) @ resolver-bug ---
> [INFO]
> [INFO] --- flatten:1.3.0:clean (flatten.clean) @ resolver-bug ---
> [INFO]
> [INFO] --- resources:3.3.0:resources (default-resources) @ resolver-bug ---
> [INFO] skip non existing resourceDirectory
> /opt/projects/workspaces/tools/maven.apache/resolver-bug/src/main/resources
> [INFO]
> [INFO] --- flatten:1.3.0:flatten (flatten) @ resolver-bug ---
> [INFO] Generating flattened POM of project
> com.assentis.test:resolver-bug:jar:1.0.0-SNAPSHOT...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 0.947 s
> [INFO] Finished at: 2023-02-15T13:11:44+01:00
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.codehaus.mojo:flatten-maven-plugin:1.3.0:flatten (flatten) on project
> resolver-bug: 2 problems were encountered while building the effective model
> for com.assentis.test:resolver-bug:1.0.0-SNAPSHOT
> [ERROR] [FATAL] Non-readable POM
> /opt/projects/repository2/org/junit/junit-bom/5.9.1/junit-bom-5.9.1.pom:
> /opt/projects/repository2/org/junit/junit-bom/5.9.1/junit-bom-5.9.1.pom (No
> such file or directory) @
> /opt/projects/repository2/org/junit/junit-bom/5.9.1/junit-bom-5.9.1.pom
> [ERROR] [ERROR] 'dependencies.dependency.version' for
> org.junit.jupiter:junit-jupiter:jar is missing. @
> [ERROR]
> [ERROR] -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please
> read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
> {noformat}
> I am not fully sure who is at fault here (the resolver or the plugin), but I
> believe the changes the enhanced LRM is doing should be transparent to the
> plugins. I did a bit of debugging and it looks like what bugs out is the
> building of the maven model, which is outside of the plugin.
> I attached a minimal project to replicate the issue.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)