gnodet commented on PR #912: URL: https://github.com/apache/maven/pull/912#issuecomment-1358469551
> In a multimodule project, when I run `mvn package` on the root level, it correctly copies the JAR to **target/project-local-repo**. When I then run `mvn package` on a submodule, it fails with > > > Could not resolve dependencies for project <groupId>:<artifactId>:jar:0.1-SNAPSHOT: Could not find artifact <groupId>:<artifactId>:jar:0.1-SNAPSHOT > > From the ticket and the conversation we had, I would expect `mvn compile` not to work anymore - which I still consider a big loss! But `mvn package` was supposed to work in this scenario, right? I've tried to improve the PR to fully fix the `mvn verify -o -f submodule` use case. It was failing in various scenarii because the workspace reader was not used during in the early reactor phase. This happen in maven `master` if you run an initial `mvn package` but then try to `mvn validate -f maven-settings -o`: ``` ➜ maven git:(MNG-7629) /opt/homebrew/bin/mvn verify -DskipTests -o -f maven-settings [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] Non-resolvable import POM: Cannot access apache.snapshots (https://repository.apache.org/snapshots) in offline mode and the artifact org.apache.maven:maven-bom:pom:4.0.0-alpha-4-SNAPSHOT has not been downloaded from it before. @ org.apache.maven:maven:4.0.0-alpha-4-SNAPSHOT, /Users/gnodet/work/git/maven/pom.xml, line 186, column 19 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project org.apache.maven:maven-settings:4.0.0-alpha-4-SNAPSHOT (/Users/gnodet/work/git/maven/maven-settings/pom.xml) has 1 error [ERROR] Non-resolvable import POM: Cannot access apache.snapshots (https://repository.apache.org/snapshots) in offline mode and the artifact org.apache.maven:maven-bom:pom:4.0.0-alpha-4-SNAPSHOT has not been downloaded from it before. @ org.apache.maven:maven:4.0.0-alpha-4-SNAPSHOT, /Users/gnodet/work/git/maven/pom.xml, line 186, column 19 -> [Help 2] [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/ProjectBuildingException [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException ``` while with this PR, all previously built artifacts can be reused in a subsequent build. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
