Recent changes in ProjectBuilder make that the compile roots could be
set erroneously on 1st phase and propagated in the results.
This patch just skips setting the compile source root in the 1st pass
(when buildParentIfNonExisting==false).
It also tests some other fields of MavenProject
Reviewers: Michael Osipov, Robert Scholte, Hervé Boutemy
This closes#274
Otherwise the sessionFinished event may be sent before some
projects/goals finish, which violates the contracts of execution
listeners and makes it hard to properly life cycle components that
are needed for goal execution.
This closes#272
This map is not used by Maven and the computation can be quite heavy, so lazily
compute it. In addition, do not clone the map as it's an unmodifiable one already.
This closes#263
If a dependency on another project is found, don't parse its
POM again, but instead use the model we already have in memory.
This saves a large amount of time and memory for builds that have
lots of subprojects and dependencies between them.
The approach was directly copied from DefaultArtifactDescriptorReader,
which does the same optimization.
This closes#244
ExcludesArtifactFilter was highly inefficient.
It took the group and artifact ID of an Exclusion, concatenated them into
a new String, which was kept in memory for the whole duration
of the build and then compared that String against the concatenation
of group and artifact ID of each incoming artifact, adding more
CPU cycles than necessary.
Instead we now just wrap the existing Exclusion object and check its
groupId and artifactId against the artifact to tell whether it should
be excluded.
The old class is kept around for binary compatibility, but is now unused.
Closes#243
* [MNG-6405] Fix basedir in MavenProject.deepCopy.
* Reproduced bug in test.
Failure without patch:
junit.framework.AssertionFailedError: Base directory is preserved across clone expected:<…/maven-core/target/test-classes> but was:<…/maven-core/target/test-classes/target>
at org.apache.maven.project.MavenProjectTest.testCloneWithBaseDir(MavenProjectTest.java:188)
* Code style. Not enforced in tests during build?
Initialize the interim project with "simple" items (ie do not build
not reference parent if it's not yet in the projectIndex) and returns
it when installation fails further.
This give a partial validation of the file, pretty convenient in IDEs.