Only so that you don't forget, the general Maven rule is "one project,
one artifact". You could use classifiers to create more than one
artifact for a project, but I don't really see the benefit. Have
several projects is not bad (I think), it makes your code base
structured. Changes to one customer's code will then only affect that
customer's project and making it possible to make a new release for
just that customer. If you mix all customers' code in one project you
will get a new version for all customers (while only one of them has
really changed). Not very clean I think.
The assemblies goes in separate projects.

Just my two cents,
/Anders

On Wed, Jun 17, 2009 at 19:41, David Weintraub<[email protected]> wrote:
> Thanks. It took me a while to figure this out. At first, I tried to create a
> separate <plugin> for each client. However, only the first one executed.
> Then, I tried to add a new <execution> definition to the maven-jar-plugin
> artifact, but kept getting errors. I finally realized that each <execution>
> needed its own "id".
>
> This created the separate jars that were needed. Now, I have to create an
> assembly for each of these clients.
>
> On Wed, Jun 17, 2009 at 5:45 AM, losa <[email protected]> wrote:
>
>>
>> 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]
>>
>>
>
>
> --
> David Weintraub
> [email protected]
>

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

Reply via email to