Geb and Release plugin httpclient conflicts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Geb and Release plugin httpclient conflicts

basejump (Josh)
No matter what I do I can't seem to get Geb to work consistently as I can't get the version 4.0 httpclient to be excluded from the release.
from the dependency report , It appears that httpbuilder which release depends on, is pulling the 4.0 httpclient even though I have in the excludes
I get a 
java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.
Here is the build config

versions = [geb:"0.6.2", selenium:"2.16.1", spock:"0.6-SNAPSHOT",pluginConfig:"[0.1.5,)"]
dependencies {
  test "org.codehaus.geb:geb-spock:${versions.geb}",
         "org.seleniumhq.selenium:selenium-htmlunit-driver:${versions.selenium}",
         "org.apache.httpcomponents:httpclient:4.1.2",
         "org.apache.httpcomponents:httpcore:4.1.3"
}

plugins {
    test ":geb:${versions.geb}",":spock:${versions.spock}"
    build(':release:1.0.1') {
        excludes 'nekohtml', "httpclient"
        export = false
    }
}

I do a test-app and it works fine.
When I do a run-app and then go back and try a test-app is when the error happens and httpbuilder(thus release) pulls the older version of httpclient

Reply | Threaded
Open this post in threaded view
|

Re: Geb and Release plugin httpclient conflicts

Sebastian Gozin
I've had this problem as well.
I tend to not install the release plugin at all and only install it when running my release build script in jenkins. Then not push the changes made to application.properties back to git so the release plugin remains uninstalled.

It's hacky but at least it allows the build pipeline to work.

On 14 Jan 2012, at 18:26, Josh (basejump) wrote:

No matter what I do I can't seem to get Geb to work consistently as I can't get the version 4.0 httpclient to be excluded from the release.
from the dependency report , It appears that httpbuilder which release depends on, is pulling the 4.0 httpclient even though I have in the excludes
I get a 
java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.
Here is the build config

versions = [geb:"0.6.2", selenium:"2.16.1", spock:"0.6-SNAPSHOT",pluginConfig:"[0.1.5,)"]
dependencies {
  test "org.codehaus.geb:geb-spock:${versions.geb}",
         "org.seleniumhq.selenium:selenium-htmlunit-driver:${versions.selenium}",
         "org.apache.httpcomponents:httpclient:4.1.2",
         "org.apache.httpcomponents:httpcore:4.1.3"
}

plugins {
    test ":geb:${versions.geb}",":spock:${versions.spock}"
    build(':release:1.0.1') {
        excludes 'nekohtml', "httpclient"
        export = false
    }
}

I do a test-app and it works fine.
When I do a run-app and then go back and try a test-app is when the error happens and httpbuilder(thus release) pulls the older version of httpclient


Reply | Threaded
Open this post in threaded view
|

Re: Geb and Release plugin httpclient conflicts

Antony Jones
I too have had this problem a number of times, most recently, yesterday.

Here's what I've done in the past (from memory, so there might be
slight tweaks you need to this method), but:

1. httpbuilder as a 'runtime' dependency
2. exclude httpclient, httpcore, xml-apis, and groovy as httpbuilder
dependencies.
3. include httpclient and httpcore (version 4.1.2) as 'provided' dependencies.

In fact, step 3 is the most important step of all. Essentially, you
should notice that httpclient/httpcore 4.0.x are brought in as
PROVIDED dependencies by org.grails.internal. What you need to do is
bring in httpclient/core version 4.1.2 as dependencies in that same
scope, and grails will automatically evict the earlier version from
that scope, even though they're brought in by grails itself.

You can easily evict any dependency you want by overriding it in the
same scope as it is brought in by.

For certainty, run grails clean, delete ~/.grails, and never allow any
plugins to be brought in by application.properties

Cheers,
Antony

On 14 January 2012 18:00, Sebastian Gozin <[hidden email]> wrote:

