views:

24

answers:

1

===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?

A: 

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).

Dmitry
Actually, Dmitry, this is where I am at right now. I have the javadoc compiled into a jar and it's being pulled down as a dependency. But I if run the javac command against that, it'll just include the javadoc from project A in the javadoc for Project B...That's not what I'm going for. Instead, I want the the Project B's javadoc to link to a URL for project A. That way, the page for Project B only has it's classes/packages but allows you to click through to Project A's java doc.
John Engelman
Think of it as what you would do to include the Java API javadoc as links in your applications' javadoc...you don't want to republish the whole thing, just link to it...I want to do the same, but automate the linking using Ivy...if that's possible.
John Engelman
I'm afraid Ivy doesn't have such functionality. But you are always welcome to submit patches to the project :)
Dmitry