maven repository

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

maven repository

JerodLass
If I add a Maven2 repository resolver:

dependencies{
    addMavenRepo()
}

How can I configure my Maven proxy settings?  When I come up with a settings.xml file, where do I need to put it in order for gradle to grab and use it?  Thanks in advance for any help...

-Jerod
Reply | Threaded
Open this post in threaded view
|

Re: maven repository

hans_d
Administrator
Hi Jerod,

On Jun 3, 2008, at 8:50 PM, JerodLass wrote:

>
> If I add a Maven2 repository resolver:
>
> dependencies{
>     addMavenRepo()
> }
>
> How can I configure my Maven proxy settings?  When I come up with a
> settings.xml file, where do I need to put it?  Thanks in advance  
> for any
> help...

This time you don't have to worry that your question is not  
interesting ;) Gradle hasn't thought about proxies yet.

Could you try something like the following:

ant.setproxy(proxyhost: "host", proxyport="80", proxyuser="user",  
proxypassword="password")
dependencies {
    addMavenRepo()
}

Does it work?

- Hans


>
> -Jerod
> --
> View this message in context: http://www.nabble.com/maven- 
> repository-tp17630249p17630249.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
>
>

--
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: maven repository

JerodLass
In reply to this post by JerodLass
I tried:

ant.setproxy(proxyhost:"host", proxyport:"80")

along with some other configurations, and after a "the class org.apache.ant.taskdefs.optional.net.SetProxy was not found" error, I got a message about how Set Proxy there was no error, but a .jar from Ant's optional components is missing.  I looked into it a little and found some people saying setproxy uses ant-nodeps.jar and ant-optional.jar(after 1.5), but I have ant-nodeps.jar in my ant/lib folder.  Is there somewhere else I should put it or somewhere to map a new task?

Also, I've been building by executing the task libs just like in the user guide.  Do I have to do that in order for it to complete all of the build steps? How can I link in other tasks at certain times?

-Jerod

JerodLass wrote
If I add a Maven2 repository resolver:

dependencies{
    addMavenRepo()
}

How can I configure my Maven proxy settings?  When I come up with a settings.xml file, where do I need to put it in order for gradle to grab and use it?  Thanks in advance for any help...

-Jerod
Reply | Threaded
Open this post in threaded view
|

Re: maven repository

hans_d
Administrator
Hi Jerod,

On Jun 3, 2008, at 11:03 PM, JerodLass wrote:

>
> I tried:
>
> ant.setproxy(proxyhost:"host", proxyport:"80")
>
> along with some other configurations, and after a "the class
> org.apache.ant.taskdefs.optional.net.SetProxy was not found" error,  
> I got a
> message about how Set Proxy there was no error, but a .jar from Ant's
> optional components is missing.  I looked into it a little and  
> found some
> people saying setproxy uses ant-nodeps.jar and ant-optional.jar
> (after 1.5),
> but I have ant-nodeps.jar in my ant/lib folder.  Is there somewhere  
> else I
> should put it or somewhere to map a new task?
>
> -Jerod

Gradle ships with its own ant-jars (1.7.0). The Ant distributions  
installed on your machine are not used when running Gradle. The  
SetProxy task is contained in the ant-nodeps.jar which is  
unfortunately not shipped with Gradle.

To solve this problem with Gradle 0.1.4 you can do:

dependencies {
     addConfiguration('ant_nodeps')
     addMavenRepo()
     ant_nodeps "org.apache.ant:ant-nodeps:1.7.0"
}

ant {
     taskdef(name: "setproxy", classname:  
"org.apache.tools.ant.taskdefs.optional.net.SetProxy",
             classpath: dependencies.antpath('ant_nodeps'))
     setproxy(proxyhost: "host", proxyport: "80")
}

With 0.1.5, which is released within the next week, you will just  
have to do:

ant.setproxy(proxyhost: "host", proxyport: "80")

Thanks

- Hans


>
>
> JerodLass wrote:
>>
>> If I add a Maven2 repository resolver:
>>
>> dependencies{
>>     addMavenRepo()
>> }
>>
>> How can I configure my Maven proxy settings?  When I come up with a
>> settings.xml file, where do I need to put it in order for gradle  
>> to grab
>> and use it?  Thanks in advance for any help...
>>
>> -Jerod
>>
>
> --
> View this message in context: http://www.nabble.com/maven- 
> repository-tp17630249p17633643.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
>
>

--
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: maven repository

hans_d
Administrator

On Jun 4, 2008, at 8:25 AM, Hans Dockter wrote:

