If you want to use your local maven packages in your app configured with ivy, you should add some lines to ivy.xml and ivysettings.xml. Below is an example.
ivysettings.xml
<property name="my.local.maven"
value="file:///${user.home}/.m2/repository/"
override="false"/>
ivy.xml
<dependency org="org.apache.giraph" name="giraph-core" rev="1.1.0-SNAPSHOT" conf="*->default"/>
<dependency org="org.apache.giraph" name="giraph-examples" rev="1.1.0-SNAPSHOT" conf="*->default"/>
<dependency org="org.apache.giraph" name="giraph-hbase" rev="1.1.0-SNAPSHOT" conf="*->default"/>
<dependency org="org.apache.hbase" name="hbase" rev="0.90.5" conf="*->default"/>
Showing posts with label ivy. Show all posts
Showing posts with label ivy. Show all posts
Monday, July 8, 2013
Friday, June 28, 2013
Adding external libraries (jar files) to an ivy project (Nutch)
I wanted to use my Apache Giraph fork in Apache Nutch 2.1. The Problem was that Giraph used mvn and Nutch used ivy. Although Nutch could fetch jar files from maven repositories, my customized jars are in none of those repos. So I had to find a way to use my local jars.
Add the following line to ivysettings.xml of Nutch:
Add the following lines to ivy.xml of Nutch:
Now create put jar files under .ivy2 subfolders:
Add the following line to ivysettings.xml of Nutch:
<module organisation="org.apache.giraph" name=".*" resolver="internal"/>
Add the following lines to ivy.xml of Nutch:
<dependency org="org.apache.giraph" name="giraph" rev="1.1.0-SNAPSHOT"
conf="*->default" />
<dependency org="org.apache.giraph" name="giraph-hbase" rev="1.1.0-SNAPSHOT"
conf="*->default" />
<dependency org="org.apache.giraph" name="giraph-examples" rev="1.1.0-SNAPSHOT"
conf="*->default" />
Now create put jar files under .ivy2 subfolders:
/home/emre/.ivy2/local/org.apache.giraph/giraph/1.1.0-SNAPSHOT/jars/giraph.jar/home/emre/.ivy2/local/org.apache.giraph/giraph-hbase/1.1.0-SNAPSHOT/jars/giraph-hbase.jar/home/emre/.ivy2/local/org.apache.giraph/giraph-examples/1.1.0-SNAPSHOT/jars/giraph-examples.jar
Now when you run ant runtime and start a crawling, you will see that your local jar files are binded to your app:
SLF4J: Found binding in [jar:file:/home/emre/tmp/apache-nutch-2.1/runtime/local/lib/giraph-1.1.0-SNAPSHOT.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/emre/tmp/apache-nutch-2.1/runtime/local/lib/giraph-examples-1.1.0-SNAPSHOT.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/emre/tmp/apache-nutch-2.1/runtime/local/lib/giraph-hbase-1.1.0-SNAPSHOT.jar!/org/slf4j/impl/StaticLoggerBinder.class]
Subscribe to:
Posts (Atom)