exclude plugin dependency

Answered

I'm working on a plugin for a DSL that can contain curies (prefix:localName) which are resolvable to full iris. The plugin is build upon an ontology (.ttl files) for which Apacha Jena is used. I would like to create a reference to a psi element in the ttl file itself. Since there is already a great plugin available in IntelliJ to create a Psi tree for ttl files (LNKD.tech) I would like to use that plugin.

What I did was:

- add the dependency

intellij {
version '2020.2'
plugins = [
'java',
'tech.lnkd.LNKD-tech-Editor:0.7-EARLY_ACCESS'
]
}

- use the PsiManager to obtain the ttl file as a Turtle File
- have the reference of my curie resolve to PsiElement in the file

This all works on paper (meaning, the imports can be resolved and the classes recognized in the IDE) and I can see that gradle adds a new library dependency: "Gradle: unzipped.com.jetbrains.plugins:tech.lnkd.LNKD-tech-Editor:unzipped.com.jetbrains.plugins:0.7-EARLY_ACCESS"

When I now run a test using LightJavaCodeInsightFixtureTestCase

- Class path contains multiple SLF4J bindings (can be ignored I think)
- An error on the Apache Jena library that both my plugin and LNKD.tech have as a dependency. This can be resolved by removing the jena dependencies from the LNKD.tech in the 'tech.lnkd.LNKD-tech-Editor-0.7-EARLY_ACCESS.xml' and then removing the jars. However, I could not find a way to configure this in the gradle.build. There is no 'exclude group' available as there is with the gradle dependencies.

Moreover, when I run it in the runIde task I get:

- java.lang.NoClassDefFoundError: tech/lnkd/editor/intellij/turtle/TurtleFile. I think this is caused by the ClassLoader of my plugin not actually loading the classes of the LNKD.tech but I cannot find any good instructions on how to overcome that.

 

2 comments
Comment actions Permalink

Never mind about the java.lang.NoClassDefFoundError, I forgot to put it in the plugin.xml as dependency, I though that was only for platform modules.

So the only remaining question would be: can I exclude certain groups when I use another plugin as dependency

0

Please sign in to leave a comment.