Details
-
New Feature
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
-
None
Description
Hello,
I'd like to thank you all for this great project and its support.
I've submitted a previous bug
https://issues.apache.org/jira/browse/IVY-1576 - and its fix, thanks for accepting it.
This is an enhancement request, which I've already done for 2.4.x version.
The changes are minimal, but the result is a very simple and easy to maintain programmatic interface for applications who desire to use Ivy as an in-process dependency manager. This would be similar to MavenCli (http://maven.apache.org/ref/3.5.0/maven-embedder/project-info.html)
The change would simply be to make Main.run public, return ResolveReport and have a noterminate option.
A programmatic example of using Ivy would then be :
ResolveReport report = Main.run(new String[]{ "-dependency", "apache", "commons-lang 2.0", "-noterminate"});
since it simply re-uses the command line interface, potentially no maintenance is required (different than the MavenCli interface - as it is broken at the moment). The noterminate option would be needed to prevent the big hammer of terminating the jvm. Some processes using Ivy in process do not want to terminate when Ivy has finished its resolve & retrieve.
This would fix :
- https://issues.apache.org/jira/browse/IVY-1321
- And the many examples in stackoverflow where the entire Main class is copied/pasted as a programmatic interface
I think there is a great desire for a simple interface which returns results which can be inspected.
Here is the pull request
https://github.com/apache/ant-ivy/pull/69
Attachments
Issue Links
- duplicates
-
IVY-1321 Heavy Handed System.exit(0) in Main.main(String[] args) precluded using Ivy as an embedded standalone
- Resolved