diff --git a/designer-base/src/main/java/com/fr/env/detect/impl/converter/ClassConflictConvertor.java b/designer-base/src/main/java/com/fr/env/detect/impl/converter/ClassConflictConvertor.java index 57c97326e5..6cd92e4039 100644 --- a/designer-base/src/main/java/com/fr/env/detect/impl/converter/ClassConflictConvertor.java +++ b/designer-base/src/main/java/com/fr/env/detect/impl/converter/ClassConflictConvertor.java @@ -48,6 +48,7 @@ public class ClassConflictConvertor implements ThrowableConverter { private static final String JAR_URL_SUFFIX = ".jar!"; private static final String JAR_FILE_SUFFIX = ".jar"; private static final String FILE_URL_PREFIX = "file:"; + private static final String PLUGINS_DIR_NAME = "plugins"; private final Map, ClassNameConverter> throwableMap = new HashMap<>(); @@ -108,6 +109,9 @@ public class ClassConflictConvertor implements ThrowableConverter { for (URL url : urlList) { String file = url.getFile(); String decodeFileStr = URLDecoder.decode(file, EncodeConstants.ENCODING_UTF_8); + if (decodeFileStr.contains(PLUGINS_DIR_NAME)) { + continue; + } if (decodeFileStr.contains(JAR_URL_SUFFIX)) { String jarPath = decodeFileStr.substring(FILE_URL_PREFIX.length(), decodeFileStr.indexOf(JAR_URL_SUFFIX) + JAR_FILE_SUFFIX.length()); String jar = new File(jarPath).getName(); diff --git a/designer-base/src/test/java/com/fr/env/detect/impl/converter/ClassConflictConvertorTest.java b/designer-base/src/test/java/com/fr/env/detect/impl/converter/ClassConflictConvertorTest.java index cdc789b015..20f370b7b1 100644 --- a/designer-base/src/test/java/com/fr/env/detect/impl/converter/ClassConflictConvertorTest.java +++ b/designer-base/src/test/java/com/fr/env/detect/impl/converter/ClassConflictConvertorTest.java @@ -1,5 +1,6 @@ package com.fr.env.detect.impl.converter; +import org.junit.Assert; import org.junit.Test; public class ClassConflictConvertorTest { @@ -10,14 +11,7 @@ public class ClassConflictConvertorTest { ClassNotFoundException ex1 = new ClassNotFoundException("Class 111.222.333 not found"); Iterable names = ClassConflictConvertor.Converter.CLASS.converter(ex1); - System.out.println(); - } - - @Test - public void testConverter() { - - ClassNotFoundException ex1 = new ClassNotFoundException("com.zaxxer.hikari.HikariConfig"); - ClassConflictConvertor convertor = new ClassConflictConvertor(); - convertor.convert(ex1); + String next = names.iterator().next(); + Assert.assertEquals("111.222.333", next); } } \ No newline at end of file