If you configure maven-war-plugin with the following attribute:
<attachClasses>true</attachClasses>
You will receive an additional artifact with the following coordinates:
<dependency> <groupId>myGroup</groupId> <artifactId>myArtifact</artifactId> <version>myVersion</myVersion> <classifier>classes</classifier> </dependency>
which contains all the classes within your military project, which can be used as a dependency, which is a jar file that will help solve your problem.
source share