> Hi Jerod,
>
> On Jun 3, 2008, at 11:03 PM, JerodLass wrote:
>
>>
>> I tried:
>>
>> ant.setproxy(proxyhost:"host", proxyport:"80")
>>
>> along with some other configurations, and after a "the class
>> org.apache.ant.taskdefs.optional.net.SetProxy was not found"  
>> error, I got a
>> message about how Set Proxy there was no error, but a .jar from Ant's
>> optional components is missing.  I looked into it a little and  
>> found some
>> people saying setproxy uses ant-nodeps.jar and ant-optional.jar
>> (after 1.5),
>> but I have ant-nodeps.jar in my ant/lib folder.  Is there  
>> somewhere else I
>> should put it or somewhere to map a new task?
>>
>> -Jerod
>
> Gradle ships with its own ant-jars (1.7.0). The Ant distributions  
> installed on your machine are not used when running Gradle. The  
> SetProxy task is contained in the ant-nodeps.jar which is  
> unfortunately not shipped with Gradle.
>
> To solve this problem with Gradle 0.1.4 you can do:
>
> dependencies {
>     addConfiguration('ant_nodeps')
>     addMavenRepo()
>     ant_nodeps "org.apache.ant:ant-nodeps:1.7.0"
> }
>
> ant {
>     taskdef(name: "setproxy", classname:  
> "org.apache.tools.ant.taskdefs.optional.net.SetProxy",
>             classpath: dependencies.antpath('ant_nodeps'))
>     setproxy(proxyhost: "host", proxyport: "80")
> }
>
> With 0.1.5, which is released within the next week, you will just  
> have to do:
>
> ant.setproxy(proxyhost: "host", proxyport: "80")
>
> Thanks
>
> - Hans

We want to provide build-in proxy support in a future release. You  
can follow this via http://jira.codehaus.org/browse/GRADLE-99

- Hans

>
>
>>
>>
>> JerodLass wrote:
>>>
>>> If I add a Maven2 repository resolver:
>>>
>>> dependencies{
>>>     addMavenRepo()
>>> }
>>>
>>> How can I configure my Maven proxy settings?  When I come up with a
>>> settings.xml file, where do I need to put it in order for gradle  
>>> to grab
>>> and use it?  Thanks in advance for any help...
>>>
>>> -Jerod
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/maven- 
>> repository-tp17630249p17633643.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
>>
>>
>
> --
> Hans Dockter
> Gradle Project lead
> http://www.gradle.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

--
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: maven repository

JerodLass
In reply to this post by JerodLass
I tried that in a couple different orders, and it still times out.  Might it be timing out when it tries to get no_deps before setting the proxy?

