mirror of https://github.com/apache/maven.git
Fix packaging not found (#1507)
* Fix packaging not found * Always keep Projects in cache
This commit is contained in:
parent
71bb3bdf95
commit
accbbcf5a0
|
@ -42,7 +42,13 @@ public class DefaultProject implements Project {
|
|||
public DefaultProject(InternalMavenSession session, MavenProject project) {
|
||||
this.session = session;
|
||||
this.project = project;
|
||||
this.packaging = session.requirePackaging(project.getPackaging());
|
||||
ClassLoader ttcl = Thread.currentThread().getContextClassLoader();
|
||||
try {
|
||||
Thread.currentThread().setContextClassLoader(project.getClassRealm());
|
||||
this.packaging = session.requirePackaging(project.getPackaging());
|
||||
} finally {
|
||||
Thread.currentThread().setContextClassLoader(ttcl);
|
||||
}
|
||||
}
|
||||
|
||||
public InternalMavenSession getSession() {
|
||||
|
|
|
@ -21,6 +21,7 @@ package org.apache.maven.internal.impl;
|
|||
import java.nio.file.Path;
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.apache.maven.RepositoryUtils;
|
||||
import org.apache.maven.api.*;
|
||||
|
@ -49,7 +50,7 @@ public class DefaultSession extends AbstractSession implements InternalMavenSess
|
|||
private final MavenSession mavenSession;
|
||||
private final MavenRepositorySystem mavenRepositorySystem;
|
||||
private final RuntimeInformation runtimeInformation;
|
||||
private final Map<String, Project> allProjects = Collections.synchronizedMap(new WeakHashMap<>());
|
||||
private final Map<String, Project> allProjects = new ConcurrentHashMap<>();
|
||||
|
||||
@SuppressWarnings("checkstyle:ParameterNumber")
|
||||
public DefaultSession(
|
||||
|
|
Loading…
Reference in New Issue