0
votes

===Updated=== I'm going to try and re-word this to elicit more response. Does the javadoc artifact in Ivy have to be a jar or zip file? Or can I define the artifact to be a URL similar to http://download.oracle.com/javase/1.5.0/docs/api/?

I know you can define an Ivy artifact as a url to download the file from, but that is not what I want to do.

===Original===

I am using Ivy to handle dependency management for a large project that consists of multiple Java projects. Each project is compiled by a Hudson server and published to Ivy. Each project builds it runtime jar, a source jar, and a javadoc jar. Additionally, Hudson publishes the Javadoc to a URL on a web server.

What I want to do is specify in my ivy.xml for each project that the Javadoc is published at some URL. In my dependent projects I want to have Ivy resolve that dependency and provide it to a javadoc command in ant as arguments for the subtask.

In the end, I want the following: Project A has javadoc publish at http://someurl/A/javadoc Project B is dependent on A and it's javadoc is published at http://someurl/B/javadoc In Project B's javadoc where is use classes from Project A, I want it to link to the Project A url.

Ideas?

1

1 Answers

0
votes

What I want to do is specify in my ivy.xml for each project that the Javadoc is published at some URL.

I guess you should publish Javadoc's as any other artifacts and specify search pattern in ivysettings.xml. Example:

<resolvers>
  <url name="repository">
    <ivy pattern="${repository.url}/[module]/ivy-[revision].xml" />
    <artifact pattern="${repository.url}/[module]/[artifact]-[revision].[ext]" />
    <artifact pattern="${repository.url}/[module]/[artifact]-javadoc-[revision].[ext]" />
  </filesystem>
</resolvers>

In the end, I want the following: Project A has javadoc publish at http://someurl/A/javadoc Project B is dependent on A and it's javadoc is published at http://someurl/B/javadoc In Project B's javadoc where is use classes from Project A, I want it to link to the Project A url.

As far as you publish Javadoc as artifact, it has its own ivy.xml and you can declare dependency here:

<ivy-module version="2.0">
    <info organisation="yourorg" module="moduleB-javadoc" />
    <dependencies>
        <dependency org="yourorg" name="moduleA-javadoc" />
    </dependencies>
</ivy-module>

In my dependent projects I want to have Ivy resolve that dependency and provide it to a javadoc command in ant as arguments for the subtask.

Describe javadoc artifact as dependency in dependent project's ivy.xml, then specify in your build.xml that ant javadoc task depends on target that performs and manipulate javadoc jar as you want (for details see ant documentation).