> I've had this problem as well.
> I tend to not install the release plugin at all and only install it when
> running my release build script in jenkins. Then not push the changes made
> to application.properties back to git so the release plugin remains
> uninstalled.
>
> It's hacky but at least it allows the build pipeline to work.
>
> On 14 Jan 2012, at 18:26, Josh (basejump) wrote:
>
> No matter what I do I can't seem to get Geb to work consistently as I can't
> get the version 4.0 httpclient to be excluded from the release.
> from the dependency report , It appears that httpbuilder which release
> depends on, is pulling the 4.0 httpclient even though I have in the excludes
> I get a
>
> java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.
>
> Here is the build config
>
> versions = [geb:"0.6.2", selenium:"2.16.1",
> spock:"0.6-SNAPSHOT",pluginConfig:"[0.1.5,)"]
> dependencies {
>   test "org.codehaus.geb:geb-spock:${versions.geb}",
>
>  "org.seleniumhq.selenium:selenium-htmlunit-driver:${versions.selenium}",
>          "org.apache.httpcomponents:httpclient:4.1.2",
>          "org.apache.httpcomponents:httpcore:4.1.3"
> }
>
> plugins {
>     test ":geb:${versions.geb}",":spock:${versions.spock}"
>     build(':release:1.0.1') {
>         excludes 'nekohtml', "httpclient"
>         export = false
>     }
> }
>
> I do a test-app and it works fine.
> When I do a run-app and then go back and try a test-app is when the error
> happens and httpbuilder(thus release) pulls the older version of httpclient
>
>



--
________________________________
ꜽ . antony jones . http://www.enzy.org

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Geb and Release plugin httpclient conflicts

Dean Del Ponte-2
I've had this problem as well.  Spent hours trying to get it to work and eventually decided not to use Geb.

I'll try it again a some point in the future to see if things have changed.

I hope some of the suggestions here work for you.

Dean

On Sat, Jan 14, 2012 at 8:17 PM, Antony Jones <[hidden email]> wrote:
I too have had this problem a number of times, most recently, yesterday.

Here's what I've done in the past (from memory, so there might be
slight tweaks you need to this method), but:

1. httpbuilder as a 'runtime' dependency
2. exclude httpclient, httpcore, xml-apis, and groovy as httpbuilder
dependencies.
3. include httpclient and httpcore (version 4.1.2) as 'provided' dependencies.

In fact, step 3 is the most important step of all. Essentially, you
should notice that httpclient/httpcore 4.0.x are brought in as
PROVIDED dependencies by org.grails.internal. What you need to do is
bring in httpclient/core version 4.1.2 as dependencies in that same
scope, and grails will automatically evict the earlier version from
that scope, even though they're brought in by grails itself.

You can easily evict any dependency you want by overriding it in the
same scope as it is brought in by.

For certainty, run grails clean, delete ~/.grails, and never allow any
plugins to be brought in by application.properties

Cheers,
Antony

On 14 January 2012 18:00, Sebastian Gozin <[hidden email]> wrote:
> I've had this problem as well.
> I tend to not install the release plugin at all and only install it when
> running my release build script in jenkins. Then not push the changes made
> to application.properties back to git so the release plugin remains
> uninstalled.
>
> It's hacky but at least it allows the build pipeline to work.
>
> On 14 Jan 2012, at 18:26, Josh (basejump) wrote:
>
> No matter what I do I can't seem to get Geb to work consistently as I can't
> get the version 4.0 httpclient to be excluded from the release.
> from the dependency report , It appears that httpbuilder which release
> depends on, is pulling the 4.0 httpclient even though I have in the excludes
> I get a
>
> java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.
>
> Here is the build config
>
> versions = [geb:"0.6.2", selenium:"2.16.1",
> spock:"0.6-SNAPSHOT",pluginConfig:"[0.1.5,)"]
> dependencies {
>   test "org.codehaus.geb:geb-spock:${versions.geb}",
>
>  "org.seleniumhq.selenium:selenium-htmlunit-driver:${versions.selenium}",
>          "org.apache.httpcomponents:httpclient:4.1.2",
>          "org.apache.httpcomponents:httpcore:4.1.3"
> }
>
> plugins {
>     test ":geb:${versions.geb}",":spock:${versions.spock}"
>     build(':release:1.0.1') {
>         excludes 'nekohtml', "httpclient"
>         export = false
>     }
> }
>
> I do a test-app and it works fine.
> When I do a run-app and then go back and try a test-app is when the error
> happens and httpbuilder(thus release) pulls the older version of httpclient
>
>



--
________________________________
ꜽ . antony jones . http://www.enzy.org

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

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Geb and Release plugin httpclient conflicts

basejump (Josh)
thanks for the help. I tweaked around a bit and found that the following works
(note: I think its less ugly to just comment out the release plugin until you need it)

def versions = [geb:"0.6.2", selenium:"2.16.1", spock:"0.6-SNAPSHOT"]
//for 1.3.7 versions = [geb:"0.6.0", selenium:"2.16.1", spock:"0.5-groovy-1.7"]   
dependencies {
    test "org.codehaus.geb:geb-spock:${versions.geb}"
        
    test("org.seleniumhq.selenium:selenium-htmlunit-driver:${versions.selenium}") {
        excludes "xml-apis"
    }
    
    provided("org.codehaus.groovy.modules.http-builder:http-builder:0.5.2"){
        export = false
        excludes 'nekohtml', "httpclient", "httpcore","xml-apis","groovy"
    }
    provided('net.sourceforge.nekohtml:nekohtml:1.9.15') { 
        export = false
        excludes "xml-apis" 
    }
}

