-
Notifications
You must be signed in to change notification settings - Fork 282
Closed
Milestone
Description
If we have a IntelliJ plugin gradle module that has 2 dependencies that we dont' control (so we don't control their .jar name), then the JARs in the plugin overwrite each other (in build/idea-sandbox/plugins/DemonstrateSameNameJarProblem/lib/core.jar) so when we run the plugin, only one "core" jar is available, and that unexpectedly causes a java.lang.NoClassDefFoundError exception.
Demonstrated in this small example: https://github.com/amandeepg/demonstrate-intellij-same-jar-problem. ./gradlew runIde then opening any Java file runs the line marker provider which causes the NoClassDefFoundError.
I've temporarily worked around this issue by:
prepareSandbox {
doLast {
def sandboxPluginDir = "${intellij.sandboxDirectory}/plugins/${getPluginName()}/lib"
delete fileTree(sandboxPluginDir)
copy {
from configurations.default.allArtifacts.files
from configurations.default
exclude 'tools.jar'
into sandboxPluginDir
duplicatesStrategy DuplicatesStrategy.FAIL
def count = 0
rename { count++ + it }
}
}
}
cesar1000