Problem Retreiving Artifacts via maven and Ivy

Hi,

I am getting the below error when i run the maven build.


:: problems summary ::
:::: WARNINGS
 module not found: org#BuildID;lastSuccessful

 ==== teamcity-repo: tried

   https://host/guestAuth/repository/download/BuildID/lastSuccessful/teamcity-ivy.xml

   -- artifact org#BuildID;lastSuccessful!BuildID.jar:

   https://host/guestAuth/repository/download/BuildID/lastSuccessful/artifact.jar

 ::::::::::::::::::::::::::::::::::::::::::::::

 ::          UNRESOLVED DEPENDENCIES         ::

 ::::::::::::::::::::::::::::::::::::::::::::::

 :: org#BuildID;lastSuccessful: not found

 ::::::::::::::::::::::::::::::::::::::::::::::



:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.327s
[INFO] Finished at: Sat Nov 07 21:45:31 PST 2015
[INFO] Final Memory: 15M/36M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.goldin:ivy-maven-plugin:0.2.5:ivy (get-ivy-artifacts) on project sample: Execution get-ivy-artifacts of goal com.github.goldin:ivy-maven-plugin:0.2.5:ivy failed: Failed to resolve [file:/C:/Users/RMuthu/Desktop/2016Tests/sample/ivy.xml] dependencies: [org#BuildID;lastSuccessful]. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.goldin:ivy-maven-plugin:0.2.5:ivy (get-ivy-artifacts) on project sample: Execution get-ivy-artifacts of goal com.github.goldin:ivy-maven-plugin:0.2.5:ivy failed: Failed to resolve [file:/C:/Users/RMuthu/Desktop/2016Tests/sample/ivy.xml] dependencies: [org#BuildID;lastSuccessful].
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)

MY POM.xml is

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <modelVersion>4.0.0</modelVersion>

 <groupId>sample</groupId>
 <artifactId>sample</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 <packaging>jar</packaging>

 <name>sample</name>
 <url>http://maven.apache.org</url>

 <properties>
 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 </properties>

 <build>
 <testSourceDirectory>${basedir}/test</testSourceDirectory>
 <plugins>
 <plugin>
 <groupId>com.github.goldin</groupId>
 <artifactId>ivy-maven-plugin</artifactId>
 <version>0.2.5</version>
 <executions>
 <execution>
 <id>get-ivy-artifacts</id>
 <goals>
 <goal>ivy</goal>
 </goals>
 <phase>initialize</phase>
 <configuration>
 <ivyconf>${project.basedir}/ivyconf.xml</ivyconf>
 <ivy>${project.basedir}/ivy.xml</ivy>
 <dir>${project.basedir}/target</dir>
 <scope>compile</scope>
 </configuration>
 </execution>
 </executions>
 </plugin>
 </plugins>
 </build>
</project>


MY Ivy.xml is


<ivy-module version="1.3">
<info organisation="org" module="sample"/>
<dependencies>
<dependency org="org" name="BuildID" rev="lastSuccessful">
<include name="artifactName ext="jar" matcher="exactOrRegexp"/>
</dependency>
</dependencies>
</ivy-module>



MY IvConf.xml is


<ivysettings>
<settings defaultResolver="teamcity-repo"/>
<resolvers>
<url name="teamcity-repo" alwaysCheckExactRevision="yes" checkmodified="true">
<ivy pattern="https://host/guestAuth/repository/download/BuildID/lastSuccessful/teamcity-ivy.xml"/>
<artifact pattern="https://host/guestAuth/repository/download/BuildID/lastSuccessful/artifact.jar"/>
</url>
</resolvers>
<credentials host="hostname(google.com)"
realm="TeamCity"
username="usernamee" passwd="password" />
</ivysettings>



Please help me how to resolve this?
4 comments
Comment actions Permalink

Hello,

Did you specify the correct build configuration ID instead of "BuildID"?
See the related blog post: https://blog.jetbrains.com/teamcity/2012/06/teamcity-ivy-gradle-maven/.

0
Comment actions Permalink

Hi,

I created the build file based on the link( https://blog.jetbrains.com/teamcity/2012/06/teamcity-ivy-gradle-maven/) you provided.

When i tried the  url (http://host/guestAuth/repository/download/Build_ID/lastSuccessful/teamcity-ivy.xml) it asks for credentials and when i provide the credential,it shows the corresponding xml file.

when i tried the  url (http://host/guestAuth/repository/download/Build_ID/lastSuccessful/artifact.jar) it asks for credentials and when i provide the credential,it downloads the artifact.

Thanks.

0
Comment actions Permalink

Please try to enable guest user login on Administration > Authentication page.

0
Comment actions Permalink

Hi,

I am giving the user credential in ivyconf.xml and i want only that user can able to download my artifact not the anonymous user.

If i enable guest authentication then anyone can able to download my artifact.

Thanks,

0

Please sign in to leave a comment.