plugins {
    test ":geb:${versions.geb}",":spock:${versions.spock}"
    
    build(':release:1.0.1') {
          excludes 'http-builder','nekohtml','svn'
          export = false
    }
    //this seems to prevent svn from being added to application properties
    build ":svn:1.0.2"

}


**other error key word for google
com.gargoylesoftware.htmlunit.ObjectInstantiationException: unable to create HTML parser

On Jan 15, 2012, at 2:13 PM, Dean Del Ponte wrote:

I've had this problem as well.  Spent hours trying to get it to work and eventually decided not to use Geb.

I'll try it again a some point in the future to see if things have changed.

I hope some of the suggestions here work for you.

Dean

On Sat, Jan 14, 2012 at 8:17 PM, Antony Jones <[hidden email]> wrote:
I too have had this problem a number of times, most recently, yesterday.

Here's what I've done in the past (from memory, so there might be
slight tweaks you need to this method), but:

1. httpbuilder as a 'runtime' dependency
2. exclude httpclient, httpcore, xml-apis, and groovy as httpbuilder
dependencies.
3. include httpclient and httpcore (version 4.1.2) as 'provided' dependencies.

In fact, step 3 is the most important step of all. Essentially, you
should notice that httpclient/httpcore 4.0.x are brought in as
PROVIDED dependencies by org.grails.internal. What you need to do is
bring in httpclient/core version 4.1.2 as dependencies in that same
scope, and grails will automatically evict the earlier version from
that scope, even though they're brought in by grails itself.

You can easily evict any dependency you want by overriding it in the
same scope as it is brought in by.

For certainty, run grails clean, delete ~/.grails, and never allow any
plugins to be brought in by application.properties

Cheers,
Antony

On 14 January 2012 18:00, Sebastian Gozin <[hidden email]> wrote:
> I've had this problem as well.
> I tend to not install the release plugin at all and only install it when
> running my release build script in jenkins. Then not push the changes made
> to application.properties back to git so the release plugin remains
> uninstalled.
>
> It's hacky but at least it allows the build pipeline to work.
>
> On 14 Jan 2012, at 18:26, Josh (basejump) wrote:
>
> No matter what I do I can't seem to get Geb to work consistently as I can't
> get the version 4.0 httpclient to be excluded from the release.
> from the dependency report , It appears that httpbuilder which release
> depends on, is pulling the 4.0 httpclient even though I have in the excludes
> I get a
>
> java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.
>
> Here is the build config
>
> versions = [geb:"0.6.2", selenium:"2.16.1",
> spock:"0.6-SNAPSHOT",pluginConfig:"[0.1.5,)"]
> dependencies {
>   test "org.codehaus.geb:geb-spock:${versions.geb}",
>
>  "org.seleniumhq.selenium:selenium-htmlunit-driver:${versions.selenium}",
>          "org.apache.httpcomponents:httpclient:4.1.2",
>          "org.apache.httpcomponents:httpcore:4.1.3"
> }
>
> plugins {
>     test ":geb:${versions.geb}",":spock:${versions.spock}"
>     build(':release:1.0.1') {
>         excludes 'nekohtml', "httpclient"
>         export = false
>     }
> }
>
> I do a test-app and it works fine.
> When I do a run-app and then go back and try a test-app is when the error
> happens and httpbuilder(thus release) pulls the older version of httpclient
>
>



--
________________________________
ꜽ . antony jones . http://www.enzy.org

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

   http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: Geb and Release plugin httpclient conflicts

pledbrook
> thanks for the help. I tweaked around a bit and found that the following
> works
> (note: I think its less ugly to just comment out the release plugin until
> you need it)

Is there a public project that I can play with to try this out?

Thanks,

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Geb and Release plugin httpclient conflicts

antony
Hi Peter,

Any project using Geb (test), Http Builder (runtime) and Release
(build) should expose this issue.

If you whacked a simple gsp and a geb test+dependency into
https://github.com/aiten/grails-sendgrid.git - then remove all the
excludes and export directives I reckon you'd have the same problem.

Cheers,
Antony

On 17 January 2012 12:16, Peter Ledbrook <[hidden email]> wrote:

>> thanks for the help. I tweaked around a bit and found that the following
>> works
>> (note: I think its less ugly to just comment out the release plugin until
>> you need it)
>
> Is there a public project that I can play with to try this out?
>
> Thanks,
>
> Peter
>
> --
> Peter Ledbrook
> Grails Advocate
> SpringSource - A Division of VMware
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>



