You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Aaron Shettleroe <aa...@touchnet.com> on 2009/03/16 14:01:04 UTC
Building three artifacts from the same pom
I'm trying to build 3 artifacts from the same POM. The project is
building an EJB 3.0 jar file and I have 3 different persistence.xml
files, one per database vendor. I'd like all 3 jars to be built when I
do a "mvn package."
I've looked into using the maven-jar-plugin to accomplish this, but I
can't seem to get the persistence.xml file I need into the JAR. I tried
using the include tag but to no avail. It doesn't "see" files outside
of src/main/java and src/main/resources.
I have the following structure:
src/main/persistence/mysql/persistence.xml
src/main/persistence/oracle/persistence.xml
src/main/persistence/sqlserver/persistence.xml
How do I get the right persistence.xml into the right JAR? Again I want
all three JARs produced at package phase.
Thanks,
Aaron
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Building three artifacts from the same pom
Posted by Stephen Connolly <st...@gmail.com>.
You'd probably be better off with 4 modules...
module #1 is all the contents of the jar without persistence.xml
module#2-#4 just have the persistence.xml, they use
dependency:unpack-dependencies to unpack module#1 into target/classes
2009/3/16 Aaron Shettleroe <aa...@touchnet.com>
> I'm trying to build 3 artifacts from the same POM. The project is
> building an EJB 3.0 jar file and I have 3 different persistence.xml
> files, one per database vendor. I'd like all 3 jars to be built when I
> do a "mvn package."
>
> I've looked into using the maven-jar-plugin to accomplish this, but I
> can't seem to get the persistence.xml file I need into the JAR. I tried
> using the include tag but to no avail. It doesn't "see" files outside
> of src/main/java and src/main/resources.
>
> I have the following structure:
> src/main/persistence/mysql/persistence.xml
> src/main/persistence/oracle/persistence.xml
> src/main/persistence/sqlserver/persistence.xml
>
> How do I get the right persistence.xml into the right JAR? Again I want
> all three JARs produced at package phase.
>
> Thanks,
> Aaron
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>