You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Carsten Karkola <ck...@mms-dresden.de> on 2006/05/30 16:08:26 UTC
Rar Plugin and dependencies
Hallo,
I have some subprojects with <packaging>rar</packaging> specified. There
are some dependencies specified, that need to be included in the ear. I'd
like to include these dependencies (like axis) only once in the ear and not in
every rar archive.
This way works fine with ejb archives. But with rar archives I get these
depend jars always included in the rar itself. <includeJar>false</includeJar>
doesn't help.
regards, carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Rar Plugin and dependencies - (MVN 2.0.4)
Posted by Carsten Karkola <ck...@mms-dresden.de>.
On 31 May 2006 at 17:38, Tim Kettler wrote:
The difference between bundling an ejb jar (dependency handling is done
automatically by maven) and a rar (I have to do some more work in the poms, as suggested
by you and Roland) in an ear lead to some obscurities on my side.
>> Wouldn't it be nice to have some option? Or wouldn't it be enough to say if
>> I specify manifest classpath entries, I can leave out the dependencies from
>> the rar archive?
>
> Can you elaborate on this a bit more? This isn't entirely clear to me.
>
>>
Therefore I thought about some option:
a)
<plugin>
<artifactId>maven-rar-plugin</artifactId>
<configuration>
<includeDependencies>false</includeDependencies>
</configuration>
</plugin>
or some implicit check
b) if I add a classpath configuration like
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>APP-INF/lib</classpathPrefix>
</manifest>
</archive>
</configuration>
then there is no need to bundle the dependend jars, because they will be bundled
later in the ear.
a) is clearer
But it's only an idea.
regards, carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Rar Plugin and dependencies - (MVN 2.0.4)
Posted by Tim Kettler <ti...@udo.edu>.
Carsten Karkola schrieb:
> So I have to specify the dependencies twice? First time in the
> parent/pom.xml and second time in rar/pom.xml (there using
> <scope>provided</scope>? I have to play with this, because some of the
> dependencies are internal jars from other subprojects.
In my example the dependency is actually referenced/specified three times:
I.
In the <dependencyManagement> section of the parent pom the dependency is defined
including the version to use.
II.
In the rar pom with scope 'provided'. The version is inherited from the parent.
III.
In the ear pom. The version is inherited from the parent.
You only need to touch the ear and rar pom's once to define the dependency and if the
version of the dependency changes you just need to modify the parent pom.
>
> As far as I can see, a workaround is to specifiy all dependencies for the rar-
> modules with <scope>provided</scope> and add them a second time to the
> ear pom.
>
> Wouldn't it be nice to have some option? Or wouldn't it be enough to say if
> I specify manifest classpath entries, I can leave out the dependencies from
> the rar archive?
Can you elaborate on this a bit more? This isn't entirely clear to me.
>
> Modules: I use bundelFileName there.
[...]
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Rar Plugin and dependencies - (MVN 2.0.4)
Posted by Carsten Karkola <ck...@mms-dresden.de>.
So I have to specify the dependencies twice? First time in the
parent/pom.xml and second time in rar/pom.xml (there using
<scope>provided</scope>? I have to play with this, because some of the
dependencies are internal jars from other subprojects.
As far as I can see, a workaround is to specifiy all dependencies for the rar-
modules with <scope>provided</scope> and add them a second time to the
ear pom.
Wouldn't it be nice to have some option? Or wouldn't it be enough to say if
I specify manifest classpath entries, I can leave out the dependencies from
the rar archive?
Modules: I use bundelFileName there.
On 31 May 2006 at 12:05, Tim Kettler wrote:
> Can't you do it like this:
>
> project
> |--pom.xml
> |
> `--parent
> | |--pom.xml
> |
> `--rar
> | |--pom.xml
> |
> `--ear
> | |--pom.xml
>
> parent/pom.xml:
> ---------------------------------------
> <project>
> <modelVersion>4.0.0</modelVersion>
>
> <groupId>test</groupId>
> <artifactId>test-parent</artifactId>
> <version>1.0-SNAPSHOT</version>
>
> <packaging>pom</packaging>
>
> <name>Parent</name>
>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>axis</groupId>
> <artifactId>axis</artifactId>
> <version>1.1</version>
> </dependency>
> </dependencies>
> </dependencyManagement>
>
> </project>
> ---------------------------------------
>
> ear/pom.xml:
> ---------------------------------------
> <project>
>
> <modelVersion>4.0.0</modelVersion>
>
> <parent>
> <groupId>test</groupId>
> <artifactId>test-parent</artifactId>
> <version>1.0-SNAPSHOT</version>
> <relativePath>../parent</relativePath>
> </parent>
>
> <groupId>de.foo</groupId>
> <artifactId>bar-ear</artifactId>
> <version>1.0</version>
> <name>Foo::Bar EAR</name>
> <packaging>ear</packaging>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-ear-plugin</artifactId>
> <configuration>
> <defaultJavaBundleDir>APP-INF/lib</defaultJavaBundleDir>
> </configuration>
> </plugin>
> </plugins>
> </build>
>
> <dependencies>
> <dependency>
> <groupId>de.foo</groupId>
> <artifactId>bar-connector</artifactId>
> <version>1.0</version>
> <type>rar</type>
> </dependency>
> <dependency>
> <groupId>axis</groupId>
> <artifactId>axis</artifactId>
> </dependency>
> </dependencies>
> </project>
> ---------------------------------------
>
> rar/pom.xml:
> ---------------------------------------
> <project
>
> <modelVersion>4.0.0</modelVersion>
>
> <parent>
> <groupId>test</groupId>
> <artifactId>test-parent</artifactId>
> <version>1.0-SNAPSHOT</version>
> <relativePath>../parent</relativePath>
> </parent>
>
> <groupId>de.foo</groupId>
> <artifactId>bar-connector</artifactId>
> <version>1.0</version>
>
> <name>Foo::Bar Rar</name>
> <packaging>rar</packaging>
>
> <build>
> </build>
> <dependencies>
> <dependency>
> <groupId>axis</groupId>
> <artifactId>axis</artifactId>
> <scope>provided</scope>
> </dependency>
> </dependencies>
> </project>
> ---------------------------------------
>
> Of course you don't need a distinct parent and aggregation pom (project/pom.xml). You can
> just merge the two and use the project level pom as the parent.
>
> BTW, you don't need to specify this:
>
> <modules>
> <rarModule>
> <groupId>test</groupId>
> <artifactId>test-ejb</artifactId>
> </rarModule>
> </modules>
>
> This section is used only if you need to configure the way the module is handled by the
> plugin like specifying the bundleFileName.
>
> -Tim
>
> Carsten Karkola schrieb:
> > No, I need the jar in the ear, my example - just to make clear what I try to
> > describe :-):
> >
> > $>mkdir -p rar/src/main/rar/META-INF
> > $>touch rar/src/main/rar/META-INF/ra.xml
> > $>touch rar/pom.xml
> > $>mkdir -p ear
> > $>touch ear/pom.xml
> >
> > ear/pom.xml:
> > <?xml version="1.0" encoding="iso-8859-1"?>
> > <project
> > xmlns="http://maven.apache.org/POM/4.0.0"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/maven-v4_0_0.xsd">
> >
> > <modelVersion>4.0.0</modelVersion>
> > <groupId>de.foo</groupId>
> > <artifactId>bar-ear</artifactId>
> > <version>1.0</version>
> > <name>Foo::Bar EAR</name>
> > <packaging>ear</packaging>
> > <build>
> > <plugins>
> > <plugin>
> > <artifactId>maven-ear-plugin</artifactId>
> > <configuration>
> > <defaultJavaBundleDir>APP-INF/lib</defaultJavaBundleDir>
> > <modules>
> > <rarModule>
> > <groupId>de.foo</groupId>
> > <artifactId>bar-connector</artifactId>
> > </rarModule>
> > </modules>
> > </configuration>
> > </plugin>
> > </plugins>
> > </build>
> > <dependencies>
> > <dependency>
> > <groupId>de.foo</groupId>
> > <artifactId>bar-connector</artifactId>
> > <version>1.0</version>
> > <type>rar</type>
> > </dependency>
> > </dependencies>
> > </project>
> >
> > rar/pom.xml:
> > <?xml version="1.0" encoding="iso-8859-1"?>
> > <project
> > xmlns="http://maven.apache.org/POM/4.0.0"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/maven-v4_0_0.xsd">
> >
> > <modelVersion>4.0.0</modelVersion>
> > <groupId>de.foo</groupId>
> > <artifactId>bar-connector</artifactId>
> > <version>1.0</version>
> > <name>Foo::Bar Rar</name>
> > <packaging>rar</packaging>
> > <build>
> > </build>
> > <dependencies>
> > <dependency>
> > <groupId>axis</groupId>
> > <artifactId>axis</artifactId>
> > <version>1.1</version>
> > <scope>provided</scope>
> > </dependency>
> > </dependencies>
> > </project>
> >
> > At least the build:
> > $>cd rar
> > $>mvn clean install
> > $>cd ../ear
> > $>mvn package
> >
> > The problem:
> > If I have <scope>provided</scope>, axis is missing in the rar and in the ear.
> > If I remove this line, Im ending up with axis in APP-INF/lib and inside the rar.
> >
> > How can I avoid this; I'd like to exclude the axis.jar only from the rar not from
> > the ear, background: I have a lot of rars with some more dependencies, that
> > are shared in all the rars, I'd like to deploy these dependencies only once in
> > APP-INF/lib not in every rar and in APP-INF/lib.
> >
> > regards, carsten
> >
> >
> > On 30 May 2006 at 18:19, Roland Asmann wrote:
> >
> >> Set the scope to provided ONLY on the rar-projects, NOT on the EAR.
> >>
> >>
> >>
> >> On Tuesday 30 May 2006 18:02, Carsten Karkola wrote:
> >>> If I use "provided" the dependencies will never be included, my problem is
> >>> 1. projects:
> >>> rar1: dependency to my-jar
> >>> rar2: dependency to my-jar
> >>> ejb1: dependency to my-jar
> >>> ear: dependency to rar1, rar2
> >>> 2. inside the ear:
> >>> ejb1.jar
> >>> rar1.rar
> >>> rar2.rar
> >>> lib/my-jar.jar
> >>> 3. This works fine for packaging=ejb - the my-jar.jar gets copied to the
> >>> lib dir during build of the ear. But the same jar gets also packaged in the
> >>> rar1 and in the rar2 archive. So I have it three times instead only having
> >>> the entries in MANFIFEST.MF/Class-Path and the jar only once in the lib
> >>> subdir.
> >>> The Manifest entries are not the problem, to get the jar not packaged in
> >>> the rars is my problem.
> >>>
> >>> regards, carsten
> >>>
> >>> On 30 May 2006 at 10:24, Wayne Fay wrote:
> >>>> I can't tell if you're running M2 or M1...
> >>>>
> >>>> But in M2, to exclude a dependency from being included in a package,
> >>>> we use the <scope>provided</scope> tag to override the default
> >>>> "compile" scope. Provided tells the packager that this
> >>>> dependency/artifact/library will be provided by the app server etc,
> >>>> and so it does not need to be included in the archive/package.
> >>>>
> >>>> Wayne
> >>>>
> >>>> On 5/30/06, Carsten Karkola <ck...@mms-dresden.de> wrote:
> >>>>> Hallo,
> >>>>>
> >>>>> I have some subprojects with <packaging>rar</packaging> specified.
> >>>>> There are some dependencies specified, that need to be included in the
> >>>>> ear. I'd like to include these dependencies (like axis) only once in
> >>>>> the ear and not in every rar archive.
> >>>>> This way works fine with ejb archives. But with rar archives I get
> >>>>> these depend jars always included in the rar itself.
> >>>>> <includeJar>false</includeJar> doesn't help.
> >>>>>
> >>>>> regards, carsten
> >>>>>
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> 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
> >>> ---------------------------------------------------------------------
> >>> 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
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Rar Plugin and dependencies - (MVN 2.0.4)
Posted by Roland Asmann <Ro...@cfc.at>.
I would set the dependencies inside the RAR's to 'provided', since you do not want them in there. This DOES mean
that you EXPLICITLY have to add the dependency inside the EAR, otherwise the JAR indeed will not appear.
I guess my last answer was a little short, but what I really meant to say was that you should not use the transitive
possibilities of Maven in your case. Like I said above, declare the dependencies everywhere in the scope you need
them at that point and you should be fine.
Roland
On Wednesday 31 May 2006 12:05, Tim Kettler wrote:
> Can't you do it like this:
>
> project
>
> |--pom.xml
>
> `--parent
>
> | |--pom.xml
>
> `--rar
>
> | |--pom.xml
>
> `--ear
>
> | |--pom.xml
>
> parent/pom.xml:
> ---------------------------------------
> <project>
> <modelVersion>4.0.0</modelVersion>
>
> <groupId>test</groupId>
> <artifactId>test-parent</artifactId>
> <version>1.0-SNAPSHOT</version>
>
> <packaging>pom</packaging>
>
> <name>Parent</name>
>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>axis</groupId>
> <artifactId>axis</artifactId>
> <version>1.1</version>
> </dependency>
> </dependencies>
> </dependencyManagement>
>
> </project>
> ---------------------------------------
>
> ear/pom.xml:
> ---------------------------------------
> <project>
>
> <modelVersion>4.0.0</modelVersion>
>
> <parent>
> <groupId>test</groupId>
> <artifactId>test-parent</artifactId>
> <version>1.0-SNAPSHOT</version>
> <relativePath>../parent</relativePath>
> </parent>
>
> <groupId>de.foo</groupId>
> <artifactId>bar-ear</artifactId>
> <version>1.0</version>
> <name>Foo::Bar EAR</name>
> <packaging>ear</packaging>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-ear-plugin</artifactId>
> <configuration>
> <defaultJavaBundleDir>APP-INF/lib</defaultJavaBundleDir>
> </configuration>
> </plugin>
> </plugins>
> </build>
>
> <dependencies>
> <dependency>
> <groupId>de.foo</groupId>
> <artifactId>bar-connector</artifactId>
> <version>1.0</version>
> <type>rar</type>
> </dependency>
> <dependency>
> <groupId>axis</groupId>
> <artifactId>axis</artifactId>
> </dependency>
> </dependencies>
> </project>
> ---------------------------------------
>
> rar/pom.xml:
> ---------------------------------------
> <project
>
> <modelVersion>4.0.0</modelVersion>
>
> <parent>
> <groupId>test</groupId>
> <artifactId>test-parent</artifactId>
> <version>1.0-SNAPSHOT</version>
> <relativePath>../parent</relativePath>
> </parent>
>
> <groupId>de.foo</groupId>
> <artifactId>bar-connector</artifactId>
> <version>1.0</version>
>
> <name>Foo::Bar Rar</name>
> <packaging>rar</packaging>
>
> <build>
> </build>
> <dependencies>
> <dependency>
> <groupId>axis</groupId>
> <artifactId>axis</artifactId>
> <scope>provided</scope>
> </dependency>
> </dependencies>
> </project>
> ---------------------------------------
>
> Of course you don't need a distinct parent and aggregation pom
> (project/pom.xml). You can just merge the two and use the project level pom
> as the parent.
>
> BTW, you don't need to specify this:
>
> <modules>
> <rarModule>
> <groupId>test</groupId>
> <artifactId>test-ejb</artifactId>
> </rarModule>
> </modules>
>
> This section is used only if you need to configure the way the module is
> handled by the plugin like specifying the bundleFileName.
>
> -Tim
>
> Carsten Karkola schrieb:
> > No, I need the jar in the ear, my example - just to make clear what I try
> > to describe :-):
> >
> > $>mkdir -p rar/src/main/rar/META-INF
> > $>touch rar/src/main/rar/META-INF/ra.xml
> > $>touch rar/pom.xml
> > $>mkdir -p ear
> > $>touch ear/pom.xml
> >
> > ear/pom.xml:
> > <?xml version="1.0" encoding="iso-8859-1"?>
> > <project
> > xmlns="http://maven.apache.org/POM/4.0.0"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/maven-v4_0_0.xsd">
> >
> > <modelVersion>4.0.0</modelVersion>
> > <groupId>de.foo</groupId>
> > <artifactId>bar-ear</artifactId>
> > <version>1.0</version>
> > <name>Foo::Bar EAR</name>
> > <packaging>ear</packaging>
> > <build>
> > <plugins>
> > <plugin>
> > <artifactId>maven-ear-plugin</artifactId>
> > <configuration>
> > <defaultJavaBundleDir>APP-INF/lib</defaultJavaBundleDir>
> > <modules>
> > <rarModule>
> > <groupId>de.foo</groupId>
> > <artifactId>bar-connector</artifactId>
> > </rarModule>
> > </modules>
> > </configuration>
> > </plugin>
> > </plugins>
> > </build>
> > <dependencies>
> > <dependency>
> > <groupId>de.foo</groupId>
> > <artifactId>bar-connector</artifactId>
> > <version>1.0</version>
> > <type>rar</type>
> > </dependency>
> > </dependencies>
> > </project>
> >
> > rar/pom.xml:
> > <?xml version="1.0" encoding="iso-8859-1"?>
> > <project
> > xmlns="http://maven.apache.org/POM/4.0.0"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/maven-v4_0_0.xsd">
> >
> > <modelVersion>4.0.0</modelVersion>
> > <groupId>de.foo</groupId>
> > <artifactId>bar-connector</artifactId>
> > <version>1.0</version>
> > <name>Foo::Bar Rar</name>
> > <packaging>rar</packaging>
> > <build>
> > </build>
> > <dependencies>
> > <dependency>
> > <groupId>axis</groupId>
> > <artifactId>axis</artifactId>
> > <version>1.1</version>
> > <scope>provided</scope>
> > </dependency>
> > </dependencies>
> > </project>
> >
> > At least the build:
> > $>cd rar
> > $>mvn clean install
> > $>cd ../ear
> > $>mvn package
> >
> > The problem:
> > If I have <scope>provided</scope>, axis is missing in the rar and in the
> > ear. If I remove this line, Im ending up with axis in APP-INF/lib and
> > inside the rar.
> >
> > How can I avoid this; I'd like to exclude the axis.jar only from the rar
> > not from the ear, background: I have a lot of rars with some more
> > dependencies, that are shared in all the rars, I'd like to deploy these
> > dependencies only once in APP-INF/lib not in every rar and in
> > APP-INF/lib.
> >
> > regards, carsten
> >
> > On 30 May 2006 at 18:19, Roland Asmann wrote:
> >> Set the scope to provided ONLY on the rar-projects, NOT on the EAR.
> >>
> >> On Tuesday 30 May 2006 18:02, Carsten Karkola wrote:
> >>> If I use "provided" the dependencies will never be included, my problem
> >>> is 1. projects:
> >>> rar1: dependency to my-jar
> >>> rar2: dependency to my-jar
> >>> ejb1: dependency to my-jar
> >>> ear: dependency to rar1, rar2
> >>> 2. inside the ear:
> >>> ejb1.jar
> >>> rar1.rar
> >>> rar2.rar
> >>> lib/my-jar.jar
> >>> 3. This works fine for packaging=ejb - the my-jar.jar gets copied to
> >>> the lib dir during build of the ear. But the same jar gets also
> >>> packaged in the rar1 and in the rar2 archive. So I have it three times
> >>> instead only having the entries in MANFIFEST.MF/Class-Path and the jar
> >>> only once in the lib subdir.
> >>> The Manifest entries are not the problem, to get the jar not packaged
> >>> in the rars is my problem.
> >>>
> >>> regards, carsten
> >>>
> >>> On 30 May 2006 at 10:24, Wayne Fay wrote:
> >>>> I can't tell if you're running M2 or M1...
> >>>>
> >>>> But in M2, to exclude a dependency from being included in a package,
> >>>> we use the <scope>provided</scope> tag to override the default
> >>>> "compile" scope. Provided tells the packager that this
> >>>> dependency/artifact/library will be provided by the app server etc,
> >>>> and so it does not need to be included in the archive/package.
> >>>>
> >>>> Wayne
> >>>>
> >>>> On 5/30/06, Carsten Karkola <ck...@mms-dresden.de> wrote:
> >>>>> Hallo,
> >>>>>
> >>>>> I have some subprojects with <packaging>rar</packaging> specified.
> >>>>> There are some dependencies specified, that need to be included in
> >>>>> the ear. I'd like to include these dependencies (like axis) only once
> >>>>> in the ear and not in every rar archive.
> >>>>> This way works fine with ejb archives. But with rar archives I get
> >>>>> these depend jars always included in the rar itself.
> >>>>> <includeJar>false</includeJar> doesn't help.
> >>>>>
> >>>>> regards, carsten
> >>>>>
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> 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
> >>>
> >>> ---------------------------------------------------------------------
> >>> 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
> >
> > ---------------------------------------------------------------------
> > 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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Rar Plugin and dependencies - (MVN 2.0.4)
Posted by Tim Kettler <ti...@udo.edu>.
Can't you do it like this:
project
|--pom.xml
|
`--parent
| |--pom.xml
|
`--rar
| |--pom.xml
|
`--ear
| |--pom.xml
parent/pom.xml:
---------------------------------------
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Parent</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
---------------------------------------
ear/pom.xml:
---------------------------------------
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>test</groupId>
<artifactId>test-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<groupId>de.foo</groupId>
<artifactId>bar-ear</artifactId>
<version>1.0</version>
<name>Foo::Bar EAR</name>
<packaging>ear</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<defaultJavaBundleDir>APP-INF/lib</defaultJavaBundleDir>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>de.foo</groupId>
<artifactId>bar-connector</artifactId>
<version>1.0</version>
<type>rar</type>
</dependency>
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
</dependency>
</dependencies>
</project>
---------------------------------------
rar/pom.xml:
---------------------------------------
<project
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>test</groupId>
<artifactId>test-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<groupId>de.foo</groupId>
<artifactId>bar-connector</artifactId>
<version>1.0</version>
<name>Foo::Bar Rar</name>
<packaging>rar</packaging>
<build>
</build>
<dependencies>
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
---------------------------------------
Of course you don't need a distinct parent and aggregation pom (project/pom.xml). You can
just merge the two and use the project level pom as the parent.
BTW, you don't need to specify this:
<modules>
<rarModule>
<groupId>test</groupId>
<artifactId>test-ejb</artifactId>
</rarModule>
</modules>
This section is used only if you need to configure the way the module is handled by the
plugin like specifying the bundleFileName.
-Tim
Carsten Karkola schrieb:
> No, I need the jar in the ear, my example - just to make clear what I try to
> describe :-):
>
> $>mkdir -p rar/src/main/rar/META-INF
> $>touch rar/src/main/rar/META-INF/ra.xml
> $>touch rar/pom.xml
> $>mkdir -p ear
> $>touch ear/pom.xml
>
> ear/pom.xml:
> <?xml version="1.0" encoding="iso-8859-1"?>
> <project
> xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>
> <modelVersion>4.0.0</modelVersion>
> <groupId>de.foo</groupId>
> <artifactId>bar-ear</artifactId>
> <version>1.0</version>
> <name>Foo::Bar EAR</name>
> <packaging>ear</packaging>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-ear-plugin</artifactId>
> <configuration>
> <defaultJavaBundleDir>APP-INF/lib</defaultJavaBundleDir>
> <modules>
> <rarModule>
> <groupId>de.foo</groupId>
> <artifactId>bar-connector</artifactId>
> </rarModule>
> </modules>
> </configuration>
> </plugin>
> </plugins>
> </build>
> <dependencies>
> <dependency>
> <groupId>de.foo</groupId>
> <artifactId>bar-connector</artifactId>
> <version>1.0</version>
> <type>rar</type>
> </dependency>
> </dependencies>
> </project>
>
> rar/pom.xml:
> <?xml version="1.0" encoding="iso-8859-1"?>
> <project
> xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>
> <modelVersion>4.0.0</modelVersion>
> <groupId>de.foo</groupId>
> <artifactId>bar-connector</artifactId>
> <version>1.0</version>
> <name>Foo::Bar Rar</name>
> <packaging>rar</packaging>
> <build>
> </build>
> <dependencies>
> <dependency>
> <groupId>axis</groupId>
> <artifactId>axis</artifactId>
> <version>1.1</version>
> <scope>provided</scope>
> </dependency>
> </dependencies>
> </project>
>
> At least the build:
> $>cd rar
> $>mvn clean install
> $>cd ../ear
> $>mvn package
>
> The problem:
> If I have <scope>provided</scope>, axis is missing in the rar and in the ear.
> If I remove this line, Im ending up with axis in APP-INF/lib and inside the rar.
>
> How can I avoid this; I'd like to exclude the axis.jar only from the rar not from
> the ear, background: I have a lot of rars with some more dependencies, that
> are shared in all the rars, I'd like to deploy these dependencies only once in
> APP-INF/lib not in every rar and in APP-INF/lib.
>
> regards, carsten
>
>
> On 30 May 2006 at 18:19, Roland Asmann wrote:
>
>> Set the scope to provided ONLY on the rar-projects, NOT on the EAR.
>>
>>
>>
>> On Tuesday 30 May 2006 18:02, Carsten Karkola wrote:
>>> If I use "provided" the dependencies will never be included, my problem is
>>> 1. projects:
>>> rar1: dependency to my-jar
>>> rar2: dependency to my-jar
>>> ejb1: dependency to my-jar
>>> ear: dependency to rar1, rar2
>>> 2. inside the ear:
>>> ejb1.jar
>>> rar1.rar
>>> rar2.rar
>>> lib/my-jar.jar
>>> 3. This works fine for packaging=ejb - the my-jar.jar gets copied to the
>>> lib dir during build of the ear. But the same jar gets also packaged in the
>>> rar1 and in the rar2 archive. So I have it three times instead only having
>>> the entries in MANFIFEST.MF/Class-Path and the jar only once in the lib
>>> subdir.
>>> The Manifest entries are not the problem, to get the jar not packaged in
>>> the rars is my problem.
>>>
>>> regards, carsten
>>>
>>> On 30 May 2006 at 10:24, Wayne Fay wrote:
>>>> I can't tell if you're running M2 or M1...
>>>>
>>>> But in M2, to exclude a dependency from being included in a package,
>>>> we use the <scope>provided</scope> tag to override the default
>>>> "compile" scope. Provided tells the packager that this
>>>> dependency/artifact/library will be provided by the app server etc,
>>>> and so it does not need to be included in the archive/package.
>>>>
>>>> Wayne
>>>>
>>>> On 5/30/06, Carsten Karkola <ck...@mms-dresden.de> wrote:
>>>>> Hallo,
>>>>>
>>>>> I have some subprojects with <packaging>rar</packaging> specified.
>>>>> There are some dependencies specified, that need to be included in the
>>>>> ear. I'd like to include these dependencies (like axis) only once in
>>>>> the ear and not in every rar archive.
>>>>> This way works fine with ejb archives. But with rar archives I get
>>>>> these depend jars always included in the rar itself.
>>>>> <includeJar>false</includeJar> doesn't help.
>>>>>
>>>>> regards, carsten
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>> ---------------------------------------------------------------------
>>> 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
>>
>
>
>
> ---------------------------------------------------------------------
> 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: Rar Plugin and dependencies - (MVN 2.0.4)
Posted by Carsten Karkola <ck...@mms-dresden.de>.
No, I need the jar in the ear, my example - just to make clear what I try to
describe :-):
$>mkdir -p rar/src/main/rar/META-INF
$>touch rar/src/main/rar/META-INF/ra.xml
$>touch rar/pom.xml
$>mkdir -p ear
$>touch ear/pom.xml
ear/pom.xml:
<?xml version="1.0" encoding="iso-8859-1"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.foo</groupId>
<artifactId>bar-ear</artifactId>
<version>1.0</version>
<name>Foo::Bar EAR</name>
<packaging>ear</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<defaultJavaBundleDir>APP-INF/lib</defaultJavaBundleDir>
<modules>
<rarModule>
<groupId>de.foo</groupId>
<artifactId>bar-connector</artifactId>
</rarModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>de.foo</groupId>
<artifactId>bar-connector</artifactId>
<version>1.0</version>
<type>rar</type>
</dependency>
</dependencies>
</project>
rar/pom.xml:
<?xml version="1.0" encoding="iso-8859-1"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.foo</groupId>
<artifactId>bar-connector</artifactId>
<version>1.0</version>
<name>Foo::Bar Rar</name>
<packaging>rar</packaging>
<build>
</build>
<dependencies>
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
At least the build:
$>cd rar
$>mvn clean install
$>cd ../ear
$>mvn package
The problem:
If I have <scope>provided</scope>, axis is missing in the rar and in the ear.
If I remove this line, Im ending up with axis in APP-INF/lib and inside the rar.
How can I avoid this; I'd like to exclude the axis.jar only from the rar not from
the ear, background: I have a lot of rars with some more dependencies, that
are shared in all the rars, I'd like to deploy these dependencies only once in
APP-INF/lib not in every rar and in APP-INF/lib.
regards, carsten
On 30 May 2006 at 18:19, Roland Asmann wrote:
> Set the scope to provided ONLY on the rar-projects, NOT on the EAR.
>
>
>
> On Tuesday 30 May 2006 18:02, Carsten Karkola wrote:
> > If I use "provided" the dependencies will never be included, my problem is
> > 1. projects:
> > rar1: dependency to my-jar
> > rar2: dependency to my-jar
> > ejb1: dependency to my-jar
> > ear: dependency to rar1, rar2
> > 2. inside the ear:
> > ejb1.jar
> > rar1.rar
> > rar2.rar
> > lib/my-jar.jar
> > 3. This works fine for packaging=ejb - the my-jar.jar gets copied to the
> > lib dir during build of the ear. But the same jar gets also packaged in the
> > rar1 and in the rar2 archive. So I have it three times instead only having
> > the entries in MANFIFEST.MF/Class-Path and the jar only once in the lib
> > subdir.
> > The Manifest entries are not the problem, to get the jar not packaged in
> > the rars is my problem.
> >
> > regards, carsten
> >
> > On 30 May 2006 at 10:24, Wayne Fay wrote:
> > > I can't tell if you're running M2 or M1...
> > >
> > > But in M2, to exclude a dependency from being included in a package,
> > > we use the <scope>provided</scope> tag to override the default
> > > "compile" scope. Provided tells the packager that this
> > > dependency/artifact/library will be provided by the app server etc,
> > > and so it does not need to be included in the archive/package.
> > >
> > > Wayne
> > >
> > > On 5/30/06, Carsten Karkola <ck...@mms-dresden.de> wrote:
> > > > Hallo,
> > > >
> > > > I have some subprojects with <packaging>rar</packaging> specified.
> > > > There are some dependencies specified, that need to be included in the
> > > > ear. I'd like to include these dependencies (like axis) only once in
> > > > the ear and not in every rar archive.
> > > > This way works fine with ejb archives. But with rar archives I get
> > > > these depend jars always included in the rar itself.
> > > > <includeJar>false</includeJar> doesn't help.
> > > >
> > > > regards, carsten
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > 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
> >
> > ---------------------------------------------------------------------
> > 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Rar Plugin and dependencies - (MVN 2.0.4)
Posted by Roland Asmann <Ro...@cfc.at>.
Set the scope to provided ONLY on the rar-projects, NOT on the EAR.
On Tuesday 30 May 2006 18:02, Carsten Karkola wrote:
> If I use "provided" the dependencies will never be included, my problem is
> 1. projects:
> rar1: dependency to my-jar
> rar2: dependency to my-jar
> ejb1: dependency to my-jar
> ear: dependency to rar1, rar2
> 2. inside the ear:
> ejb1.jar
> rar1.rar
> rar2.rar
> lib/my-jar.jar
> 3. This works fine for packaging=ejb - the my-jar.jar gets copied to the
> lib dir during build of the ear. But the same jar gets also packaged in the
> rar1 and in the rar2 archive. So I have it three times instead only having
> the entries in MANFIFEST.MF/Class-Path and the jar only once in the lib
> subdir.
> The Manifest entries are not the problem, to get the jar not packaged in
> the rars is my problem.
>
> regards, carsten
>
> On 30 May 2006 at 10:24, Wayne Fay wrote:
> > I can't tell if you're running M2 or M1...
> >
> > But in M2, to exclude a dependency from being included in a package,
> > we use the <scope>provided</scope> tag to override the default
> > "compile" scope. Provided tells the packager that this
> > dependency/artifact/library will be provided by the app server etc,
> > and so it does not need to be included in the archive/package.
> >
> > Wayne
> >
> > On 5/30/06, Carsten Karkola <ck...@mms-dresden.de> wrote:
> > > Hallo,
> > >
> > > I have some subprojects with <packaging>rar</packaging> specified.
> > > There are some dependencies specified, that need to be included in the
> > > ear. I'd like to include these dependencies (like axis) only once in
> > > the ear and not in every rar archive.
> > > This way works fine with ejb archives. But with rar archives I get
> > > these depend jars always included in the rar itself.
> > > <includeJar>false</includeJar> doesn't help.
> > >
> > > regards, carsten
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
>
> ---------------------------------------------------------------------
> 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: Rar Plugin and dependencies - (MVN 2.0.4)
Posted by Carsten Karkola <ck...@mms-dresden.de>.
If I use "provided" the dependencies will never be included, my problem is
1. projects:
rar1: dependency to my-jar
rar2: dependency to my-jar
ejb1: dependency to my-jar
ear: dependency to rar1, rar2
2. inside the ear:
ejb1.jar
rar1.rar
rar2.rar
lib/my-jar.jar
3. This works fine for packaging=ejb - the my-jar.jar gets copied to the lib dir during build of
the ear. But the same jar gets also packaged in the rar1 and in the rar2 archive. So I have it
three times instead only having the entries in MANFIFEST.MF/Class-Path and the jar only
once in the lib subdir.
The Manifest entries are not the problem, to get the jar not packaged in the rars is my
problem.
regards, carsten
On 30 May 2006 at 10:24, Wayne Fay wrote:
> I can't tell if you're running M2 or M1...
>
> But in M2, to exclude a dependency from being included in a package,
> we use the <scope>provided</scope> tag to override the default
> "compile" scope. Provided tells the packager that this
> dependency/artifact/library will be provided by the app server etc,
> and so it does not need to be included in the archive/package.
>
> Wayne
>
> On 5/30/06, Carsten Karkola <ck...@mms-dresden.de> wrote:
> > Hallo,
> >
> > I have some subprojects with <packaging>rar</packaging> specified. There
> > are some dependencies specified, that need to be included in the ear. I'd
> > like to include these dependencies (like axis) only once in the ear and not in
> > every rar archive.
> > This way works fine with ejb archives. But with rar archives I get these
> > depend jars always included in the rar itself. <includeJar>false</includeJar>
> > doesn't help.
> >
> > regards, carsten
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Rar Plugin and dependencies
Posted by Wayne Fay <wa...@gmail.com>.
I can't tell if you're running M2 or M1...
But in M2, to exclude a dependency from being included in a package,
we use the <scope>provided</scope> tag to override the default
"compile" scope. Provided tells the packager that this
dependency/artifact/library will be provided by the app server etc,
and so it does not need to be included in the archive/package.
Wayne
On 5/30/06, Carsten Karkola <ck...@mms-dresden.de> wrote:
> Hallo,
>
> I have some subprojects with <packaging>rar</packaging> specified. There
> are some dependencies specified, that need to be included in the ear. I'd
> like to include these dependencies (like axis) only once in the ear and not in
> every rar archive.
> This way works fine with ejb archives. But with rar archives I get these
> depend jars always included in the rar itself. <includeJar>false</includeJar>
> doesn't help.
>
> regards, carsten
>
>
> ---------------------------------------------------------------------
> 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