Hi All,

My apologies for another newbie question.

I have a number of external JAR files that my project relies on. These jars are not in any Ivy repositories that I am aware of - I just download them.

I'm trying to publish/install them into my local Ivy repository, and I'm getting errors.

My understanding is that <ivy:deliver> generates the repo metadata for an artifact. Yet I keep getting errors telling me that Ivy can't find the metadata in my cache, or in a repository.

The ant file I'm using is here:

<?xml version="1.0" ?>

<project name="master-repo" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant" >

 <property file="/home/ivy/master-repo.properties" />

 <ivy:settings id="master-repo" file="/home/ivy/master-repo.xml" />

 <target name="downloads"
  description="--> install library jars from local dir" >
          <ivy:resolve file="/home/ivy/downloads/smslib.xml" />
<ivy:publish resolver="master-repo" organisation="smslib" module="smslib" revision="3.0.2" artifactspattern="/home.ivy/downloads/smslib-3.0.2.jar" pubrevision="3.0.2" forcedeliver="true" />

<!-- <ivy:resolve inline="true" organisation="smslib" module="smslib" revision="3.0.2" /> <ivy :publish resolver="master-repo" organisation="smslib" module="smslib" revision="3.0.2" artifactspattern="/home/ivy/downloads/smslib-3.0.2.jar" pubrevision="3.0.2" forcedeliver="true" /> -->

 </target>
   <target name="publish"
     description="--> publish artifacts to next level up" >
 </target>

</project>

Here is the minimalist ivy.xml file for the module:

<ivy-module version="1.0">
<info organisation="smslib" module="smslib" status="integration">
</info>
<configurations>
  <conf name="default" />
</configurations>

<publications>
  <artifact name="smslib" type="jar" />
</publications>

<dependencies >
</dependencies>
</ivy-module>

And here is the output I get when I try to install the jar.

[...@nik ivy]$ ant downloads
Buildfile: build.xml

downloads:
No ivy:settings found for the default reference 'ivy.instance'. A default instance will be used
no settings file found, using default...
[ivy:resolve] :: Ivy 2.1.0-rc1 - 20090319213629 :: http://ant.apache.org/ivy/ :: :: loading settings :: url = jar:file:/usr/local/apache-ivy/ivy-2.1.0-rc1.jar!/org/apache/ivy/core/settings/ivysettings.xml [ivy:resolve] :: resolving dependencies :: smslib#smslib;[email protected]
[ivy:resolve]     confs: [default]
[ivy:resolve] :: resolution report :: resolve 41ms :: artifacts dl 1ms
  ---------------------------------------------------------------------
  |                  |            modules            ||   artifacts   |
  |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
  ---------------------------------------------------------------------
  |      default     |   0   |   0   |   0   |   0   ||   0   |   0   |
  ---------------------------------------------------------------------
:: delivering :: smslib#smslib;3.0.2 :: 3.0.2 :: integration :: Tue Apr 28 15:37:47 EST 2009

BUILD FAILED
/home/ivy/build.xml:26: smslib#smslib;3.0.2: java.lang.IllegalStateException: ivy file not found in cache for smslib#smslib;3.0.2: please resolve dependencies before delivering (/home/nik/.ivy2/cache/resolved-smslib-smslib-3.0.2.xml)

Total time: 0 seconds

================

If I comment out the top ivy:resolve and ivy:publish pair, and uncomment the bottom two so that I'm using the inline resolve, I get the following:

[...@nik ivy]$ ant downloads
Buildfile: build.xml

downloads:
No ivy:settings found for the default reference 'ivy.instance'. A default instance will be used
no settings file found, using default...
[ivy:resolve] :: Ivy 2.1.0-rc1 - 20090319213629 :: http://ant.apache.org/ivy/ :: :: loading settings :: url = jar:file:/usr/local/apache-ivy/ivy-2.1.0-rc1.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:resolve]
[ivy:resolve] :: problems summary ::
[ivy:resolve] :::: WARNINGS
[ivy:resolve]         module not found: smslib#smslib;3.0.2
[ivy:resolve]     ==== local: tried
[ivy:resolve]       /home/nik/.ivy2/local/smslib/smslib/3.0.2/ivys/ivy.xml
[ivy:resolve]       -- artifact smslib#smslib;3.0.2!smslib.jar:
[ivy:resolve] /home/nik/.ivy2/local/smslib/smslib/3.0.2/jars/smslib.jar
[ivy:resolve]     ==== shared: tried
[ivy:resolve]       /home/nik/.ivy2/shared/smslib/smslib/3.0.2/ivys/ivy.xml
[ivy:resolve]       -- artifact smslib#smslib;3.0.2!smslib.jar:
[ivy:resolve] /home/nik/.ivy2/shared/smslib/smslib/3.0.2/jars/smslib.jar
[ivy:resolve]     ==== public: tried
[ivy:resolve] http://repo1.maven.org/maven2/smslib/smslib/3.0.2/smslib-3.0.2.pom
[ivy:resolve]       -- artifact smslib#smslib;3.0.2!smslib.jar:
[ivy:resolve] http://repo1.maven.org/maven2/smslib/smslib/3.0.2/smslib-3.0.2.jar
[ivy:resolve]         ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve]         ::          UNRESOLVED DEPENDENCIES         ::
[ivy:resolve]         ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve]         :: smslib#smslib;3.0.2: not found
[ivy:resolve]         ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve]
[ivy:resolve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS

BUILD FAILED
/home/ivy/build.xml:27: impossible to resolve dependencies:
  resolve failed - see output for details

Total time: 1 second


Which makes even less sense to me. It seems that it somehow breaks my configuration of my local repos.

Q: The ivy.xml file I am using is based on that from a local project which works. What am I doing wrong? Q: I would actually prefer to use inline resolution, yet trying to do that seems to break my local configuration. What did I do wrong in there?

All pointers or suggestions welcome!

Cheers!
Nik

Reply via email to