Also, what about the libs task issue (back to uninteresting, I'm afraid): I've been building by executing the task libs just like in the user guide.  Do I have to do that in order for it to complete all of the build steps? How can I link in other tasks at certain times?

Thank you very much for your help

-Jerod


JerodLass wrote
If I add a Maven2 repository resolver:

dependencies{
    addMavenRepo()
}

How can I configure my Maven proxy settings?  When I come up with a settings.xml file, where do I need to put it in order for gradle to grab and use it?  Thanks in advance for any help...

-Jerod
Reply | Threaded
Open this post in threaded view
|

Re: maven repository

hans_d
Administrator

On Jun 4, 2008, at 3:21 PM, JerodLass wrote:

>
> I tried that in a couple different orders, and it still times out.  
> Might it
> be timing out when it tries to get no_deps before setting the proxy?

You are right.

What should help right is setting the proxy directly via Java system  
properties (which Java version are you using?):

See for example: http://info4tech.wordpress.com/2007/05/04/java-http- 
proxy-settings/

props = System.properties
props['http.proxyHost'] = 'host'
props['http.proxyPort'] =  '80'
props['http.proxyUser'] =  'uid'
props['http.proxyPassword'] =  'pw'

I'm not sure if this only works for Java 5.

>
> Also, what about the libs task issue (back to uninteresting, I'm  
> afraid):
> I've been building by executing the task libs just like in the user  
> guide.
> Do I have to do that in order for it to complete all of the build  
> steps? How
> can I link in other tasks at certain times?

When using usePlugin('java') the libs task gets created and  
associated with the other tasks.

'gradle libs' should therefore trigger a compile, test and building  
of the jars.

'gradle -t' shows you all the defined tasks and dependencies for your  
gradle project.

You can hook in custom tasks by something like: compile.dependsOn
('mytask')

If it does not work as expected please send your gradlefile.

- Hans

>
> Thank you very much for your help
>
> -Jerod
>
>
>
> JerodLass wrote:
>>
>> If I add a Maven2 repository resolver:
>>
>> dependencies{
>>     addMavenRepo()
>> }
>>
>> How can I configure my Maven proxy settings?  When I come up with a
>> settings.xml file, where do I need to put it in order for gradle  
>> to grab
>> and use it?  Thanks in advance for any help...
>>
>> -Jerod
>>
>
> --
> View this message in context: http://www.nabble.com/maven- 
> repository-tp17630249p17646604.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
>
>

--
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: maven repository

JerodLass
In reply to this post by JerodLass
It worked when I set the system props from the command line, which is fine until next week.  When I started playing with it to see how else I could do it (the cmd settings were what I tried first), it no longer left the network to grab them, even after a gradle clean, because it already had the hibernate (for example) .jar in what I assume is my local MavenRepo.  How can I wipe that out to try adjusting the proxy settings a different way?  Like I said, this will be perfect until 1.5, I was just curious because I'd be more comfortable setting proxy configurations in a more internal fashion.

Hooking in tasks worked perfectly.  I don't know how I didn't get that from the manual and I'm a little embarrassed now.  Anyway, thanks again.

-Jerod

JerodLass wrote
If I add a Maven2 repository resolver:

dependencies{
    addMavenRepo()
}

How can I configure my Maven proxy settings?  When I come up with a settings.xml file, where do I need to put it in order for gradle to grab and use it?  Thanks in advance for any help...

-Jerod
Reply | Threaded
Open this post in threaded view
|

Re: maven repository

hans_d
Administrator

On Jun 4, 2008, at 4:42 PM, JerodLass wrote:

>
> It worked when I set the system props from the command line, which  
> is fine
> until next week.  When I started playing with it to see how else I  
> could do
> it (the cmd settings were what I tried first), it no longer left  
> the network
> to grab them, even after a gradle clean, because it already had the
> hibernate (for example) .jar in what I assume is my local  
> MavenRepo.  How
> can I wipe that out to try adjusting the proxy settings a different  
> way?

Theoretically you find the cached jars in USER_HOME/.gradle/cache
But there is a bug in 0.1.4 (which is already fixed in svn) so that  
sometimes USER_HOME/.ivy2/cache is also used.
By removing either the whole cache directories or just the relevant  
subfolders you can have a fresh start.

- Hans

> Like I said, this will be perfect until 1.5, I was just curious  
> because I'd
> be more comfortable setting proxy configurations in a more internal  
> fashion.
>
> Also, hooking in tasks worked perfectly.  I don't know how I didn't  
> get that
> from the manual and I'm a little embarrassed now.  Anyway, thanks  
> again.
>
> -Jerod
>
>
> JerodLass wrote:
>>
>> If I add a Maven2 repository resolver:
>>
>> dependencies{
>>     addMavenRepo()
>> }
>>
>> How can I configure my Maven proxy settings?  When I come up with a
>> settings.xml file, where do I need to put it in order for gradle  
>> to grab
>> and use it?  Thanks in advance for any help...
>>
>> -Jerod
>>
>
> --
> View this message in context: http://www.nabble.com/maven- 
> repository-tp17630249p17648430.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
>
>

--
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: maven repository

JerodLass
That worked.  I stopped the command line settings and set the system properties in the gradle.settings file and it works well. Thanks!

-Jerod

hdockter wrote
On Jun 4, 2008, at 4:42 PM, JerodLass wrote:

>
> It worked when I set the system props from the command line, which  
> is fine
> until next week.  When I started playing with it to see how else I  
> could do
> it (the cmd settings were what I tried first), it no longer left  
> the network
> to grab them, even after a gradle clean, because it already had the
> hibernate (for example) .jar in what I assume is my local  
> MavenRepo.  How
> can I wipe that out to try adjusting the proxy settings a different  
> way?

Theoretically you find the cached jars in USER_HOME/.gradle/cache
But there is a bug in 0.1.4 (which is already fixed in svn) so that  
sometimes USER_HOME/.ivy2/cache is also used.
By removing either the whole cache directories or just the relevant  
subfolders you can have a fresh start.

- Hans

> Like I said, this will be perfect until 1.5, I was just curious  
> because I'd
> be more comfortable setting proxy configurations in a more internal  
> fashion.
>
> Also, hooking in tasks worked perfectly.  I don't know how I didn't  
> get that
> from the manual and I'm a little embarrassed now.  Anyway, thanks  
> again.
>
> -Jerod
>
>
> JerodLass wrote:
>>
>> If I add a Maven2 repository resolver:
>>
>> dependencies{
>>     addMavenRepo()
>> }
>>
>> How can I configure my Maven proxy settings?  When I come up with a
>> settings.xml file, where do I need to put it in order for gradle  
>> to grab
>> and use it?  Thanks in advance for any help...
>>
>> -Jerod
>>
>
> --
> View this message in context: http://www.nabble.com/maven- 
> repository-tp17630249p17648430.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
>
>

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





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

    http://xircles.codehaus.org/manage_email