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.

 

0
3 comments

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

@Yann Cebron hello,does the problem has solution? how to resolve this problem?

INFO - STDERR - SLF4J: Found binding in [jar:file:/C:/Program%20Files/JetBrains/IntelliJ%20IDEA%20Community%20Edition%202022.1.3/plugins/maven/lib/maven36-server.jar!/org/slf4j/impl/StaticLoggerBinder.class]
2023-02-10 11:11:55,797 [ 79151] INFO - STDERR - SLF4J: Found binding in [jar:file:/C:/Program%20Files/JetBrains/IntelliJ%20IDEA%20Community%20Edition%202022.1.3/lib/3rd-party-rt.jar!/org/slf4j/impl/StaticLoggerBinder.class]
2023-02-10 11:11:55,798 [ 79152] INFO - STDERR - SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
2023-02-10 11:11:55,799 [ 79153] INFO - STDERR - SLF4J: Actual binding is of type [org.jetbrains.idea.maven.server.Maven3WrapperSl4LoggerFactory]

0

Please sign in to leave a comment.