Re: Scope import and importing provided dependencies

2009-05-14 Thread Jim Sellers
My bad.  I didn't see that you had attached the files.

>From what I understand, the import will only work with the dependency
management (dep. mgmt) section.  My guess is that it's being ignored with
how you have your pom's.  You could remove it and see if you get the same
result.  My mental definitation for the dep. mgmt section is "if you're
going to use this artifact, use this version, scope, exclusions, etc".  I
don't think that transitive dependencies are ever pulled across.

I understand what you're trying to do, but I don't think that it's possible
with maven today.  What you'll have to do is move your dependencies from
your a-pom into the dep mgmt section, import them into the b-pom's dep mgmt
section, and then have them as dependencies by just listing the groupId,
artifactId, and possibly the classifier.

It's not as "neat" in some ways, but it also means that you don't *have* to
pull in a dependency from the a-pom if you don't to use it.

I thought that the dep mgmt import thing was weird / strange at first, but
it's very, very useful.  Cleans the pom's up a bunch too.

Jim


On Thu, May 14, 2009 at 11:19 AM, Nick Stolwijk wrote:

> On Thu, May 14, 2009 at 5:00 PM, Jim Sellers 
> wrote:
> > Just a note: "import" is a scope used in the dependency management
> section,
> > so I found your original question confusing.
>
> I had attached the a and b pom, but I did import the the pom in the
> dependencies section and it worked mostly. So, why is this only to be
> used in the dependency management section?
>
> What I want to achieve is a coupling of dependencies, so the project
> that depends on these coupling can depend on one dependency, instead
> of the group of dependencies.
>
> So, project A is the coupling project which has dependencies on X, Y and Z.
> Project B needs X, Y and Z, but instead of depending on the three of
> them, I want it as a package, thus A. I have inserted project A as a
> dependency with scope import in B and for most of the dependencies
> defined in A, project B now works, except for the provided dependency.
>
> Is this use case supported?
>
> With regards,
>
> Nick Stolwijk
> ~Java Developer~
>
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Scope import and importing provided dependencies

2009-05-14 Thread Nick Stolwijk
On Thu, May 14, 2009 at 5:00 PM, Jim Sellers  wrote:
> Just a note: "import" is a scope used in the dependency management section,
> so I found your original question confusing.

I had attached the a and b pom, but I did import the the pom in the
dependencies section and it worked mostly. So, why is this only to be
used in the dependency management section?

What I want to achieve is a coupling of dependencies, so the project
that depends on these coupling can depend on one dependency, instead
of the group of dependencies.

So, project A is the coupling project which has dependencies on X, Y and Z.
Project B needs X, Y and Z, but instead of depending on the three of
them, I want it as a package, thus A. I have inserted project A as a
dependency with scope import in B and for most of the dependencies
defined in A, project B now works, except for the provided dependency.

Is this use case supported?

With regards,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Scope import and importing provided dependencies

2009-05-14 Thread Jim Sellers
I don't believe that "provided" dependencies are transitive.
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope

Just a note: "import" is a scope used in the dependency management section,
so I found your original question confusing.
"I have a-pom.xml, which has a few dependencies and b-pom.xml which imports
a-pom.xml."

I'd assuming that you mean a-pom depends on b-pom.

You might want to take a look at the import feature too.
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies

HTH
Jim


On Thu, May 14, 2009 at 8:12 AM, Nick Stolwijk wrote:

> Later occured to me that all dependencies have scope runtime. If I
> replace in b-pom.xml the scope with scope provided, all dependencies
> show up as provided, except the one that is actually scoped provided.
>
> Can someone shed some more light on this?
>
> With regards,
>
> Nick Stolwijk
> ~Java Developer~
>
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
>
>
>
> On Thu, May 14, 2009 at 1:34 PM, Nick Stolwijk 
> wrote:
> > I have a strange issue with importing provided dependencies.
> >
> > I have a-pom.xml, which has a few dependencies and b-pom.xml which
> > imports a-pom.xml.
> >
> > After a mvn -f a-pom.xml install && mvn -f b-pom.xml dependency:tree I
> > see the following:
> >
> > [INFO] snapshot com.example:dependency-pom:0.1-SNAPSHOT: checking for
> > updates from atlassian
> > [INFO] [dependency:tree]
> > [INFO] com.example:example-jar:jar:0.1-SNAPSHOT
> > [INFO] \- com.example:dependency-pom:pom:0.1-SNAPSHOT:import
> > [INFO]+- commons-validator:commons-validator:jar:1.3.1:runtime
> > [INFO]|  +- commons-beanutils:commons-beanutils:jar:1.7.0:runtime
> > [INFO]|  +- commons-digester:commons-digester:jar:1.6:runtime
> > [INFO]|  |  +-
> commons-collections:commons-collections:jar:2.1:runtime
> > [INFO]|  |  \- xml-apis:xml-apis:jar:1.0.b2:runtime
> > [INFO]|  \- commons-logging:commons-logging:jar:1.0.4:runtime
> > [INFO]\- oro:oro:jar:2.0.8:runtime
> >
> > These are all the dependencies which are in a-pom.xml except for:
> >
> >com.google.collections
> >google-collections
> >0.8
> >provided
> >
> >
> > Did I understand or do something wrong?
> >
> > With regards,
> >
> > Nick Stolwijk
> > ~Java Developer~
> >
> > Iprofs BV.
> > Claus Sluterweg 125
> > 2012 WS Haarlem
> > www.iprofs.nl
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Scope import and importing provided dependencies

