0

I have a dependency that has both a pom.xml and an ivy.xml. The pom.xml does not have the expected configuration, and when I compile, it seems to only use the pom.xml and yells about the missing conf. Is there a way to prefer ivy.xml? Maybe using a different resolver?

ivy.xml

<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">

  <info organisation="XYZ" module="MyModule" revision="LATEST" status="integration" publication="20150318194326"/>
  <configurations>
    <conf name="runtime" visibility="public" transitive="true" description="artifacts that might be used for a runtime environment"/>
    <conf name="sdk" visibility="public" extends="runtime" description="SDK jar"/>
  </configurations>

pom.xml

<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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>GROUPID</groupId>
  <artifactId>MyModule</artifactId>
  <packaging>jar</packaging>
  <version>LATEST</version>
  <description>this.jar was generated and published via an Ivy process, but given a POM file so as to be available to Maven builds</description>
  <dependencies>
    <dependency>
....

Being referenced from an ivy.xml Note the use of sdk

<dependency org="ORG" name="NAME" rev="latest" revConstraint="latest.integration" conf="*->sdk"/>
Justin Pihony
  • 66,056
  • 18
  • 147
  • 180
  • Example? Impossible to answer your question without more info. POM and IVY files are almost but not quite the same thing. Each supports a different dependency management technology. Unusual to see both stored together, since ivy understands how to read Maven repositories. – Mark O'Connor Mar 19 '15 at 19:39

1 Answers1

0

Ahha! You're using an ivy repository? (I bet you've forgotten to include another file called "settings.xml"?)

What's not clear to me is why the POM file would be read if you're using an ivy repository..... So I'll speculate that you have configured your build to use the ibiblio resolver when pulling down dependencies? This would explain why the "sdk" configuration is missing because ivy has a pre-set approach to translating Maven modules into ivy-speak.

For more information on how ivy interprets Maven repositories see:

How are maven scopes mapped to ivy configurations by ivy

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185