ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Troy Self" <ts...@bbn.com>
Subject RE: Publishing 3rd party libraries to local repo
Date Mon, 05 Oct 2009 18:15:56 GMT
Thank you for the quick response. Follow-ups in-line:

> The most common thing I've seen people do to create third-party Ivy modules
> from scratch is to effectively blur the line between a source Ivy module
> and
> a published Ivy module. So instead of running the ivy:publish Ant task to
> publish the Ivy module to the repository, they would manually add it. This
> means going into the ivy.xml file and manually adding the content that
> would
> normally distinguish a published ivy.xml from a source one. This includes
> the publication and status attributes in the /ivy-module/info element.

This might explain my problem. I was adding those elements to the ivy.xml file and then using
the ivy:publish ant task. Is ivy:publish supposed to automatically add publication and status
for me? How does it know what artifacts from my build need to be sent?

Here is an example where I am trying to publish the slf4j-log4j library:

-------------------
ivy.xml
-------------------
<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="slf4j"
    module="slf4j-log4j12"
    status="release">
  </info>
  <configurations>
    <conf name="default" 
      description="Provides this module and its runtime deps."
      visibility="public" />
  </configurations>
  <publications>
    <artifact name="slf4j-log4j" />
  </publications>
  <dependencies>
    <dependency conf="*->default" org="slf4j" name="slf4j-api" rev="1.5.8" />
    <dependency conf="*->default" org="log4j" name="log4j" rev="latest.version" />
  </dependencies>
</ivy-module>

-----------------
build.xml: publish
-----------------
<target name="publish" description="publish this module to ${to.resolver}">
    <ivy:resolve />
    <ivy:publish organisation="slf4j" module="slf4j-log4j12" resolver="${to.resolver}"
revision="1.5.8">
      <artifacts pattern="jars/[artifact].[ext]" />
    </ivy:publish>
  </target>

Here's what I get as a result:
Buildfile: build.xml

publish:
[ivy:resolve] :: Ivy 2.1.0-rc2 - 20090704004254 :: http://ant.apache.org/ivy/ ::
[ivy:resolve] :: loading settings :: file = C:\workspaces\code-workspace\IvyAdmin\ivysettings.xml
[ivy:resolve] :: resolving dependencies :: slf4j#slf4j-log4j12;working@ARLTSELF
[ivy:resolve] 	confs: [default]
[ivy:resolve] 	found slf4j#slf4j-api;1.5.8 in local
[ivy:resolve] 	found log4j#log4j;1.2.13 in default
[ivy:resolve] 	[1.2.13] log4j#log4j;latest.version
[ivy:resolve] :: resolution report :: resolve 3212ms :: artifacts dl 13ms
	---------------------------------------------------------------------
	|                  |            modules            ||   artifacts   |
	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
	---------------------------------------------------------------------
	|      default     |   2   |   1   |   0   |   0   ||   2   |   0   |
	---------------------------------------------------------------------
:: delivering :: slf4j#slf4j-log4j12;1.5.8 :: 1.5.8 :: integration :: Mon Oct 05 14:11:04
EDT 2009
BUILD FAILED
C:\workspaces\code-workspace\IvyAdmin\build.xml:48: slf4j#slf4j-log4j12;1.5.8: j
ava.lang.IllegalStateException: ivy file not found in cache for slf4j#slf4j-log4
j12;1.5.8: please resolve dependencies before delivering (C:\Users\tself\.ivy2\c
ache\resolved-slf4j-slf4j-log4j12-1.5.8.xml)

It appears that it wants to resolve slf4j-log4j as a dependency before it will publish it.

Thanks for any help.

-- tBs

Troy Self



Mime
View raw message