Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-8005] do not ignore ide WorkspaceReader #1372

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion maven-core/src/main/java/org/apache/maven/DefaultMaven.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.RepositorySystemSession.CloseableSession;
import org.eclipse.aether.repository.WorkspaceReader;
import org.eclipse.sisu.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.helpers.MessageFormatter;
Expand All @@ -100,6 +101,8 @@ public class DefaultMaven implements Maven {

private final DefaultRepositorySystemSessionFactory repositorySessionFactory;

private final WorkspaceReader workspaceRepository;

private final GraphBuilder graphBuilder;

private final BuildResumptionAnalyzer buildResumptionAnalyzer;
Expand All @@ -121,6 +124,7 @@ public DefaultMaven(
LegacySupport legacySupport,
SessionScope sessionScope,
DefaultRepositorySystemSessionFactory repositorySessionFactory,
@Nullable @Named("ide") WorkspaceReader workspaceRepository,
@Named(GraphBuilder.HINT) GraphBuilder graphBuilder,
BuildResumptionAnalyzer buildResumptionAnalyzer,
BuildResumptionDataRepository buildResumptionDataRepository,
Expand All @@ -132,6 +136,7 @@ public DefaultMaven(
this.legacySupport = legacySupport;
this.sessionScope = sessionScope;
this.repositorySessionFactory = repositorySessionFactory;
this.workspaceRepository = workspaceRepository;
this.graphBuilder = graphBuilder;
this.buildResumptionAnalyzer = buildResumptionAnalyzer;
this.buildResumptionDataRepository = buildResumptionDataRepository;
Expand Down Expand Up @@ -238,8 +243,15 @@ private MavenExecutionResult doExecute(
}

try {
List<WorkspaceReader> readers = new ArrayList<>();
WorkspaceReader reactorReader = lookup.lookup(WorkspaceReader.class, ReactorReader.HINT);
chainedWorkspaceReader.setReaders(Collections.singletonList(reactorReader));
readers.add(reactorReader);
if (request.getWorkspaceReader() != null) {
readers.add(request.getWorkspaceReader());
} else if (workspaceRepository != null) {
readers.add(workspaceRepository);
}
chainedWorkspaceReader.setReaders(readers);
} catch (LookupException e) {
return addExceptionToResult(result, e);
}
Expand Down