noties / Markwon

Android markdown library (no WebView)
https://noties.io/Markwon/
Apache License 2.0
2.77k stars 313 forks source link

Markwon 4 appears to repackage jetbrains annotations #148

Closed ZacSweers closed 5 years ago

ZacSweers commented 5 years ago

Updating to 4.x yields the following trace

Repro branch here: https://github.com/ZacSweers/CatchUp/tree/z/markwon4. Just run ./gradlew :app:assembleDebug

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: Duplicate class org.intellij.lang.annotations.Flow found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.Identifier found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$AdjustableOrientation found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$CalendarMonth found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$CursorType found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$FontStyle found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$HorizontalAlignment found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$HorizontalScrollBarPolicy found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$InputEventMask found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$ListSelectionMode found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$PatternFlags found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TabLayoutPolicy found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TabPlacement found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderJustification found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderTitlePosition found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TreeSelectionMode found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$VerticalScrollBarPolicy found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.Language found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.MagicConstant found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.Pattern found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.PrintFormat found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.PrintFormatPattern found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.RegExp found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.intellij.lang.annotations.Subst found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.jetbrains.annotations.Async found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.jetbrains.annotations.Async$Execute found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.jetbrains.annotations.Async$Schedule found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.jetbrains.annotations.Contract found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.jetbrains.annotations.Nls found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.jetbrains.annotations.Nls$Capitalization found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.jetbrains.annotations.NonNls found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.jetbrains.annotations.NotNull found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.jetbrains.annotations.Nullable found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.jetbrains.annotations.PropertyKey found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
  Duplicate class org.jetbrains.annotations.TestOnly found in modules annotations-16.0.1.jar (org.jetbrains:annotations:16.0.1) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)

  Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
noties commented 5 years ago

Hello @ZacSweers !

syntax-highlight module uses prism4j library that uses annotations-java5 library... I'm trying to add an explicit prism4j dependency and exclude annotations, but... with no effect

implementation('io.noties:prism4j:2.0.0') {
    exclude group: 'org.jetbrains', module: 'annotations-java5'
}

I need to investigate this further

ZacSweers commented 5 years ago

Ah good to know, thanks

On Tue, Jul 2, 2019, 1:00 PM Dimitry notifications@github.com wrote:

Hello @ZacSweers https://github.com/ZacSweers !

syntax-highlight module uses prism4j library that uses annotations-java5 library... I'm trying to add an explicit prism4j dependency and exclude annotations, but... with no effect

implementation('io.noties:prism4j:2.0.0') { exclude group: 'org.jetbrains', module: 'annotations-java5' }

I need to investigate this further

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/noties/Markwon/issues/148?email_source=notifications&email_token=AAKMJPWCCEOBCIXUD7TQ7WTP5OCT3A5CNFSM4H45YFW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZB5PSY#issuecomment-507762635, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKMJPWZQJ4EC36EZQDEOITP5OCT3ANCNFSM4H45YFWQ .

noties commented 5 years ago

Okay, this one works (it will exclude annotations-java5 from all dependencies, which is what you would want anyway):

configurations.all {
    exclude group: 'org.jetbrains', module: 'annotations-java5'
}