Description
I'm making use of parent definition in ivy files to define general dependencies and configuration across projects.
Parent file is typically something like:
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd" xmlns:m="http://ant.apache.org/ivy/maven"> <info organisation="com.mycompany" module="parent" revision="1.0" status="release" publication="20120101020304"> </info> <configurations> <conf name="default" description="Default dependencies"/> <conf name="runtime" description="Only runtime" extends="default" visibility="private"/> <conf name="test" description="Only for unit testing" extends="compile,runtime" visibility="private"/> <conf name="compile" description="Only for compilation" extends="default" visibility="private"/> <conf name="sources" description="Sources"/> <conf name="javadoc" description="Javadoc"/> </configurations> <dependencies> <dependency org="org.testng" name="testng" rev="6.4" conf="test->default"/> </dependencies> </ivy-module>
Ivy file for the project is typically:
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd" xmlns:m="http://ant.apache.org/ivy/maven"> <info organisation="com.mycompany.service" module="${project.name}"> <extends organisation="com.mycompany" module="parent" revision="${ivy.parent.revision}" location="${ivy.parent.location}"/> </info> <publications> <artifact name="${project.name}" type="jar" ext="jar" conf="default"/> <artifact name="${project.name}" type="source" ext="jar" conf="sources" m:classifier="sources"/> <artifact name="${project.name}" type="javadoc" ext="jar" conf="javadoc" m:classifier="javadoc"/> </publications> <dependencies> <dependency org="org.jackson" name="jackson" rev="1.9.5" conf="default"/> <exclude org="javax.servlet" module="servlet-api"/> <exclude org="javax.servlet" module="servlet"/> </dependencies> </ivy-module>
The result end up being a merge which is incompatible with the schema since dependency and exclude end up being mixed when the file is delivered:
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd" xmlns:m="http://ant.apache.org/ivy/maven"> <info organisation="com.mycompany.service" module="myproject" revision="1.2.8.20120604181037" status="development" publication="20120604141056"> <!-- <extends organisation="com.mycompany" module="parent" revision="1.0.0" location="/somewhere/ivy-parent.xml"/> --> </info> <configurations> <!-- configurations inherited from com.mycompany#parent;1.0.0 --> <conf name="default" visibility="public" description="Default dependencies"/> <conf name="runtime" visibility="private" description="Only runtime" extends="default"/> <conf name="test" visibility="private" description="Only for unit testing" extends="compile,runtime"/> <conf name="compile" visibility="private" description="Only for compilation" extends="default"/> <conf name="sources" visibility="public" description="Sources"/> <conf name="javadoc" visibility="public" description="Javadoc"/> </configurations> <publications> <artifact name="myproject" type="jar" ext="jar" conf="default"/> <artifact name="myproject" type="source" ext="jar" conf="sources" m:classifier="sources"/> <artifact name="myproject" type="javadoc" ext="jar" conf="javadoc" m:classifier="javadoc"/> </publications> <dependencies> <dependency org="org.codehaus" name="jackson" rev="1.9.5" conf="default"/> <exclude org="javax.servlet" module="servlet-api"/> <exclude org="javax.servlet" module="servlet"/> <!-- dependencies inherited from com.mycompany#parent;1.0.0 --> <dependency org="org.testng" name="testng" rev="6.4" conf="test->default"/> conf="default->api;newrelic->default"/> </dependencies> </ivy-module>