You sure that this is the correct stage? I added the mentioned logic to the
uploadArchives, and nothing is changed. It seems like the pom.dependencies
is empty at this stage...


Hans Dockter wrote:
> 
> On Fri, Apr 2, 2010 at 4:00 PM, Shay Banon <[email protected]> wrote:
> 
>>
>> Hi,
>>
>>  I would like to change the dependencies generated when
>> installing/uploading maven artifacts. First, the example given in the 0.9
>> docs don't work (the whenConfigured option) because it fails with not
>> finding `installer`:
>>
>> [installer, deployer]*.pom*.whenConfigured {pom ->
>>    pom.dependencies.find {dep -> dep.groupId == 'group3' &&
>> dep.artifactId
>> == 'runtime' }.optional = true
>> }
>>
> 
> I need to fix that. That makes no sense without the specific context this
> snippet is from. Have a look in the samples in maven/pomGeneration. Then
> it
> will makes sense.
> 
>>
>> But, what I would like to do is basically exclude all the test scoped
>> dependencies from the pom generated. Also, I would like to change the
>> scope
>> of some compile ones to runtime (and make them optional). What is the
>> simplest way to achieve that?
>>
> 
> uploadArchives {
>     repositories.mavenDeployer {
>         repository(url: "file://localhost/tmp/myRepo/")
>         pom.dependencies = pom.dependencies.collect { dep -> dep.scope !=
> 'test' } // removes the test scoped ones
>         pom.dependencies.findAll { dep -> // someCriteria }*.scope =
> 'runtime'
> }
> 
> - Hans
> 
> --
> Hans Dockter
> Founder, Gradle
> http://www.gradle.org, http://twitter.com/gradleorg
> CEO, Gradle Inc. - Gradle Training, Support, Consulting
> http://www.gradle.biz
> 
> 
>>
>> Cheers,
>> Shay
>> --
>> View this message in context:
>> http://old.nabble.com/maven-pom-generation-tp28119288p28119288.html
>> Sent from the gradle-user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/maven-pom-generation-tp28119288p28119888.html
Sent from the gradle-user mailing list archive at Nabble.com.


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

    http://xircles.codehaus.org/manage_email


Reply via email to