дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-26 11:18:20 +02:00
fix(java): keep Maven system-scope jars on the run classpath (#6070)
The IDE build's Maven extension left system-scope dependencies out of the runtime classpath it records, and launches built by the IDE replay that classpath, so a Spring Boot app whose POM points at lib/*.jar with <systemPath> failed with NoClassDefFoundError. A systemPath names an explicit file the JVM must load (IDEA imports the scope as Compile); provided stays excluded. The rebuilt jar changes java_build_version, so existing build models are prepared again. Fixes #6023
Цей коміт міститься в:
1 джерело
e998e2ca8e
коміт
fe7fa7d505
2 files changed
+6
-2
No files matched your search
@@ -303,7 +303,11 @@ public final class BuildModel extends AbstractMavenLifecycleParticipant {
|
||||
json.append("}}");
|
||||
}
|
||||
|
||||
/** The classpaths of the resolved graph, in Maven's order: compile, runtime, test scopes. */
|
||||
/**
|
||||
* The classpaths of the resolved graph, in Maven's order: compile, runtime, test scopes. A
|
||||
* {@code system} jar is on the runtime classpath too: it is an explicit file the launched JVM
|
||||
* must load (IDEA imports the scope as Compile), while {@code provided} is the container's.
|
||||
*/
|
||||
private static void classpaths(DependencyNode root, List<String> compile, List<String> runtime, List<String> test) {
|
||||
List<DependencyNode> nodes = new ArrayList<>();
|
||||
collect(root, nodes, new HashSet<>());
|
||||
@@ -314,7 +318,7 @@ public final class BuildModel extends AbstractMavenLifecycleParticipant {
|
||||
String scope = node.getDependency().getScope();
|
||||
String path = file.getAbsolutePath();
|
||||
if (!"test".equals(scope) && !"runtime".equals(scope)) compile.add(path);
|
||||
if (!"test".equals(scope) && !"provided".equals(scope) && !"system".equals(scope)) runtime.add(path);
|
||||
if (!"test".equals(scope) && !"provided".equals(scope)) runtime.add(path);
|
||||
test.add(path);
|
||||
}
|
||||
}
|
||||
|
||||
Бінарний файл не відображається.
Reference in new issue
Заблокувати користувача