--
________________________________
ꜽ . antony jones . http://www.enzy.org

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Geb and Release plugin httpclient conflicts

antony
Oh, and the firefox driver for selenium. That should be a good combo.

On 17 January 2012 15:42, Antony Jones <[hidden email]> wrote:

> Hi Peter,
>
> Any project using Geb (test), Http Builder (runtime) and Release
> (build) should expose this issue.
>
> If you whacked a simple gsp and a geb test+dependency into
> https://github.com/aiten/grails-sendgrid.git - then remove all the
> excludes and export directives I reckon you'd have the same problem.
>
> Cheers,
> Antony
>
> On 17 January 2012 12:16, Peter Ledbrook <[hidden email]> wrote:
>>> thanks for the help. I tweaked around a bit and found that the following
>>> works
>>> (note: I think its less ugly to just comment out the release plugin until
>>> you need it)
>>
>> Is there a public project that I can play with to try this out?
>>
>> Thanks,
>>
>> Peter
>>
>> --
>> Peter Ledbrook
>> Grails Advocate
>> SpringSource - A Division of VMware
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
>
>
> --
> ________________________________
> ꜽ . antony jones . http://www.enzy.org



--
________________________________
ꜽ . antony jones . http://www.enzy.org

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Geb and Release plugin httpclient conflicts

basejump (Josh)
In reply to this post by pledbrook
https://github.com/grails-plugins/grails-freemarker
1.0-prep branch

On Jan 17, 2012, at 6:16 AM, Peter Ledbrook wrote:

Is there a public project that I can play with to try this out?

Thanks,

Peter

Reply | Threaded
Open this post in threaded view
|

Re: Geb and Release plugin httpclient conflicts

pledbrook
> https://github.com/grails-plugins/grails-freemarker
> 1.0-prep branch

Thanks. Graeme is looking into this:

    http://jira.grails.org/browse/GRAILS-8643

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Geb and Release plugin httpclient conflicts

pledbrook
BTW Josh, 'svn' should be appearing in your plugin's
application.properties file. It has no impact on applications that
install your plugin, so it's safe to leave it there.

Hope that helps,

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Geb and Release plugin httpclient conflicts

basejump (Josh)
yeah, I know but for some weird reason it bothers me ;) its a condition called GCOCD (grails configuration obsessive compulsive disorder)


On Jan 18, 2012, at 6:59 AM, Peter Ledbrook wrote:

> BTW Josh, 'svn' should be appearing in your plugin's
> application.properties file. It has no impact on applications that
> install your plugin, so it's safe to leave it there.
>
> Hope that helps,
>
> Peter
>
> --
> Peter Ledbrook
> Grails Advocate
> SpringSource - A Division of VMware
>
> ---------------------------------------------------------------------
> 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
|

Re: Geb and Release plugin httpclient conflicts

basejump (Josh)
In reply to this post by pledbrook
any one else who feels the pain please go here and vote too
http://jira.codehaus.org/browse/GMOD-269

On Jan 18, 2012, at 3:13 AM, Peter Ledbrook wrote:

>> https://github.com/grails-plugins/grails-freemarker
>> 1.0-prep branch
>
> Thanks. Graeme is looking into this:
>
>    http://jira.grails.org/browse/GRAILS-8643
>
> Peter
>
> --
> Peter Ledbrook
> Grails Advocate
> SpringSource - A Division of VMware
>
> ---------------------------------------------------------------------
> 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
|

RE: Geb and Release plugin httpclient conflicts

bksaville
Actually I had already created a ticket for httpclient (not nekohtml
though):

http://jira.codehaus.org/browse/GMOD-262

Vote on both :)

-----Original Message-----
From: Josh (basejump) [mailto:[hidden email]]
Sent: Wednesday, January 18, 2012 7:53 AM
To: [hidden email]
Subject: Re: [grails-user] Geb and Release plugin httpclient conflicts

any one else who feels the pain please go here and vote too
http://jira.codehaus.org/browse/GMOD-269

On Jan 18, 2012, at 3:13 AM, Peter Ledbrook wrote:

>> https://github.com/grails-plugins/grails-freemarker
>> 1.0-prep branch
>
> Thanks. Graeme is looking into this:
>
>    http://jira.grails.org/browse/GRAILS-8643
>
> Peter
>
> --
> Peter Ledbrook
> Grails Advocate
> SpringSource - A Division of VMware
>
> ---------------------------------------------------------------------
> 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



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

    http://xircles.codehaus.org/manage_email