I am trying to include my test classes in a generated JAR in a Maven Project.
I have created the Maven project and created the test classes with JUnit.
When I am trying to build the JAR, these test classes are not included in the generated JAR.
I am trying to include my test classes in a generated JAR in a Maven Project.
I have created the Maven project and created the test classes with JUnit.
When I am trying to build the JAR, these test classes are not included in the generated JAR.
I have resolved issue be adding things. We will get two jars. One with classes and other with test classes.
assembly.xml
POM.xml
You can produce a jar which will include your test classes and resources. Please refer maven official site - https://maven.apache.org/plugins/maven-jar-plugin/examples/create-test-jar.html