Problems Retrieving artifacts via ANT IVY

Hello,

I need to use ant to retrieve latest artifacts from projects (am using TeamCity 4.5.4 (build 9071)).

The artifact dependency etc works fine when using web UI.

When using ant command, I get following error:



:: problems summary ::
[ivy:retrieve] :::: WARNINGS
[ivy:retrieve]  module not found: gaia.cu7#bt21;13
[ivy:retrieve]  ==== teamcity-rep: tried
[ivy:retrieve]    http://host/teamcity/httpAuth/repository/download/bt21/13/teamcity-ivy.xml
[ivy:retrieve]    -- artifact org#bt21;13!ObjectModel.jar:
[ivy:retrieve]    http://host/teamcity/httpAuth/repository/download/bt21/13/ObjectModel.jar
[ivy:retrieve]  ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]  ::          UNRESOLVED DEPENDENCIES         ::
[ivy:retrieve]  ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]  :: org#bt21;13: not found
[ivy:retrieve]  ::::::::::::::::::::::::::::::::::::::::::::::



where as when  access the URLs http://host/teamcity/httpAuth/repository/download/bt21/13/ObjectModel.jar , http://host/teamcity/httpAuth/repository/download/bt21/13/teamcity-ivy.xml

I am able to get the jar as well as ivy xml file.



The start of IVY XML file is follows:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.4">
  <info organisation="org" module="bt21" revision="13" />
  <publications>
    <artifact name="ObjectModel" type="jar" ext="jar" />

My ant targets looks like:

<target name="fetch" description="Retrieves artifacts for TeamCity" xmlns:ivy="antlib:fr.jayasoft.ivy.ant">

         <taskdef uri="antlib:fr.jayasoft.ivy.ant"

                   resource="fr/jayasoft/ivy/ant/antlib.xml">

           <classpath>

             <pathelement location="${ANT_HOME}/lib/org.apache.ivy_2.1.0.jar"/>

             <pathelement location="${ANT_HOME}/lib/commons-httpclient-3.1.jar"/>

             <pathelement location="${ANT_HOME}/lib/commons-logging.jar"/>

             <pathelement location="${ANT_HOME}/lib/commons-codec-1.2.jar"/>

           </classpath>

         </taskdef>

          <ivy:configure file="${basedir}/ivyconf.xml"

                           host="http://host/teamcity"

                           realm="TeamCity"

                           username="user"

                           passwd="pass"

                           override="true" />

         <ivy:retrieve pattern="${basedir}/[artifact].[ext]" />

       </target>


thanks
4 comments
Comment actions Permalink

Hello

on running ant with debug, I see following error message:

Dec 15, 2009 12:00:03 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded
[ivy:retrieve] INFO: Authentication requested but doAuthentication is disabled



where as in the configure task, I am specifying the username and password etc. How do I set IVY to use authentication ?


thanks
0
Comment actions Permalink

You should specify hostname in host attribute of ivy:configure task, not URL.

0
Comment actions Permalink

Hi Pavel

yes I had corrected that as well, though results is the same. The teamcity instance is running behind an apache server, could that be the problem ? Though once I use the same URL in a browser, I am presented the authentication dialog and then the artifact downloads.


e.g

don't use cache for org#bt21;13: checkModified=true
[ivy:retrieve]   trying http://host/teamcity/httpAuth/repository/download/bt21/13/teamcity-ivy.xml
[ivy:retrieve]  tried http://host/teamcity/httpAuth/repository/download/bt21/13/teamcity-ivy.xml
[ivy:retrieve] Dec 17, 2009 11:30:03 AM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded
[ivy:retrieve] INFO: Authentication requested but doAuthentication is disabled
[ivy:retrieve] HTTP response status: 401 url=http://host/teamcity/httpAuth/repository/download/bt21/13/teamcity-ivy.xml
[ivy:retrieve] CLIENT ERROR: Unauthorized url=http://host/teamcity/httpAuth/repository/download/bt21/13/teamcity-ivy.xml
[ivy:retrieve]  teamcity-rep: resource not reachable for org#bt21;13: res=http://host/teamcity/httpAuth/repository/download/bt21/13/teamcity-ivy.xml
[ivy:retrieve]   trying http://host/teamcity/httpAuth/repository/download/bt21/13/ObjectModel.jar
[ivy:retrieve]  tried http://host/teamcity/httpAuth/repository/download/bt21/13/ObjectModel.jar
[ivy:retrieve] Dec 17, 2009 11:30:03 AM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded
[ivy:retrieve] INFO: Authentication requested but doAuthentication is disabled

my configure task is now

<ivy:configure override="true" file="${basedir}/ivyconf.xml"
   host="http://host" realm="TeamCity" username="uname" passwd="passwd" />      

thanks a lot

0
Comment actions Permalink

Please omit http:// prefix, use hostname only.

0

Please sign in to leave a comment.