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 Stringstatic final Stringprivate Function<MavenProject, String> private Function<MavenProject, String> private final Map<String, List<MavenProject>> private final Map<String, MavenProject> private final org.eclipse.aether.repository.WorkspaceRepositoryprivate final MavenSession -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate FiledeterminePreviouslyPackagedArtifactFile(MavenProject project, org.eclipse.aether.artifact.Artifact artifact) private Filefind(MavenProject project, org.eclipse.aether.artifact.Artifact artifact) findArtifact(org.eclipse.aether.artifact.Artifact artifact) private org.eclipse.aether.artifact.ArtifactfindMatchingArtifact(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.WorkspaceRepositoryprivate booleanhasArtifactFileFromPackagePhase(org.eclipse.aether.artifact.Artifact projectArtifact) private booleanhasBeenPackaged(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 booleanisTestArtifact(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:
getRepositoryin interfaceorg.eclipse.aether.repository.WorkspaceReader
-
findArtifact
- Specified by:
findArtifactin interfaceorg.eclipse.aether.repository.WorkspaceReader
-
findVersions
- Specified by:
findVersionsin interfaceorg.eclipse.aether.repository.WorkspaceReader
-
findModel
- Specified by:
findModelin 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
nullif 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:
trueif the artifact refers to test classes,falseotherwise.
-