seregamorph commented on issue #12646:
URL: https://github.com/apache/maven/issues/12646#issuecomment-5145943841

   @gnodet do I understand correctly that there are reasons why the 
`moduleDir/target/module.jar` are not used, and the 3rd copy of .jar files 
(`target` of module, `.m2/repository` and now 
`$rootDir/target/project-local-repo`) was introduced. Something like "we cannot 
be sure that target directory is clean enough to get artifacts from it".
   I was solving a pretty similar problem and introduced 
https://github.com/maven-turbo-reactor/maven-local-workspace-reader , the 
extension which switches the `WorkspaceReader` to `LocalReactorWorkspaceReader` 
if the JAR artifact of the module is available, see 
https://github.com/maven-turbo-reactor/maven-local-workspace-reader/blob/master/src/main/java/com/github/seregamorph/maven/extension/local/LocalReactorRepositorySessionDecorator.java
 . Is it a considerable option to make such behavior in Maven 4? It works quite 
well for our goals, e.g. you can run `mvn package -DskipTests`, and then, in a 
separate command `mvn surefire:test -pl :single-module` - it resolves JAR 
dependencies from the other modules target directories, not .m2/repository. 
This is crucial e.g. when you have multiple `git worktree`s for the same 
project.
   
   Curious on your opinion.
   
   cc @cstamas 


-- 
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]

Reply via email to