Hi Frank,

It seems a little strange, but it make sense.

We can use the provided in the dependency scope to make sure we will not pack 
the jars which can get from the runtime environment, but we also need to make 
sure our runtime environment provids the jars. 

Cheers,

Willem.
-----Original Message-----
From: Frank Budinsky [mailto:[EMAIL PROTECTED]
Sent: 1/6/2007  6:00
To: [email protected]
Subject: RE: Maven dependencies question
 
Thanks Willem. So I guess I'll just add the extra test scope dependency, 
even though it seems a little strange given no direct use of it.

Thanks,
Frank.

"Jiang, Ning \(Willem\)" <[EMAIL PROTECTED]> wrote on 01/04/2007 
10:50:15 PM:

> Hi Frank,
> 
> Maven help us to manage the dependencies by using the pom.xml which 
> we can define the dependency relationship.
> The dependency relationship can be used when maven need to setup the
> class path or do the packaging.
> Here is some note for "provided" that you can get from the book 
> "Better Builds with Maven":
> 
> "You should note that you're using a provided scope instead of the 
> default compile scope. The reason is that this dependency will 
> already be present in the environment (being the J2EE application 
> server) where your EJB will execute. You make this clear to Maven by
> using the provided scope; this prevents the EAR module from 
> including the J2EE JAR when it is packaged.Even though this 
> dependency is provided at runtime, it still needs to be listed in 
> the POM so that the code can be compiled."
> 
> And if your module A unit test need the C jar in the runtime, 
> because you had set C jar as the provided scope in the other module 
> B, you own A module will not take this dependency from module B even
> your have the dependence from B. So you need to add the C jar's 
> dependency as the <scope> test </scope> in the module A's pom.xml :). 
> 
> 
> Willem.
> 
> 
> 
> -----Original Message-----
> From: Frank Budinsky [mailto:[EMAIL PROTECTED]
> Sent: Fri 1/5/2007 11:08
> To: [email protected]
> Subject: Maven dependencies question
> 
> I think I need some help form somebody with a better understanding (than 

> me) of how maven dependencies work.
> 
> Because the Java sdo/impl project includes an optional stax 
> loader/serializer it  includes this in its pom.xml file:
> 
>         <!-- dependencies for optional StAX functions -->
>         <dependency>
>             <groupId>stax</groupId>
>             <artifactId>stax-api</artifactId>
>             <version>1.0.1</version>
>             <scope>provided</scope>
>             <optional>true</optional>
>         </dependency>
> 
> One of the new implementation classes in the the sdo/impl project also 
> uses the StAX function itself, internally in its implementation.
> 
> Now, in the sdo/tools project, we have a test program that calls the 
> implementation class that uses the StAX stuff (indirectly though an SDO 
> helper interface). Note that the test program in the sdo/tools project 
has 
> no import or direct use of any StAX interfaces.
> 
> However, when we now run mvn in the sdo/tools project, the test program, 

> mentioned above, fails with the following error:
> 
>         java.lang.NoClassDefFoundError: 
> javax/xml/stream/XMLStreamException
> 
> I was able to fix the problem by copying the stax dependency from the 
> sdo/impl pom.xml file and adding it to the pom.xml in the sdo/tools 
> project, but this seems a bit ridiculous, since as I mentioned above, 
the 
> use of stax is really only in the sdo/impl project.
> 
> Can anybody see what the problem might be, or suggest how to fix this?
> 
> Thanks in advance,
> Frank.
> 
> 
> ---------------------------------------------------------------------
> 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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to