2009-05-14 Thread Nick Stolwijk
Later occured to me that all dependencies have scope runtime. If I
replace in b-pom.xml the scope with scope provided, all dependencies
show up as provided, except the one that is actually scoped provided.

Can someone shed some more light on this?

With regards,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



On Thu, May 14, 2009 at 1:34 PM, Nick Stolwijk  wrote:
> I have a strange issue with importing provided dependencies.
>
> I have a-pom.xml, which has a few dependencies and b-pom.xml which
> imports a-pom.xml.
>
> After a mvn -f a-pom.xml install && mvn -f b-pom.xml dependency:tree I
> see the following:
>
> [INFO] snapshot com.example:dependency-pom:0.1-SNAPSHOT: checking for
> updates from atlassian
> [INFO] [dependency:tree]
> [INFO] com.example:example-jar:jar:0.1-SNAPSHOT
> [INFO] \- com.example:dependency-pom:pom:0.1-SNAPSHOT:import
> [INFO]    +- commons-validator:commons-validator:jar:1.3.1:runtime
> [INFO]    |  +- commons-beanutils:commons-beanutils:jar:1.7.0:runtime
> [INFO]    |  +- commons-digester:commons-digester:jar:1.6:runtime
> [INFO]    |  |  +- commons-collections:commons-collections:jar:2.1:runtime
> [INFO]    |  |  \- xml-apis:xml-apis:jar:1.0.b2:runtime
> [INFO]    |  \- commons-logging:commons-logging:jar:1.0.4:runtime
> [INFO]    \- oro:oro:jar:2.0.8:runtime
>
> These are all the dependencies which are in a-pom.xml except for:
>            
>                com.google.collections
>                google-collections
>                0.8
>                provided
>            
>
> Did I understand or do something wrong?
>
> With regards,
>
> Nick Stolwijk
> ~Java Developer~
>
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
>

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Scope import and importing provided dependencies

2009-05-14 Thread Nick Stolwijk
I have a strange issue with importing provided dependencies.

I have a-pom.xml, which has a few dependencies and b-pom.xml which
imports a-pom.xml.

After a mvn -f a-pom.xml install && mvn -f b-pom.xml dependency:tree I
see the following:

[INFO] snapshot com.example:dependency-pom:0.1-SNAPSHOT: checking for
updates from atlassian
[INFO] [dependency:tree]
[INFO] com.example:example-jar:jar:0.1-SNAPSHOT
[INFO] \- com.example:dependency-pom:pom:0.1-SNAPSHOT:import
[INFO]+- commons-validator:commons-validator:jar:1.3.1:runtime
[INFO]|  +- commons-beanutils:commons-beanutils:jar:1.7.0:runtime
[INFO]|  +- commons-digester:commons-digester:jar:1.6:runtime
[INFO]|  |  +- commons-collections:commons-collections:jar:2.1:runtime
[INFO]|  |  \- xml-apis:xml-apis:jar:1.0.b2:runtime
[INFO]|  \- commons-logging:commons-logging:jar:1.0.4:runtime
[INFO]\- oro:oro:jar:2.0.8:runtime

These are all the dependencies which are in a-pom.xml except for:

com.google.collections
google-collections
0.8
provided


Did I understand or do something wrong?

With regards,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl
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";>
4.0.0
com.example
dependency-pom
pom
0.1-SNAPSHOT
Example Dependency POM

   

org.mockito
mockito-all
1.6
test


commons-validator
commons-validator
1.3.1


oro
oro
2.0.8
runtime


com.google.collections
google-collections
0.8
		provided
	
 

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";>
4.0.0
com.example
example-jar
jar
0.1-SNAPSHOT
Example Jar POM

  
	com.example
	  dependency-pom
	  0.1-SNAPSHOT
	  pom
	  import
	



-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org