Re: Upgrade guava to at least 18.0

2017-02-23 Thread Andrew Bayer
Yyyyup. See
https://github.com/jenkinsci/pipeline-model-definition-plugin/blob/master/pipeline-model-json-shaded/pom.xml
in Declarative for an example of that. And for that matter, the
jclouds/OpenStack plugins are the same thing - they need to create a shaded
uberjar of jclouds and Guava, with Guava relocated.

A.

On Thu, Feb 23, 2017 at 1:17 PM, Stephen Connolly <
stephen.alan.conno...@gmail.com> wrote:

> Then you need to shade that dependency...
>
> On Thu 23 Feb 2017 at 20:53, Oliver Gondža  wrote:
>
>> On 2017-02-23 21:40, Andrew Bayer wrote:
>> > fwiw, that seems to only work for certain Guava version differences -
>> > over in the jclouds plugin, I eventually ran into problems going to
>> > anything past Guava 13, I think, and ended up needing to shade Guava.
>>
>> The openstack plugin is a fork of jclouds so I ended up fighting the
>> same beast. IIUC, shading (or rather class relocation) help if your
>> plugin code needs newer guava, which is rarely the case. It is usually
>> some dependency that needs that but it is not referring to your shaded
>> classes of course so it gets the original ones.
>>
>> --
>> oliver
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jenkinsci-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/jenkinsci-dev/f3a35d24-186a-5b42-934a-58983d6fca2f%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> Sent from my phone
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-dev/CA%2BnPnMzuGtrxmAK5YVPfm3R9-
> 31hqepZG2vxVf5R4%2BnnXmjAyg%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAPbPdOb4sFM%3DmZxjNCpbbfv4dy6zhgeKiZ-xMGJaxyytuESAdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade guava to at least 18.0

2017-02-23 Thread Stephen Connolly
Then you need to shade that dependency...

On Thu 23 Feb 2017 at 20:53, Oliver Gondža  wrote:

> On 2017-02-23 21:40, Andrew Bayer wrote:
> > fwiw, that seems to only work for certain Guava version differences -
> > over in the jclouds plugin, I eventually ran into problems going to
> > anything past Guava 13, I think, and ended up needing to shade Guava.
>
> The openstack plugin is a fork of jclouds so I ended up fighting the
> same beast. IIUC, shading (or rather class relocation) help if your
> plugin code needs newer guava, which is rarely the case. It is usually
> some dependency that needs that but it is not referring to your shaded
> classes of course so it gets the original ones.
>
> --
> oliver
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/f3a35d24-186a-5b42-934a-58983d6fca2f%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Sent from my phone

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BnPnMzuGtrxmAK5YVPfm3R9-31hqepZG2vxVf5R4%2BnnXmjAyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade guava to at least 18.0

2017-02-23 Thread Oliver Gondža

On 2017-02-23 21:40, Andrew Bayer wrote:

fwiw, that seems to only work for certain Guava version differences -
over in the jclouds plugin, I eventually ran into problems going to
anything past Guava 13, I think, and ended up needing to shade Guava.


The openstack plugin is a fork of jclouds so I ended up fighting the 
same beast. IIUC, shading (or rather class relocation) help if your 
plugin code needs newer guava, which is rarely the case. It is usually 
some dependency that needs that but it is not referring to your shaded 
classes of course so it gets the original ones.


--
oliver

--
You received this message because you are subscribed to the Google Groups "Jenkins 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/f3a35d24-186a-5b42-934a-58983d6fca2f%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade guava to at least 18.0

2017-02-23 Thread Andrew Bayer
fwiw, that seems to only work for certain Guava version differences - over
in the jclouds plugin, I eventually ran into problems going to anything
past Guava 13, I think, and ended up needing to shade Guava.

A.

On Thu, Feb 23, 2017 at 8:23 AM, tamal  wrote:

> Thanks Oliver.
>
> On Wednesday, February 22, 2017 at 11:51:23 PM UTC-8, ogondza wrote:
>>
>> On 2017-02-23 02:36, tamal wrote:
>> > Oliver,
>> > "What worked for me
>> > here was instructing maven-hpi-plugin to use pluginFirstClassLoader so
>> > your plugin will prefer the version of guava it bundles rather than the
>> > one core happens to use. Both shading and class masking had subtle
>> > problems. "
>> >
>> > Do you have any example or docs that you can point me to? Thank you,
>>
>> https://jenkinsci.github.io/maven-hpi-plugin/plugin-info.html
>> https://jenkinsci.github.io/maven-hpi-plugin/hpl-mojo.html#
>> pluginFirstClassLoader
>> https://github.com/jenkinsci/openstack-cloud-plugin/blob/de0
>> 2466d84f00eac7260345cc6784f354aabf76a/pom.xml#L117-L123
>>
>> --
>> oliver
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-dev/ac0d8ab2-35be-4e1f-b6db-daf521042e1b%
> 40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAPbPdOZhSar745zE7AvaRK_2ThnXQeQxXvcaCc4JgHH2VPdfKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade guava to at least 18.0

