You can use the maven-jar-plugin for generating more than one jar file
filtering the classes you want to include.

Example:
<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
                <execution>
                        <phase>package</phase>
                        <goals>
                                <goal>jar</goal>
                        </goals>
                        <configuration>
                                <classifier>my-client</classifier>
                                <includes>
                                        <include>**/pkg1/MyClass.class</include>
                                </includes>
                                <excludes>
                                        <exclude>**/pkg2/MyClass.class</exclude>
                                </excludes>                                     
                
                        </configuration>
                </execution>
        </executions>
</plugin>       

The generated jar will be copied o your repository. Then, when you need to
use the jar from another project, you can include the dependency like this

                <dependency>
                        <groupId>${project.groupId}</groupId>
                        <artifactId>theJarName</artifactId>
                        <version>theJarVersion</version>
                        <classifier>my-client</classifier>
                </dependency>   


More information at:
http://maven.apache.org/plugins/maven-jar-plugin/index.html
http://maven.apache.org/plugins/maven-jar-plugin/index.html 
-- 
View this message in context: 
http://www.nabble.com/How-to-create-many-jars-in-package-phase--tp23646150p24070227.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to