Quantcast

Exclude jars from plugin

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Exclude jars from plugin

rlovtangen
I'm trying to exclude javax.activation:activation:1.1 that is being brought in by plugin mail 1.0

I would expect the following to work, but it doesn't:

runtime (':mail:1.0') {
        excludes 'activation'
}

I also tried with 'javax.activation', 'javax.activation:activation' and 'javax.activation:activation:1.1'

The mail plugin does not have a dependency to javax.activation:activation directly, but it has a dependency to javax.mail:mail:1.4.3, which depends on javax.activation:activation.
I can successfully exclude javax.mail:mail, and then also get rid of javax.activation:activation:

runtime (':mail:1.0') {
        excludes 'mail'
}

But of course, I don't need a mail plugin that can't send emails.


Is this a bug, or isn't the exclude supposed to exclude transitive dependencies, only first level dependencies?


Ronny


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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Exclude jars from plugin

Ian Roberts
On 13/06/2012 14:11, Ronny Løvtangen wrote:
> Is this a bug, or isn't the exclude supposed to exclude transitive dependencies, only first level dependencies?

I had a similar problem, and ended up doing as you have - excluding the
'mail' dependency but then putting in a direct dependency on
'javax.mail:mail:1.4.3' with its own excludes 'activation'.

Interestingly though, if I change the mail plugin dependency to compile
rather than runtime then

compile(':mail:1.0') {
  excludes 'activation'
}

*does* appear to work as expected.  It's almost as if an excludes within
a runtime-scope dependency is only excluding transitive dependencies
that are themselves runtime-scope, and not excluding a compile-scope
transitive dependency (activation) of the runtime-scope direct
dependency (the mail plugin).

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Exclude jars from plugin

jroenberg
In reply to this post by rlovtangen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Exclude jars from plugin

rlovtangen
Thanks.
I already have a delete in grails.war.resources, but it is a terrible workaround IMO.

Ronny

On Jun 13, 2012, at 3:43 PM, jroenberg wrote:

> Hi Ronny
>
> The solution is right here:
> http://grails.1312388.n4.nabble.com/How-to-exclude-mail-jar-and-activation-jar-from-Mail-plugin-td2336346.html
>
> -----
> Jimi
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Exclude-jars-from-plugin-tp4630055p4630059.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Exclude jars from plugin

rlovtangen
In reply to this post by Ian Roberts

On Jun 13, 2012, at 3:43 PM, Ian Roberts wrote:

> On 13/06/2012 14:11, Ronny Løvtangen wrote:
>> Is this a bug, or isn't the exclude supposed to exclude transitive dependencies, only first level dependencies?
>
> I had a similar problem, and ended up doing as you have - excluding the
> 'mail' dependency but then putting in a direct dependency on
> 'javax.mail:mail:1.4.3' with its own excludes 'activation'.

That's a much better workaround than a delete in grails.war.resources, as IDE's will pick up this as well (hopefully).

>
> Interestingly though, if I change the mail plugin dependency to compile
> rather than runtime then
>
> compile(':mail:1.0') {
>  excludes 'activation'
> }
>
> *does* appear to work as expected.  It's almost as if an excludes within
> a runtime-scope dependency is only excluding transitive dependencies
> that are themselves runtime-scope, and not excluding a compile-scope
> transitive dependency (activation) of the runtime-scope direct
> dependency (the mail plugin).

That's interesting. It works for me as well.
The explanation is probably something along the lines of what you say.
This can't be intentional, Jira issue coming up.

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Exclude jars from plugin

rlovtangen
Created http://jira.grails.org/browse/GRAILS-9188

Ronny

On Jun 13, 2012, at 3:58 PM, Ronny Løvtangen wrote:

>
> On Jun 13, 2012, at 3:43 PM, Ian Roberts wrote:
>
>> On 13/06/2012 14:11, Ronny Løvtangen wrote:
>>> Is this a bug, or isn't the exclude supposed to exclude transitive dependencies, only first level dependencies?
>>
>> I had a similar problem, and ended up doing as you have - excluding the
>> 'mail' dependency but then putting in a direct dependency on
>> 'javax.mail:mail:1.4.3' with its own excludes 'activation'.
>
> That's a much better workaround than a delete in grails.war.resources, as IDE's will pick up this as well (hopefully).
>
>>
>> Interestingly though, if I change the mail plugin dependency to compile
>> rather than runtime then
>>
>> compile(':mail:1.0') {
>> excludes 'activation'
>> }
>>
>> *does* appear to work as expected.  It's almost as if an excludes within
>> a runtime-scope dependency is only excluding transitive dependencies
>> that are themselves runtime-scope, and not excluding a compile-scope
>> transitive dependency (activation) of the runtime-scope direct
>> dependency (the mail plugin).
>
> That's interesting. It works for me as well.
> The explanation is probably something along the lines of what you say.
> This can't be intentional, Jira issue coming up.
>
> Ronny
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>


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

    http://xircles.codehaus.org/manage_email


Loading...