Skip to content
Advertisement

Maven dependency showing up in External Libraries, but errors when used in project

So I’m trying to use a project I made in a different project. I uploaded it to Jitpack and am now using it in my pom.xml like this:

<dependency>
    <groupId>com.github.MrSketchpad</groupId>
    <artifactId>Concept</artifactId>
    <version>3fa8f87b92</version>
</dependency>

This appears to work fine, as the dependency shows up in my External Libraries: Dependency in external libraries

As well as in the IntelliJ IDEA autocomplete (Concept is a class from the dependency): Class in autocomplete

But when I try to press tab on the autocomplete or use the dependency at all, this happens: Import not working

Additionally, when I try to run the dependency, it says it’s not found, even though it’s clearly there. Jar not found

When I try and initialize the class and print it like this, the class is recognized, but only on run, which I can tell because it tells me it can’t load the class’s parent: JavaPlugin not found

Does anyone know why this is happening? Am I using this wrong? Also sorry for the images in links, StackOverflow wouldn’t let me embed them.

Advertisement

Answer

It turns out the solution was actually very different from what I had thought. The dependency worked in Java files, but not in Kotlin ones, because I’d packed the Kotlin runtime in the dependency. For some reason this broke IntelliJ, but worked fine when I ran it.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement