lets say i have 3 packages and a jar needs to be created for every package containing only the contents in the current package. My attempt is:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>first-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>first-jar</classifier>
<excludes>
<exclude>/maven.task.3/src/main/java/third/ThirdMain.java
</exclude>
<exclude>/maven.task.3/src/main/java/second/SecondMain.java
</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>second-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>second-jar</classifier>
<excludes>
<exclude>/maven.task.3/src/main/java/first/FirstMain.java
</exclude>
<exclude>/maven.task.3/src/main/java/third/ThirdMain.java
</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
And this does indeed create different jars, however the content inside is the same, meaning the exclude clauses don't work. I tried excluding only the class(relative/absolute path) and only the package. Don't ask why i do this its for homework, it does not make a lot of sense! This is the way i attempt of doing it, if there is any other more efficient way please feel free to share it with me!
EDIT: Modular structure must not be used, it must be one single project.
Thanks in advance