[
https://issues.apache.org/jira/browse/MNG-7629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17649487#comment-17649487
]
ASF GitHub Bot commented on MNG-7629:
-------------------------------------
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.
> Revert MNG-6118 and provide a better solution for it
> ----------------------------------------------------
>
> Key: MNG-7629
> URL: https://issues.apache.org/jira/browse/MNG-7629
> Project: Maven
> Issue Type: Task
> Reporter: Guillaume Nodet
> Assignee: Guillaume Nodet
> Priority: Major
> Fix For: 4.0.0-alpha-4
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)