2017-02-23 Thread tamal
Thanks Oliver.

On Wednesday, February 22, 2017 at 11:51:23 PM UTC-8, ogondza wrote:
>
> On 2017-02-23 02:36, tamal wrote: 
> > Oliver, 
> > "What worked for me 
> > here was instructing maven-hpi-plugin to use pluginFirstClassLoader so 
> > your plugin will prefer the version of guava it bundles rather than the 
> > one core happens to use. Both shading and class masking had subtle 
> > problems. " 
> > 
> > Do you have any example or docs that you can point me to? Thank you, 
>
> https://jenkinsci.github.io/maven-hpi-plugin/plugin-info.html 
>
> https://jenkinsci.github.io/maven-hpi-plugin/hpl-mojo.html#pluginFirstClassLoader
>  
>
> https://github.com/jenkinsci/openstack-cloud-plugin/blob/de02466d84f00eac7260345cc6784f354aabf76a/pom.xml#L117-L123
>  
>
> -- 
> oliver 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/ac0d8ab2-35be-4e1f-b6db-daf521042e1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade guava to at least 18.0

2017-02-22 Thread Oliver Gondža

On 2017-02-23 02:36, tamal wrote:

Oliver,
"What worked for me
here was instructing maven-hpi-plugin to use pluginFirstClassLoader so
your plugin will prefer the version of guava it bundles rather than the
one core happens to use. Both shading and class masking had subtle
problems. "

Do you have any example or docs that you can point me to? Thank you,


https://jenkinsci.github.io/maven-hpi-plugin/plugin-info.html
https://jenkinsci.github.io/maven-hpi-plugin/hpl-mojo.html#pluginFirstClassLoader
https://github.com/jenkinsci/openstack-cloud-plugin/blob/de02466d84f00eac7260345cc6784f354aabf76a/pom.xml#L117-L123

--
oliver

--
You received this message because you are subscribed to the Google Groups "Jenkins 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/cb688c85-e5be-9eff-7b66-a09da3e493e9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade guava to at least 18.0

2017-02-22 Thread tamal
Oliver,
"What worked for me 
here was instructing maven-hpi-plugin to use pluginFirstClassLoader so 
your plugin will prefer the version of guava it bundles rather than the 
one core happens to use. Both shading and class masking had subtle 
problems. "

Do you have any example or docs that you can point me to? Thank you,

-Tamal

On Tuesday, February 21, 2017 at 11:34:08 PM UTC-8, ogondza wrote:
>
> On 2017-02-22 03:42, tamal wrote: 
> > I meant to say Jenkins uses Guava 11.x. 
> > 
> > On Tuesday, February 21, 2017 at 6:41:25 PM UTC-8, tamal wrote: 
> > 
> > Hi, 
> > We are writing some custom Jenkins plugin that uses auto generated 
> > gRPC java client. The issue is Jenkins by default bundles Guava 
> > 15.0. But gRPC client needs 18.0, otherwise we are getting Method 
> > Not Found exceptions. So, we have modified Jenkins to use Guava 
> > 18.0. But the issue is between 15.0 and 18.0, Guava renamed method 
> > Iterators.skip() to Iterators.advance(). You can see our commit 
> here: 
> > 
> > 
> https://github.com/appscode-ci/jenkins/commit/3d67efe7b1020945a71245ffaf94438829775f8e
>  
> > <
> https://github.com/appscode-ci/jenkins/commit/3d67efe7b1020945a71245ffaf94438829775f8e>
>  
>
> > 
> > My question is will it be possible to upgrade Jenkins to use at 
> > least Guava 18.0 ? 
>
> I have struggled with this for a long time and (except for a distaste to 
> google developed libraries i have developed) it was a waste of time. 
> Changing the guava version in core is a challenge as there likely are 
> many plugins that depend on that particular version and updating it 
> would break binary compatibility for those plugins. What worked for me 
> here was instructing maven-hpi-plugin to use pluginFirstClassLoader so 
> your plugin will prefer the version of guava it bundles rather than the 
> one core happens to use. Both shading and class masking had subtle 
> problems. 
>
> HTH 
> -- 
> oliver 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/29403001-c961-4800-a09a-2136ad1d1d79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade guava to at least 18.0

