0

IntelliJ newcomer here. I'm having some issues getting my project dependencies working:

So I have a project called ClearDialogue. It's an IDE for making branching dialogue for video games. It relies on my other project, Clear (ClearVG and ClearWindows) for creating its window and also rendering the UI. ClearDialogue also depends on LWJGL3 and a few other dependencies. The projects use Maven to manage its dependencies.

Clear is a project on my machine that I've set up in IntelliJ and successfully ran its demos. ClearDialogue however is where my trouble started; it relies on Clear to work, which is another project (not a JAR thats uploaded for it to fetch). So what I'm saying is: I need to be able to use another IntelliJ project as a library in ClearDialogue.

According to other similar questions, I can achieve this by referencing the other project in the pom file of the project that's referencing it. So I did that and it actually did appear in the "External Libraries" dropdown:

enter image description here .

There are a few problems:

1) Despite Clear appearing in the External Libraries section, it's still not being recognized by the IDE as a library and when I try to build the project, errors like this are printed to the console:

enter image description here.

2) It seems that Clear is the only library being downloaded despite LWJGL3 and other libraries being designated as dependencies in the pom file. They aren't being downloaded and aren't appearing in the External Libraries tab. That said, Clear itself uses some of the same libraries (LWJGL3) so is it that it's just making sure they aren't duplicated? Either way, the code itself is drawing red lines because it can't find the LWJGL3 libraries.

Does anyone know ways to fix these issues? Thanks in advance.

Anonymous
  • 696
  • 8
  • 21
  • I was able to solve the second part of my question here (https://stackoverflow.com/a/33777371/1975276), however the first part of my question is still up for grabs. – Anonymous May 20 '19 at 03:15
  • *Please* copy/paste *text*, instead of screen shots. I was about to ask you to post your pom.xml dependencies, but you just created a new post answering your own question. Cool :) In the future, please try to copy/paste text, in preference to posting screen shots. – paulsm4 May 20 '19 at 03:50
  • I didn't think copy/pasting was necessary considering that it'd lose all of the formatting if I did that, making it harder to read ultimately. But I will keep this in mind next time. – Anonymous May 20 '19 at 04:20

1 Answers1

0

I managed to fix both of these problems myself.

To solve the first problem of using another project as a dependency, I was able to use the maven attributes of the projects to do so. I referenced Clear in ClearDialogue's pom file like this:

enter image description here.

Then I opened the Maven view (View -> Tool Windows -> Maven) and added the pom files from Clear's own modules to the list along with the needed modules within the project itself:

enter image description here.

After this I pressed the "Reimport all Maven Projects" button (the button in the picture above that looks like a refresh button) and rebuilt the project (Build -> Rebuild Project). This successfully downloaded all of my needed libraries and successfully added the local libraries from my own projects only available on the machine as well. With that I was able to successfully run to program as well.

As for the second half of my problem, I was able to find this answer from another question here on Stack Overflow, which coincidentally was how I was able to figure out how to add local dependencies as well.

Anonymous
  • 696
  • 8
  • 21