Note that there are some explanatory texts on larger screens.

plurals
  1. POPublish a Maven artifact to a local Ivy repository, recursively with its dependencies
    primarykey
    data
    text
    <p>I have to mirror a set of dependencies to my company-local Ivy repository.</p> <p>I currently need to publish <code>Hibernate Spatial 4.0-M1</code>. From my Eclipse project, I can only resolve Ivy dependencies if I enable remote repository <code>&lt;ibiblio name="hibernate-spatial" m2compatible="true" root="http://www.hibernatespatial.org/repository"/&gt;</code> (and exclude a few dependencies from <code>dependencies.xml</code>), which other developers don't have as they retrieve only from LAN.</p> <p>So I ended up putting the JAR into the publish directory, convert the HS official POM to Ivy using a proper Ant task and I ended up with the following <code>dependencies.xml</code></p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;ivy-module version="1.0" xmlns:m="http://ant.apache.org/ivy/maven"&gt; &lt;info organisation="org.hibernate" module="hibernate-spatial" revision="4.0-M1" status="release" publication="20130904175525" &gt; &lt;description homepage="" /&gt; &lt;/info&gt; &lt;configurations&gt; &lt;conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/&gt; &lt;conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/&gt; &lt;conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/&gt; &lt;conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/&gt; &lt;conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/&gt; &lt;conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/&gt; &lt;conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/&gt; &lt;conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/&gt; &lt;conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/&gt; &lt;conf name="optional" visibility="public" description="contains all optional dependencies"/&gt; &lt;/configurations&gt; &lt;publications&gt; &lt;artifact name="hibernate-spatial" type="jar" ext="jar" conf="compile"/&gt; &lt;/publications&gt; &lt;dependencies&gt; &lt;dependency org="jaxen" name="jaxen" rev="1.1" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;dependency org="junit" name="junit" rev="4.8.2" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;dependency org="commons-logging" name="commons-logging-api" rev="99.0-does-not-exist" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.1" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;dependency org="postgresql" name="postgresql" rev="8.4-701.jdbc4" force="true" conf="compile-&gt;compile(*),master(*);runtime-&gt;runtime(*)"/&gt; &lt;dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.1" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;dependency org="javax.validation" name="validation-api" rev="1.0.0.GA" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;dependency org="dom4j" name="dom4j" rev="1.6.1" force="true" conf="compile-&gt;compile(*),master(*);runtime-&gt;runtime(*)"/&gt; &lt;!--&lt;dependency org="org.postgis" name="postgis-jdbc" rev="1.5.3" force="true" conf="compile-&gt;compile(*),master(*);runtime-&gt;runtime(*)"/&gt;--&gt; &lt;dependency org="org.hibernate" name="hibernate-validator" rev="4.2.0.Final" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;dependency org="org.slf4j" name="slf4j-api" rev="1.6.1" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;dependency org="commons-dbcp" name="commons-dbcp" rev="1.4" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;!--&lt;dependency org="org.jboss.logging" name="jboss-logging" rev="3.1.0.CR2" force="true" conf="compile-&gt;compile(*),master(*);runtime-&gt;runtime(*)"/&gt;--&gt; &lt;dependency org="com.fasterxml" name="classmate" rev="0.5.4" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;dependency org="commons-logging" name="commons-logging" rev="99.0-does-not-exist" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;dependency org="org.jboss" name="jandex" rev="1.0.3.Final" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;dependency org="org.hibernate" name="hibernate-core" rev="4.0.0.Final" force="true" conf="compile-&gt;compile(*),master(*);runtime-&gt;runtime(*)"/&gt; &lt;dependency org="org.hibernate" name="hibernate-testing" rev="4.0.0.Final" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;dependency org="com.vividsolutions" name="jts" rev="1.12" force="true" conf="compile-&gt;compile(*),master(*);runtime-&gt;runtime(*)"/&gt; &lt;dependency org="com.h2database" name="h2" rev="1.2.145" force="true" conf="test-&gt;runtime(*),master(*)"/&gt; &lt;!--&lt;dependency org="javassist" name="javassist" rev="3.12.1.GA" force="true" conf="test-&gt;runtime(*),master(*)"/&gt;--&gt; &lt;/dependencies&gt; &lt;/ivy-module&gt; </code></pre> <p>I run the following Ant task:</p> <pre><code>&lt;target name="ivy-local-release" depends="ivy-config" description="Locally publish a file"&gt; &lt;ivy:resolve /&gt; &lt;ivy:publish artifactspattern="${ivy.install.dir}/publish/[artifact]-[revision].[ext]" resolver="local" status="release" overwrite="true" /&gt; &lt;/target&gt; </code></pre> <p>and I get the following output:</p> <pre><code>ivy-config: [ivy:configure] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ :: [ivy:configure] :: loading settings :: file = C:\Program Files (x86)\Ivy\ivy-settings.xml ivy-local-release: [ivy:resolve] :: resolving dependencies :: org.hibernate#hibernate-spatial;4.0-M1 [ivy:resolve] confs: [default, master, compile, provided, runtime, test, system, sources, javadoc, optional] [ivy:resolve] found postgresql#postgresql;8.4-701.jdbc4 in maven2 [ivy:resolve] found dom4j#dom4j;1.6.1 in local [ivy:resolve] found xml-apis#xml-apis;1.0.b2 in maven2 [ivy:resolve] found org.hibernate#hibernate-core;4.0.0.Final in maven2 [ivy:resolve] found commons-collections#commons-collections;3.2.1 in local [ivy:resolve] found antlr#antlr;2.7.7 in local [ivy:resolve] found org.jboss.spec.javax.transaction#jboss-transaction-api_1.1_spec;1.0.0.Final in local [ivy:resolve] found org.hibernate.javax.persistence#hibernate-jpa-2.0-api;1.0.1.Final in maven2 [ivy:resolve] found org.jboss.logging#jboss-logging;3.1.0.CR2 in maven2 [...] [ivy:resolve] ==== jboss: tried [ivy:resolve] https://repository.jboss.org/nexus/content/repositories/releases/gnu-getopt/getopt/1.0.13/getopt-1.0.13.pom [ivy:resolve] -- artifact gnu-getopt#getopt;1.0.13!getopt.jar: [ivy:resolve] https://repository.jboss.org/nexus/content/repositories/releases/gnu-getopt/getopt/1.0.13/getopt-1.0.13.jar [ivy:resolve] ==== shared: tried [ivy:resolve] R:/repository/gnu-getopt/getopt/1.0.13/ivys/ivy.xml [ivy:resolve] -- artifact gnu-getopt#getopt;1.0.13!getopt.jar: [ivy:resolve] R:/repository/gnu-getopt/getopt/1.0.13/jars/getopt.jar [ivy:resolve] :::::::::::::::::::::::::::::::::::::::::::::: [ivy:resolve] :: UNRESOLVED DEPENDENCIES :: [ivy:resolve] :::::::::::::::::::::::::::::::::::::::::::::: [ivy:resolve] :: commons-logging#commons-logging-api;99.0-does-not-exist: not found [ivy:resolve] :: commons-logging#commons-logging;99.0-does-not-exist: not found [ivy:resolve] :: commons-httpclient#commons-httpclient;3.1-jbossorg-1: not found [ivy:resolve] :: org.hornetq#hornetq-core;working@antonioanzivino: not found [ivy:resolve] :: org.jboss.netty#netty;working@antonioanzivino: not found [ivy:resolve] :: jacorb#jacorb;2.3.1jboss.patch01-brew: not found [ivy:resolve] :: jacorb#idl;2.3.1jboss.patch01-brew: not found [ivy:resolve] :: org.jboss.logmanager#jboss-logmanager;working@antonioanzivino: not found [ivy:resolve] :: org.jboss.integration#jboss-transaction-spi;working@antonioanzivino: not found [ivy:resolve] :: org.jboss.spec.javax.ejb#jboss-ejb-api_3.1_spec;working@antonioanzivino: not found [ivy:resolve] :: org.jboss.spec.javax.servlet#jboss-servlet-api_3.0_spec;working@antonioanzivino: not found [ivy:resolve] :: ${project.parent.groupId}#jboss-logging-generator;1.0.0.Beta6: not found [ivy:resolve] :: org.jboss.ws#jbossws-api;1.0.0-SNAPSHOT: not found [ivy:resolve] :: gnu-getopt#getopt;1.0.13: not found [ivy:resolve] :::::::::::::::::::::::::::::::::::::::::::::: [ivy:resolve] [ivy:resolve] [ivy:resolve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS BUILD FAILED </code></pre> <p>I use the following resolver configuration in my <code>ivy-settings.xml</code></p> <pre><code> &lt;resolvers&gt; &lt;filesystem name="shared" &gt; &lt;ivy pattern="${ivy.shared.default.root}/${ivy.shared.default.ivy.pattern}" /&gt; &lt;artifact pattern="${ivy.shared.default.root}/${ivy.shared.default.artifact.pattern}" /&gt; &lt;/filesystem&gt; &lt;ibiblio name="maven2" m2compatible="true"/&gt; &lt;ibiblio name="geotools" m2compatible="true" root="http://download.osgeo.org/webdav/geotools"/&gt; &lt;ibiblio name="hibernate-spatial" m2compatible="true" root="http://www.hibernatespatial.org/repository"/&gt; &lt;ibiblio name="jboss" m2compatible="true" root="https://repository.jboss.org/nexus/content/repositories/releases/"/&gt; &lt;ibiblio name="mavenjava" m2compatible="true" root="http://download.java.net/maven/2" /&gt; &lt;/resolvers&gt; &lt;resolvers&gt; &lt;chain name="default" returnFirst="false"&gt; &lt;resolver ref="local" /&gt; &lt;resolver ref="maven2" /&gt; &lt;resolver ref="geotools" /&gt; &lt;resolver ref="hibernate-spatial" /&gt; &lt;resolver ref="jboss" /&gt; &lt;resolver ref="shared" /&gt; &lt;/chain&gt; &lt;/resolvers&gt; </code></pre> <p>The strange is that I can resolve all dependencies when I run <code>ivy:resolve</code> on my local project.</p> <p>I would like to recursively publish dependencies on local Ivy repository when I publish a new artifact. How to do that?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload