Matthew Campbell
Matthew Campbell

Reputation: 1884

Ivy resolving POM dependency where version comes from POM parent

Using Ivy 2.2 and IvyDE 2.2 from Eclipse (Helios)....

Want to pull in the spring-data-neo4j and it's default dependencies from: http://maven.springframework.org/milestone/org/springframework/data/spring-data-neo4j/2.1.0.M1

Using the following in my Ivy file:

<dependency org="org.springframework.data" name="spring-data-neo4j" rev="2.1.0.M1"/>

and these resolvers in my settings file:

<!-- Maven springframework data milestones -->
<url name="maven.springframework.data.milestone">
  <ivy pattern="http://maven.springframework.org/milestone/org/springframework/data/[module]/[revision]/[artifact]-[revision].[ext]" />
  <artifact pattern="http://maven.springframework.org/milestone/org/springframework/data/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>

<!-- Maven springframework milestones -->
<url name="maven.springframework.data.milestone">
  <ivy pattern="http://maven.springframework.org/milestone/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
  <artifact pattern="http://maven.springframework.org/milestone/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>

Only the spring-data-neo4j artifact is pulled down no mention of the parent in the Ivy console (debug level). Looked at the suggestion at: http://theholyjava.wordpress.com/2011/01/26/using-ivy-with-pom-xml/

but get the feeling this is only for relative paths that aren't accessible via the normal resolvers. Looked at the PomModuleDescriptorParser code and if the parent module is null then all information it might have (like revision info) is discarded:

 if (parentDescr != null) {
   for (int i = 0; i < parentDescr.getDependencies().length; i++) {
     mdBuilder.addDependency(parentDescr.getDependencies()[i]);
   }
 }

If this is the case: (1) how do I see more in the logs and (2) get the parseOtherPom method to return the parent?

thanks in advance - Matthew

Upvotes: 0

Views: 1404

Answers (1)

Mark O&#39;Connor
Mark O&#39;Connor

Reputation: 77951

Try the following ivysettings.xml file:

<ivysettings>
    <settings defaultResolver="maven-repos"/>
    <resolvers>
        <chain name="maven-repos">
            <ibiblio name="central" m2compatible="true"/>
            <ibiblio name="spring-milestone" m2compatible="true" root="http://maven.springframework.org/milestone"/>
        </chain>
    </resolvers>
</ivysettings>

The ibiblio resolver is the best way to configure a Maven repository.

Upvotes: 1

Related Questions