dependency vs. dependencyManagement

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

dependency vs. dependencyManagement

Marko Bauhardt-3
Hi,
i have a question about the dependency management in gradle.

maven supports two types of dependencies. one is the normal  
"dependency" tag. And another way to define dependencies for  
multiprojects is to use the "dependencyManagement".
See http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Management

I think the different between dependency and dependencyManagement is  
that a sub-module inherit the dependency definitions like "exclude" or  
"version" from the parent-project. But only if this dependency is  
configured in the sub-module.

Is there a way how gradle / ivy deals with "dependencyManagement" ?

Thanks
Marko




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: dependency vs. dependencyManagement

hans_d
Administrator
Hi Marko,

On Sep 26, 2008, at 12:20 PM, Marko Bauhardt wrote:

> Hi,
> i have a question about the dependency management in gradle.
>
> maven supports two types of dependencies. one is the normal  
> "dependency" tag. And another way to define dependencies for  
> multiprojects is to use the "dependencyManagement".
> See http://maven.apache.org/guides/introduction/introduction-to- 
> dependency-mechanism.html#Dependency_Management
>
> I think the different between dependency and dependencyManagement  
> is that a sub-module inherit the dependency definitions like  
> "exclude" or "version" from the parent-project. But only if this  
> dependency is configured in the sub-module.
>
> Is there a way how gradle / ivy deals with "dependencyManagement" ?

After doing some research to answer this question I found a new  
feature in Ivy which is supposed to enable this. It is not documented  
yet in the Ivy doc.

There is some description in the related issue: https://
issues.apache.org/jira/browse/IVY-784

Could you file an issue for exposing this via Gradle?

You can also use the force attribute in your Gradle dependency  
declaration to make a certain version win.

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: dependency vs. dependencyManagement

Marko Bauhardt-3

On Sep 26, 2008, at 1:20 PM, Hans Dockter wrote:

>
> After doing some research to answer this question I found a new  
> feature in Ivy which is supposed to enable this. It is not  
> documented yet in the Ivy doc.
>
> There is some description in the related issue: https://issues.apache.org/jira/browse/IVY-784
>
> Could you file an issue for exposing this via Gradle?

i have created a jira issue http://jira.codehaus.org/browse/GRADLE-244
>
>
> You can also use the force attribute in your Gradle dependency  
> declaration to make a certain version win.

I am not sure if i understand the dependency mechnism correctly. I  
think, if i define the dependency in the root build.gradle, every  
submodule has this dependency in their classpath.
but the advantage of the maven dependencyMechanism is that the  
dependency is only in the classpath if this dependency is defined in  
the sub-module. And only then the attributes like exclude and version  
are inherit from the root build.gradle.

right?

marko


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: dependency vs. dependencyManagement

hans_d
Administrator

On Sep 26, 2008, at 1:52 PM, Marko Bauhardt wrote:

>
> On Sep 26, 2008, at 1:20 PM, Hans Dockter wrote:
>
>>
>> After doing some research to answer this question I found a new  
>> feature in Ivy which is supposed to enable this. It is not  
>> documented yet in the Ivy doc.
>>
>> There is some description in the related issue: https://
>> issues.apache.org/jira/browse/IVY-784
>>
>> Could you file an issue for exposing this via Gradle?
>
> i have created a jira issue http://jira.codehaus.org/browse/GRADLE-244
>>
>>
>> You can also use the force attribute in your Gradle dependency  
>> declaration to make a certain version win.
>
> I am not sure if i understand the dependency mechnism correctly. I  
> think, if i define the dependency in the root build.gradle, every  
> submodule has this dependency in their classpath.
> but the advantage of the maven dependencyMechanism is that the  
> dependency is only in the classpath if this dependency is defined  
> in the sub-module. And only then the attributes like exclude and  
> version are inherit from the root build.gradle.
>
> right?

Right. And it also applies to any dependency in the transitive  
dependency tree. The force attribute you can only set to true for  
dependencies you explicitly declare. I just mentioned the force  
attribute to say that there is another means to influence what  
revision is chosen. It is probably of no help for your use case.

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email