Michael
Michael

Reputation: 4886

Use multiple files in Ivy makepom Ant target

My project has multiple mostly independent modules each with their own Ivy files. A couple of the modules are 'top-level' in that nothing depends on them, they just depend on other modules.

I'd like to generate a pom for those modules to use to publish the dependencies for my users to consume.

The makepom task only accepts a single file via the ivyfile attribute afaict. I create a master module which declares that it depends on the top-level modules and provide that to makepom, but it does not transitively include the dependencies of the top level modules, it only lists the top level modules themselves.

I realize I could just provide several pom files, but for my sanity, i'd prefer to keep it to just one.

So I am wondering if you can somehow pass multiple Ivy files to the make pom task, or if there is a way to get it to list all the dependencies when I use a master Ivy file? Or at worst, is there an easy way to merge pom files w/o doing it by hand?

Upvotes: 1

Views: 483

Answers (2)

David W.
David W.

Reputation: 107080

As Mark O'Connor pointed out, the <ivy:report> task does an excellent job of documenting all the transitive jars. Which ones are required for runtime, compilation, etc.

Another possibility is to use <ivy:retrieve> to retrieve all the jars used by your Master module into an empty directory. Even if this isn't required by your project itself. The list of required jars would be a simple directory listing.

Upvotes: 0

Mark O&#39;Connor
Mark O&#39;Connor

Reputation: 77991

If this is a documentation concern, configure each module to generate a report of it's transitive dependencies, see the ivy report task.

The makepom task only accepts a single argument because just like a Maven project modules only have a single file that declares its dependencies.

Perhaps what you could do is create a parent ivy file which has a dependency on each child module?

Upvotes: 1

Related Questions