立即解析jar和dll

I am using Ivy for my Lib repository. I have created my own local repository that already contains several jars. These are resolved correctly.

Now I want to add a library that consists of a jar and a dll. How should I add these files to the repository and how can I make sure that both parts are resolved correctly?

#0

The best approach would be to write a custom ivy.xml in the repository for your dependency like:

ivy-1.0.0.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="http://www.jayasoft.fr/org/ivyrep/ivy-doc.xsl"?>
<ivy-module version="1.0">
    <info 
        organisation="myorg"
        module="depend"
        revision="1.0.0"
        status="release"
        publication="20110207120000"/>
    <configurations>
    <conf name="compile" visibility="public" />
    </configurations>
    <publications>
        <artifact name="jarfile"      type="jar" conf="compile"/>
        <artifact name="ddlfile"      type="dll" conf="compile"/>
    </publications>
</ivy-module>

This way you can easily retrieve all the artifacts as a dependency:

<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="myorg" module="project"/>
<configurations>
    <conf name="compile" visibility="public" />
</configurations>
<dependencies>
      <!-- COMPILE  -->
     <dependency org="myorg" name="depend" rev="1.0.0" conf="compile"/>
</dependencies>

</ivy-module> 

You could give the jar and the dll different configurations, if you need the dependencies at different stages in your build.

Alternatively you can specify the artifacts in the ivy.xml for your project like described here: http://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency-artifact.html