Java software bundles

Printer-friendly versionPrinter-friendly version
How to use a Java software bundle from SWDES

SWDES provides for the most of its Java projects the respective software bundles as downloads. Typically, these downloads are zip files with a structure like one of the following:

Zip file with the essential resources Zip file with all resources

 

How to use the library as dependency

For instance the primary library of the Creator project would be the "swdes-creator-<version>.jar" and can be found in the root folder of the smaller zip file and in the "libs" folder of the bigger zip file. Additionally, all libraries the primary library depends on can be found in the dependencies folder together with their respective licenses and resources, including all transitive dependencies.

 

How to add the library to an existing project manually

  1. Copy the primary library to a suitable location and add the library manually to the build path and class path.
  2. For each dependency the primary library depends on, if the dependency is not satisfied already, copy the respective library from the dependencies folder to a suitable location and add the library manually to the build path and class path.

 

How to add the library to an existing project with Maven

  1. Take the groupId, artifactId and version from the *-pom.xml (e.g. "swdes-creator-pom.xml") in the root folder of the zip file to either import the primary library into a remote artifact repository or to install the primary library into your local m2-repository (please refer to the Maven documentation for the required shell command) or configure the primary library as system dependency with "systemPath". For example install like so:  mvn install:install-file -Dfile=../swdes-creator-1.0.98-b.jar -DgroupId=net.swdes.creator -DartifactId=swdes-creator -Dversion=1.0.98-b -Dpackaging=jar
  2. Take the same groupId, artifactId and version to add a dependency to the pom.xml of the existing project.
  3. For each dependency the primary library depends on, if the dependency is not satisfied already, copy the respective dependency from the the *-pom.xml in the root folder of the zip file to add a dependency to the pom.xml of the existing project. If Maven cannot satisfy a dependency because the library is not available yet, either import the library into a remote artifact repository or to install the library into your local m2-repository.
  4. Perform a Maven dependencies update and Maven build on the existing project.

 

Optionally, copy the sources from the "src" folder in the zip file as well as the Javadocs from the "javadoc" folder to a suitable location and link them to the primary library in the dependencies of the existing project.

 

How to review the source codes

For instance the source code of the Creator project would be in the "src" folder of the bigger zip file only.

 

How to add the source code to a new project manually

  1. Create a new Java project in your IDE.
  2. Copy the sources from the "src" folder in the zip file into a "src" source folder of the new project.
  3. For each dependency the sources depend on, if the dependency is not satisfied already, copy the respective library from the dependencies folder to a suitable location and add the library manually to the build path.

 

How to add the source code to a new project with Maven

  1. Create a new Maven project in your IDE (no archetype needed).
  2. Copy the sources from the "src" folder in the zip file into a "src" source folder of the new project (delete conflicting folders generated by your IDE first).
  3. For each dependency the sources depend on, if the dependency is not satisfied already, copy the respective dependency from the the *-pom.xml in the root folder of the zip file to add a dependency to the pom.xml of the new project. If Maven cannot satisfy a dependency because the library is not available yet, either import the library into a remote artifact repository or to install the library into your local m2-repository or configure the primary library as system dependency.
  4. It might be necessary to add a configuration of the required Java version to the pom.xml (please refer to the Maven documentation how to configure a Java version).
  5. Perform a Maven dependencies update and Maven build on the existing project.

 

If the SWDES project contains an application, the source code might contain classes that can run as Java applications. Please refer to further documentations for that project on the SWDES web site and / or inside the zip file.