using another project's class

Scenario:

needs the Project B's class files in Project A.

https://stackoverflow.com/questions/33856571/how-can-i-use-classes-from-other-project-with-maven-classnotfoundexception-and

  1. could use B's jar file as external library in A.

  2. try to remove<packaging>war</packaging>from B? Maven's default packaging isjar, and this is what you need for B.

    Plus, add B to thedependenciesof A.

    • Build B project. use

      mvn clean install

      , that would install B's JAR+POM in your local repository (.m2).

    • Verify it is there... Then Maven will be able to find it, so you will not get the error "Could not find artifact de.qufis:CentwertApp"

    • Build A.

    Usually, dependencies are of type JAR. If B must be a WAR.

https://stackoverflow.com/questions/1769586/maven-war-dependency(if need war file)

Last updated

Was this helpful?