Hi Michael,

What is the best way to call ivy from a java program?
What is your idea? Why would you run a java program from Ivy?

It is already possible to run a program from Ivy, as it's available as a ivy
dependency!
Just use the Main with the option 'mainClass':

Show all options:
java  -cp ivy.jar:commons-cli-1.0.jar  org.apache.ivy.Main  -?

Start an application, with Ivy as dependency resolver (/classloader):
java  -cp ivy.jar:commons-cli-1.0.jar  org.apache.ivy.Main  -main  <
package.class>
PS: Currently it is needed that your application is a Ivy dependency. I
wrote create a patch which makes it possible to lounch your own application,
just as an application, which depends other (Ivy resolved) dependencies.
See IVY-543: Adding option 'cp', which makes it possible for main to be
loaded from file
For the details and the patch.
https://issues.apache.org/jira/browse/IVY-543

Tjeerd

Reply via email to