You may need to declare more stuff, see:
http://maven.apache.org/plugins/maven-ear-plugin/howto.html
Specifically, I think you need to declare your common.jar as a
javaModule with includeInApplicationXml=true in your ear/pom.xml:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
[...]
<modules>
<javaModule>
<groupId>org.delta.npi.common</groupId>
<artifactId>common-jar</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</javaModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
-Max
Mick Knutson wrote:
Well, this does not seem to work the way I invision it.
I have the following:
pom.xml
-->common/pom.xml
-->ear/pom.xml
-->war/pom.xml
I declared my dependancies in my master pom, then added a provided scope in
my ear:
<dependency>
<groupId>org.delta.npi.common</groupId>
<artifactId>common-jar</artifactId>
<scope>compile</scope>
</dependency>
and in my war:
<dependency>
<groupId>org.delta.npi.common</groupId>
<artifactId>common-jar</artifactId>
<scope>provided</scope>
</dependency>
The common-jar _is_ in my ear, but the deployment fails as it can't seem to
access a class in common-jar
On 10/11/06, Max Cooper <[EMAIL PROTECTED]> wrote:
Scope is subject to inheritance as well.
Deciding where to put it is a judgment call.
In the context of your whole project, I wouldn't consider a jar that
goes in the ear to be "provided". I would only consider it to be
"provided" in the context of the war module. So, I would set the scope
in the child pom. And the version in the dependencyManagement section of
the parent pom.
-Max
Wayne Fay wrote:
> I'd imagine you could omit both, but I'm not currently doing that.
> Version I'm sure would flow through, and I'd expect scope would as
> well.
>
> Wayne
>
> On 10/11/06, Mick Knutson <[EMAIL PROTECTED]> wrote:
>> Can I omit the version and scope as they are already defined in the
>> master
>> pom.xml in DependancyManagement? Or did that not work?
>>
>>
>>
>>
>> On 10/11/06, Wayne Fay <[EMAIL PROTECTED]> wrote:
>> >
>> > Sure, here's my war and ear pom (not all of them, but some of the
>> > dependencies)...
>> >
>> > war/pom.xml
>> > <dependency>
>> > <groupId>geronimo-spec</groupId>
>> > <artifactId>geronimo-spec-jms</artifactId>
>> > <version>1.1-rc4</version>
>> > <scope>provided</scope>
>> > </dependency>
>> > <dependency>
>> > <groupId>geronimo-spec</groupId>
>> > <artifactId>geronimo-spec-ejb</artifactId>
>> > <version>2.1-rc4</version>
>> > <scope>provided</scope>
>> > </dependency>
>> > <dependency>
>> > <groupId>javax.servlet</groupId>
>> > <artifactId>servlet-api</artifactId>
>> > <version>2.3</version>
>> > <scope>provided</scope>
>> > </dependency>
>> > <dependency>
>> > <groupId>taglibs</groupId>
>> > <artifactId>standard</artifactId>
>> > <version>1.1.2</version>
>> > <scope>compile</scope>
>> > <exclusions>
>> > <exclusion>
>> > <artifactId>taglibs</artifactId>
>> > <groupId>standard</groupId>
>> > </exclusion>
>> > </exclusions>
>> > <optional>true</optional>
>> > </dependency>
>> > <dependency>
>> > <groupId>javax.servlet</groupId>
>> > <artifactId>jstl</artifactId>
>> > <version>1.1.2</version>
>> > <scope>compile</scope>
>> > <exclusions>
>> > <exclusion>
>> > <artifactId>javax.servlet</artifactId>
>> > <groupId>jstl</groupId>
>> > </exclusion>
>> > </exclusions>
>> > <optional>true</optional>
>> > </dependency>
>> > <dependency>
>> > <groupId>log4j</groupId>
>> > <artifactId>log4j</artifactId>
>> > <version>1.2.12</version>
>> > <scope>compile</scope>
>> > <exclusions>
>> > <exclusion>
>> > <artifactId>log4j</artifactId>
>> > <groupId>log4j</groupId>
>> > </exclusion>
>> > </exclusions>
>> > <optional>true</optional>
>> > </dependency>
>> > <dependency>
>> > <groupId>quartz</groupId>
>> > <artifactId>quartz</artifactId>
>> > <version>1.5.1</version>
>> > <scope>compile</scope>
>> > <exclusions>
>> > <exclusion>
>> > <artifactId>quartz</artifactId>
>> > <groupId>quartz</groupId>
>> > </exclusion>
>> > </exclusions>
>> > <optional>true</optional>
>> > </dependency>
>> >
>> >
>> > ear/pom.xml
>> > <dependency>
>> > <groupId>geronimo-spec</groupId>
>> > <artifactId>geronimo-spec-jms</artifactId>
>> > <version>1.1-rc4</version>
>> > <scope>provided</scope>
>> > </dependency>
>> > <dependency>
>> > <groupId>geronimo-spec</groupId>
>> > <artifactId>geronimo-spec-ejb</artifactId>
>> > <version>2.1-rc4</version>
>> > <scope>provided</scope>
>> > </dependency>
>> > <dependency>
>> > <groupId>javax.servlet</groupId>
>> > <artifactId>servlet-api</artifactId>
>> > <version>2.3</version>
>> > <scope>provided</scope>
>> > </dependency>
>> > <dependency>
>> > <groupId>taglibs</groupId>
>> > <artifactId>standard</artifactId>
>> > <version>1.1.2</version>
>> > <scope>compile</scope>
>> > </dependency>
>> > <dependency>
>> > <groupId>javax.servlet</groupId>
>> > <artifactId>jstl</artifactId>
>> > <version>1.1.2</version>
>> > <scope>compile</scope>
>> > </dependency>
>> > <dependency>
>> > <groupId>log4j</groupId>
>> > <artifactId>log4j</artifactId>
>> > <version>1.2.12</version>
>> > <scope>compile</scope>
>> > </dependency>
>> > <dependency>
>> > <groupId>quartz</groupId>
>> > <artifactId>quartz</artifactId>
>> > <version>1.5.1</version>
>> > <scope>compile</scope>
>> > </dependency>
>> >
>> >
>> > HTH.
>> > Wayne
>> >
>> > On 10/11/06, Mick Knutson <[EMAIL PROTECTED]> wrote:
>> > > Can I see your war pom.xml to see how you excluded everything?
>> > >
>> > >
>> > >
>> > > On 10/11/06, Wayne Fay <[EMAIL PROTECTED]> wrote:
>> > > >
>> > > > I generally only allow my JARs to be placed in my EAR lib to
reduce
>> > > > the overall size of my EAR and eliminate duplication of code
(I'm
>> > > > using Oracle OAS 10.1.2 right now). But you'll need to check
your
>> > > > container's documentation and perhaps the J2EE Specs to see what
>> works
>> > > > for you.
>> > > >
>> > > > Currently this requires me to declare and then simultaneously
>> exclude
>> > > > most every dependency in my WAR pom, and also declare them in
>> the EAR.
>> > > > So not a lot of fun from a "managing your poms" perspective.
>> > > >
>> > > > Wayne
>> > > >
>> > > > On 10/11/06, Mick Knutson <[EMAIL PROTECTED]> wrote:
>> > > > > I have many LIB's that are in both my war and my ear. Is this
>> > correct or
>> > > > > should they just be in the ear?
>> > > > >
>> > > > > --
>> > > > >
>> > > > > Thanks
>> > > > >
>> > > > > DJ MICK
>> > > > > http://www.djmick.com
>> > > > > http://www.myspace.com/mickknutson
>> > > > >
>> > > > >
>> > > >
>> > > >
>> ---------------------------------------------------------------------
>> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > > > For additional commands, e-mail: [EMAIL PROTECTED]
>> > > >
>> > > >
>> > >
>> > >
>> > > --
>> > >
>> > > Thanks
>> > >
>> > > DJ MICK
>> > > http://www.djmick.com
>> > > http://www.myspace.com/mickknutson
>> > >
>> > >
>> >
>> >
---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>>
>> --
>>
>> Thanks
>>
>> DJ MICK
>> http://www.djmick.com
>> http://www.myspace.com/mickknutson
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]