I'm pleased to announce the release of new project: JLaunchPad, version 1.0.0.
This program (Java launcher) is the set of Java classes and shell scripts (Windows and Unix) for simplifying installation/launching of Java applications. Once the launcher is installed, it can be reused for starting different Java applications.
For your application you have to specify required dependencies on other Java libraries (in maven-like fashion). When application is getting executed first time, all dependencies will be downloaded and installed automatically into your local repository. For all consequent executions of the application download process is not required and the only one responsibility of the launcher is to build correct "classpath" and launch the application.
How it works? It could be explained in the following steps:
1. On the dedicated server we have Central Repository (sponsored, non-profit, for everybody in the community/ IT industry) of Java components represented in binary format. It could be a separate Java library, some convenient tool or even GUI program.
2. Each component is provided with the group name, artifact name and the version. Classifier also could be used for specifying Java version of the component (e.g. jdk15, jdk16 etc.).
3. Each component has binary artifact and could also contain (optional) sources, javadocs or other artifacts.
4. Each component describes dependencies to other components in the form of Dependencies File. As the result, we have Dependencies Tree (or Transitive Dependencies).
5. Launcher program connects to the remote Central Repositories and downloads required components to the client's computer. Then the launcher builds correct CLASSPATH and then starts up the programs.
6. All downloaded components are stored in the Local Repository - it is the mirror of
Central Repositories and it contains only required components with their dependencies.
7. If somebody wants to introduce new program, s(he) describes it in the form of dependencies,then s(he) writes the code. As the result, it is required to distribute new code only - all dependencies will be downloaded later and only "on-demand" - when it is really required.
8. "Smart" start-up program reads Dependencies File, installs all the required dependencies and then starts the original program.
This is real separation of new code from related dependencies. If your application
is, say, dependent on "jdom" library, your distribution does not have to include this file. Instead, you provide dependencies for the project and they will be downloaded automatically.
For the implementation the following projects were reused:
- classworlds project (http://dist.codehaus.org/classworlds)
- bootstrap-mini project (http://svn.apache.org/repos/asf/maven/components/tags/maven-2.0.7/bootstrap)
- Java App Launcher (https://java-app-launcher.dev.java.net)
The project has plenty of examples that explain how to use this launcher for existing applications. The benefit is that all application deliveries will be built by same
unified scenario and do not contain dependencies - they will be downloaded/reused automatically. Among examples you can see such programs as Ant, Maven 2, Tomcat, JRuby, Groovy, Intellij IDEA, Glean and some other.
Initially this idea was implemented in another project. During last few moths I was able to separate the code and represent it as standalone project.