This library allows Java applications to be delivered without bundling Maven library dependencies with the deliverables. Instead the application is delivered with an ivy.xml file which specifies the library dependencies. On application startup, should libraries require resolution, the libraries are downloaded and the application can be restarted automatically.
- Bugfix for library directory override
- System.out.println -> System.out.print for resolution output stream
- Jar'd ivysettings.xml now dealt with properly
- temp files cleaned up
- ivy.xml and ivysettings.xml can now be bundled in an application's jar file. On resolution temp files are written containing the configuration for use with Ivy.
- added ProcessListener interface to allow classes to receive the output and error streams from the resolution process and the executable process, if specified.
<dependency>
<groupId>com.github.mrstampy</groupId>
<artifactId>PoisonIvy</artifactId>
<version>1.4</version>
</dependency>
The PoisonIvy class can be used in one of three ways:
- A separate application
- An embedded class
- A main class superclass
- -h - Prints help message
- -ivy [ARG] - The ivy file for library dependency resolution (default: ./ivy.xml)
- -ivysettings [ARG] - The ivy settings file for library dependency resolution (default: built in settings)
- -libdir [ARG] - The directory to store the retrieved librarires (default: ./ivylib)
- -rp [ARG] - The ivy resolve pattern (default: [artifact]-[revision](-[classifier]).[ext])
- -f - Force clean library retrieval (default: false)
- -nc - Do not remove source and api documentation after library dependency retrieval (default: clean)
- -D [ARG] - Java -Dproperty=value command line properties
- -X [ARG] - Java -Xparm command line properties
- -mc [ARG] - The main class to execute
- -mj [ARG] - The application jar to execute
-mj MyApplication.jar
-mj MyApplication.jar -X mx1000m -X ms500m
-mc com.my.MainClass -X mx1000m -X ms500m -D my.settings.file=/some/path/and/file
-ivy /path/to/ivy.xml -ivysettings /path/to/ivysettings.xml -libdir /path/to/ivylib -f -nc
// forces update of libraries using the specified ivy.xml file
new PoisonIvy("-ivy", "myivy.xml", "-f").execute();
// forces update of libraries and (re)starts the Main application
new PoisonIvy("-f", "-mc", "com.my.app.Main").execute();
Should no parameters be specified a poisonivy.config file, if it exists, is used to specify the parameters. The first line of the file specifies the parameters as per the command line.
Poison Ivy's dependencies (ivy, slf4j-api and commons-cli) must be included with the application deliverable.