2017-02-22 Thread Stephen Connolly
Friends don't let friends use guava

On 22 February 2017 at 07:33, Oliver Gondža  wrote:

> On 2017-02-22 03:42, tamal wrote:
>
>> I meant to say Jenkins uses Guava 11.x.
>>
>> On Tuesday, February 21, 2017 at 6:41:25 PM UTC-8, tamal wrote:
>>
>> Hi,
>> We are writing some custom Jenkins plugin that uses auto generated
>> gRPC java client. The issue is Jenkins by default bundles Guava
>> 15.0. But gRPC client needs 18.0, otherwise we are getting Method
>> Not Found exceptions. So, we have modified Jenkins to use Guava
>> 18.0. But the issue is between 15.0 and 18.0, Guava renamed method
>> Iterators.skip() to Iterators.advance(). You can see our commit here:
>>
>> https://github.com/appscode-ci/jenkins/commit/3d67efe7b10209
>> 45a71245ffaf94438829775f8e
>> > 945a71245ffaf94438829775f8e>
>>
>> My question is will it be possible to upgrade Jenkins to use at
>> least Guava 18.0 ?
>>
>
> I have struggled with this for a long time and (except for a distaste to
> google developed libraries i have developed) it was a waste of time.
> Changing the guava version in core is a challenge as there likely are many
> plugins that depend on that particular version and updating it would break
> binary compatibility for those plugins. What worked for me here was
> instructing maven-hpi-plugin to use pluginFirstClassLoader so your plugin
> will prefer the version of guava it bundles rather than the one core
> happens to use. Both shading and class masking had subtle problems.
>
> HTH
> --
> oliver
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/jenkinsci-dev/1ae5e6a7-f031-5d72-36ed-8249ea32f68e%40gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BnPnMwvEj1ootcj21haa7QtnpfUQup5fugy5jMg-i0_-gdrrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade guava to at least 18.0

2017-02-21 Thread Oliver Gondža

On 2017-02-22 03:42, tamal wrote:

I meant to say Jenkins uses Guava 11.x.

On Tuesday, February 21, 2017 at 6:41:25 PM UTC-8, tamal wrote:

Hi,
We are writing some custom Jenkins plugin that uses auto generated
gRPC java client. The issue is Jenkins by default bundles Guava
15.0. But gRPC client needs 18.0, otherwise we are getting Method
Not Found exceptions. So, we have modified Jenkins to use Guava
18.0. But the issue is between 15.0 and 18.0, Guava renamed method
Iterators.skip() to Iterators.advance(). You can see our commit here:


https://github.com/appscode-ci/jenkins/commit/3d67efe7b1020945a71245ffaf94438829775f8e



My question is will it be possible to upgrade Jenkins to use at
least Guava 18.0 ?


I have struggled with this for a long time and (except for a distaste to 
google developed libraries i have developed) it was a waste of time. 
Changing the guava version in core is a challenge as there likely are 
many plugins that depend on that particular version and updating it 
would break binary compatibility for those plugins. What worked for me 
here was instructing maven-hpi-plugin to use pluginFirstClassLoader so 
your plugin will prefer the version of guava it bundles rather than the 
one core happens to use. Both shading and class masking had subtle problems.


HTH
--
oliver

--
You received this message because you are subscribed to the Google Groups "Jenkins 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/1ae5e6a7-f031-5d72-36ed-8249ea32f68e%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade guava to at least 18.0

2017-02-21 Thread tamal
I meant to say Jenkins uses Guava 11.x.

On Tuesday, February 21, 2017 at 6:41:25 PM UTC-8, tamal wrote:
>
> Hi,
> We are writing some custom Jenkins plugin that uses auto generated gRPC 
> java client. The issue is Jenkins by default bundles Guava 15.0. But gRPC 
> client needs 18.0, otherwise we are getting Method Not Found exceptions. 
> So, we have modified Jenkins to use Guava 18.0. But the issue is between 
> 15.0 and 18.0, Guava renamed method Iterators.skip() to 
> Iterators.advance(). You can see our commit here: 
>
>
> https://github.com/appscode-ci/jenkins/commit/3d67efe7b1020945a71245ffaf94438829775f8e
>
> My question is will it be possible to upgrade Jenkins to use at least 
> Guava 18.0 ?
>
> Thanks.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/dcaf2dab-4855-484c-ab82-303326522540%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.