[Maven] Filter duplicated source roots to avoid multiple module declarations exception
After fixing of KT-13995 (99de93bb) there is a case when several maven plugins register the same source roots twice, which leads to the Kotlin compiler exception "Too many source module declarations found". kotlin-maven-plugin should take care of what it passes to the Kotlin compiler to avoid it
#KT-58048 Fixed
Merge-request: KT-MR-9663
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
c3bfe72394
commit
07d20c6ee1
+2
-1
@@ -41,6 +41,7 @@ import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.jetbrains.kotlin.maven.Util.joinArrays;
|
||||
|
||||
@@ -82,7 +83,7 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
||||
List<String> list = new ArrayList<>();
|
||||
if (sourceDirs != null && !sourceDirs.isEmpty()) list.addAll(sourceDirs);
|
||||
list.addAll(project.getCompileSourceRoots());
|
||||
return list;
|
||||
return list.stream().distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user