Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.0-beta-1
-
Component/s: Plugins and Lifecycle
-
Labels:None
-
Environment:any
Description
When compiling or packaging a project consisting of subprojects
where one depends on another, maven should first check the build environment
for existing jars or classes (in target/ directories) from the dependent subproject,
rather than always looking in the local and remote repositories for jar artifacts.
Attached is a very simple test-case with 2 subprojects, where one depends
on the other.
Only m2 install works; m2 compile and m2 package should also work.
Issue Links
- relates to
-
MNG-2921
ejb-client dependency no longer resolved in reactor build
-
-
MNG-1088
Plugins built and used within the same multiproject build fail unless lifecycle phase is compile or later
-
-
MNG-3043
Allow 'mvn test' to work with test-jar dependencies in a reactor
-
-
MNG-870
Make plugin discovery reactor aware
-
I think this is possible, and a good idea.
the compile phase does not require the resources of the other projects - just their classes. So when getting the classpath elements in maven-core, anything inside the reactor for compile can be passed back as target/classes directories, etc.
My only problem with this is if too much hardwiring of phase <-> code occurs in maven-core. That would need some investigation, but in theory this is a good idea.
It will also be a little faster, and makes the compile step somewhat more atomic (if compile fails, nothing is installed, for example)