2009-03-26 4 views
3

Wenn meine ivysettings.xml-Datei enthält:Wie löst Apache Ivy die Variablen in Artefaktmustern auf, die in der Datei ivysettings.xml enthalten sind?

<url name="com.springsource.repository.bundles.external"> 
    <ivy pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> 
    <artifact pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> 
</url> 

Und meine ivy.xml-Datei enthält:

<dependency org="org.junit" 
      name="com.springsource.org.junit" 
      rev="4.4.0" /> 

aus, wenn ich Ivy lief, kann ich sagen, dass dies löst: http://repository.springsource.com/ivy/bundles/external/org.junit/com.springsource.org.junit/4.4.0/com.springsource.org.junit-sources-4.4.0.jar

So gehen die Auflösungen:

[organization] => "org.junit" 
[module] => "com.springsource.org.junit" 
[revision] => "4.4.0" 
[artifact] => "com.springsource.org.junit-sources" 
[ext] => "jar" 

Ich sehe wie efeu die [organisation], [modul] und [revision] im URL-Muster (duh) auflöst, aber wie löst es [artifact] und [ext] auf?

Die documentation on the URL resolver scheint zu fehlen.

Antwort

6

Ivy löst zuerst die <ivy pattern... />, die mit der Organisation, Modul und Revision gegeben und mit den [artifact] als „Efeu“ einprogrammiert und [ext] wie „xml“ einprogrammiert. Dies ergibt eine URL, in diesem Fall:

http://repository.springsource.com/ivy/bundles/external/org.junit/com.springsource.org.junit/4.4.0/ivy-4.4.0.xml

Dies ist die Efeu-Konfigurationsdatei für dieses Modul. Unter anderem enthält diese Efeu Konfigurationsdatei Informationen über andere Artefakte, insbesondere:

<artifact name="com.springsource.org.junit-sources" type="src" ext="jar"/> 
<artifact name="license" type="license" ext="txt"/> 

Diese beide sind dann den <artifact pattern... /> Teil abzuschließen verwendet - die Lizenz zum Herunterladen und die JAR-Datei zum Download bereit.

Verwandte Themen