You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by suchitra <su...@ge.com> on 2007/05/10 13:53:35 UTC
How to create 3 different jars from a single mvn package command?
How do I create three separate jars (of classes) in the target directory,
from a single source file?
For example,
A
|-------src
| |-------main
| |--------java
| |--------my_java files
|------target
|------classes
|---------my_class files
X-1.0-SNAPSHOT.jar |
Y-1.0-SNAPSHOT.jar |----------------------instead of a single
A.jar file (using mvn package)
Z-1.0-SNAPSHOT.jar |
Thanks,
Suchitra
--
View this message in context: http://www.nabble.com/How-to-create-3-different-jars-from-a-single-mvn-package-command--tf3721182s177.html#a10411858
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How to create 3 different jars from a single mvn package
command?
Posted by Alexander Zynevich <zy...@mail.ru>.
Looks like it is out of ideology of maven.
I think to solve it you should have 3 projects.
However if you create your own plugin everything is possible :)
suchitra wrote:
>
> How do I create three separate jars (of classes) in the target directory,
> from a single source file?
>
> For example,
>
> A
> |-------src
> | |-------main
> | |--------java
> | |--------my_java files
> |------target
> |------classes
> |---------my_class files
> X-1.0-SNAPSHOT.jar |
> Y-1.0-SNAPSHOT.jar |----------------------instead of a single
> A.jar file (using mvn package)
> Z-1.0-SNAPSHOT.jar |
>
>
> Thanks,
> Suchitra
>
--
View this message in context: http://www.nabble.com/How-to-create-3-different-jars-from-a-single-mvn-package-command--tf3721182s177.html#a10412873
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How to create 3 different jars from a single mvn package
command?
Posted by suchitra <su...@ge.com>.
Thanks a lot. The assembly plugin really helped me in creating the different
jars.
Suchitra
--
View this message in context: http://www.nabble.com/How-to-create-3-different-jars-from-a-single-mvn-package-command--tf3721182s177.html#a10635953
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: How to create 3 different jars from a single mvn package command?
Posted by Chris Hilton <ch...@alterpoint.com>.
I might have to try the assembly plugin method. Personally, I use a
<jar> task in an antrun plugin execution to create the jars, then use
the buildhelper plugin to attach them to the project.
Chris
-----Original Message-----
From: Stefano Bagnara [mailto:apache@bago.org]
Sent: Thursday, 10 May, 2007 08:31
To: Maven Users List
Subject: Re: How to create 3 different jars from a single mvn package
command?
I use the assembly plugin.
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-1</version>
<configuration>
<descriptorSourceDirectory>${basedir}/src/assemble/</descriptorSourceDir
ectory>
</configuration>
</plugin>
and then in the src/assemble I create xml files like this:
<assembly>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>./what/to/include/folder/</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory></outputDirectory>
</fileSet>
...more file sets...
</fileSets>
</assembly>
Stefano
suchitra ha scritto:
> How do I create three separate jars (of classes) in the target
> directory, from a single source file?
>
> For example,
>
> A
> |-------src
> | |-------main
> | |--------java
> | |--------my_java files
> |------target
> |------classes
> |---------my_class files
> X-1.0-SNAPSHOT.jar |
> Y-1.0-SNAPSHOT.jar
|----------------------instead of a single
> A.jar file (using mvn package)
> Z-1.0-SNAPSHOT.jar |
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How to create 3 different jars from a single mvn package command?
Posted by Stefano Bagnara <ap...@bago.org>.
I use the assembly plugin.
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-1</version>
<configuration>
<descriptorSourceDirectory>${basedir}/src/assemble/</descriptorSourceDirectory>
</configuration>
</plugin>
and then in the src/assemble I create xml files like this:
<assembly>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>./what/to/include/folder/</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory></outputDirectory>
</fileSet>
...more file sets...
</fileSets>
</assembly>
Stefano
suchitra ha scritto:
> How do I create three separate jars (of classes) in the target directory,
> from a single source file?
>
> For example,
>
> A
> |-------src
> | |-------main
> | |--------java
> | |--------my_java files
> |------target
> |------classes
> |---------my_class files
> X-1.0-SNAPSHOT.jar |
> Y-1.0-SNAPSHOT.jar |----------------------instead of a single
> A.jar file (using mvn package)
> Z-1.0-SNAPSHOT.jar |
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org