Package org.apache.maven
Class ReactorReader
java.lang.Object
org.apache.maven.ReactorReader
- All Implemented Interfaces:
MavenWorkspaceReader
,org.eclipse.aether.repository.WorkspaceReader
An implementation of a workspace reader that knows how to search the Maven reactor for artifacts, either as packaged
jar if it has been built, or only compile output directory if packaging hasn't happened yet.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Collection<String>
static final String
static final String
private Function<MavenProject,
String> private Function<MavenProject,
String> private final Map<String,
List<MavenProject>> private final Map<String,
MavenProject> private final org.eclipse.aether.repository.WorkspaceRepository
private final MavenSession
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate File
determinePreviouslyPackagedArtifactFile
(MavenProject project, org.eclipse.aether.artifact.Artifact artifact) private File
find
(MavenProject project, org.eclipse.aether.artifact.Artifact artifact) findArtifact
(org.eclipse.aether.artifact.Artifact artifact) private org.eclipse.aether.artifact.Artifact
findMatchingArtifact
(MavenProject project, org.eclipse.aether.artifact.Artifact requestedArtifact) Tries to resolve the specified artifact from the artifacts of the given project.findModel
(org.eclipse.aether.artifact.Artifact artifact) findVersions
(org.eclipse.aether.artifact.Artifact artifact) org.eclipse.aether.repository.WorkspaceRepository
private boolean
hasArtifactFileFromPackagePhase
(org.eclipse.aether.artifact.Artifact projectArtifact) private boolean
hasBeenPackaged
(MavenProject project) private Predicate<org.eclipse.aether.artifact.Artifact>
isRequestedArtifact
(org.eclipse.aether.artifact.Artifact requestArtifact) We are taking as much as we can from the DefaultArtifact.equals().private static boolean
isTestArtifact
(org.eclipse.aether.artifact.Artifact artifact) Determines whether the specified artifact refers to test classes.
-
Field Details
-
HINT
- See Also:
-
PROJECT_LOCAL_REPO
- See Also:
-
COMPILE_PHASE_TYPES
-
session
-
projectsByGAV
-
projectsByGA
-
repository
private final org.eclipse.aether.repository.WorkspaceRepository repository -
projectIntoKey
-
projectIntoVersionlessKey
-
-
Constructor Details
-
ReactorReader
-
-
Method Details
-
getRepository
public org.eclipse.aether.repository.WorkspaceRepository getRepository()- Specified by:
getRepository
in interfaceorg.eclipse.aether.repository.WorkspaceReader
-
findArtifact
- Specified by:
findArtifact
in interfaceorg.eclipse.aether.repository.WorkspaceReader
-
findVersions
- Specified by:
findVersions
in interfaceorg.eclipse.aether.repository.WorkspaceReader
-
findModel
- Specified by:
findModel
in interfaceMavenWorkspaceReader
-
find
-
determinePreviouslyPackagedArtifactFile
private File determinePreviouslyPackagedArtifactFile(MavenProject project, org.eclipse.aether.artifact.Artifact artifact) -
hasArtifactFileFromPackagePhase
private boolean hasArtifactFileFromPackagePhase(org.eclipse.aether.artifact.Artifact projectArtifact) -
hasBeenPackaged
-
findMatchingArtifact
private org.eclipse.aether.artifact.Artifact findMatchingArtifact(MavenProject project, org.eclipse.aether.artifact.Artifact requestedArtifact) Tries to resolve the specified artifact from the artifacts of the given project.- Parameters:
project
- The project to try to resolve the artifact from, must not benull
.requestedArtifact
- The artifact to resolve, must not benull
.- Returns:
- The matching artifact from the project or
null
if not found. Note that this
-
isRequestedArtifact
private Predicate<org.eclipse.aether.artifact.Artifact> isRequestedArtifact(org.eclipse.aether.artifact.Artifact requestArtifact) We are taking as much as we can from the DefaultArtifact.equals(). The requested artifact has no file, so we want to remove that from the comparison.- Parameters:
requestArtifact
- checked against the given artifact.- Returns:
- true if equals, false otherwise.
-
isTestArtifact
private static boolean isTestArtifact(org.eclipse.aether.artifact.Artifact artifact) Determines whether the specified artifact refers to test classes.- Parameters:
artifact
- The artifact to check, must not benull
.- Returns:
true
if the artifact refers to test classes,false
otherwise.
-