noties / Prism4j

Simplified Java clone of prism-js
Apache License 2.0
50 stars 14 forks source link

Transitive dependencies to org.jetbrains.annotations are causing conflicts #9

Open stefan-niedermann opened 3 years ago

stefan-niedermann commented 3 years ago

See for example Nextcloud: https://github.com/nextcloud/android/blob/master/build.gradle#L49-L54

Complete error message when building without excluding the transitive dependency:

Duplicate class org.intellij.lang.annotations.Flow found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.Identifier found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$AdjustableOrientation found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$CalendarMonth found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$CursorType found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$FontStyle found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$HorizontalAlignment found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$InputEventMask found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$ListSelectionMode found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$PatternFlags found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TabLayoutPolicy found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TabPlacement found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderJustification found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderTitlePosition found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TreeSelectionMode found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.Language found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.MagicConstant found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.Pattern found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.PrintFormat found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.PrintFormatPattern found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.RegExp found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.Subst found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.Contract found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.Nls found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.NonNls found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.NotNull found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.Nullable found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.PropertyKey found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.TestOnly found in modules jetified-annotations-13.0 (org.jetbrains:annotations:13.0) and jetified-annotations-java5-17.0 (org.jetbrains:annotations-java5:17.0.0)

(Side note: io.noties.markwon:syntax-highlight:4.6.0 has the same issue)

rshah commented 3 years ago

I have this problem too. I found this: https://github.com/noties/Markwon/issues/148#issuecomment-507762635 Maybe it will help @stefan-niedermann

stefan-niedermann commented 3 years ago

Yes, i am using this workaround myself, but it's only against the symptoms, but no real solution.