Issue
I was given a project structure implementing a board game with GUI that contains two Projects/modules in one IntelliJ Project. Both use Maven to manage dependencies.
Module A (Game-Logic)
Module B (Game-gui)
Module A uses Classes in Module B, and A's pom.xml contains the following dependency:
<dependency>
<groupId>io.bibucket.plt</groupId>
<artifactId>Game-gui</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
But Game-gui is just Module B that is contained locally in the Project itself and the infos (groupId,artifactId etc.) are specified in Module B's pom.xml, so that's what it's pointing to!
Why would we specify a maven dependency to it? I thought the point of maven is to manage dependencies to remote artifacts. Is maven also used to specify local dependencies?
During Maven build I see this error:
The POM for io.bibucket.plt:Game-gui:jar:0.0.1-SNAPSHOT is missing, no dependency information available
What does this error mean? Why is this project using Maven to point to a local Module as an artifact?
Solution
You need to use install, package and deploy commands of maven for module B to make it accessible for module A. These commands make a .jar file for module B which can be imported by module A. Models and classes in different artifacts can not be visible for each other unless you define their dependencies in pom file of the other module.
Answered By - Azadi Yazdani
Answer Checked By - Candace Johnson (JavaFixing Volunteer)