Creating Distributions for Machines with No Internet Access

From wiki.searchtechnologies.com
Jump to: navigation, search

For Information on Aspire 3.1 Click Here

Default Aspire installations use the Maven Repository for automatically downloading components and adding them to Aspire.

But what if your target machine has no internet connection? Or if Maven is not installed?

Fortunately, there is an option in Aspire, called the "Distribution Repository" which is designed exactly for this situation.

This page gives the step-by-step instructions on creating an Aspire distribution which can be copied and used on computers without an internet connection.

How It Works

Basically, you will be using Aspire's "Distribution Repository" mechanism on the target machine instead of the standard "Maven Repository". This means:

  1. The "bundles/aspire" directory must contain a copy of all of your component JAR files.
    • This can be done automatically when the distribution is built by putting these components as dependencies in the distribution's pom.xml file (see below).
  2. The "settings.xml" file will only contain the "distribution" repository (remove or delete the maven repository configuration)


Step 1: Create and Test Aspire on a Computer with an Internet Connection

Start by using the Aspire Distribution Archetype to create an Aspire distribution on a computer with an internet connection.

Step 2: Make Sure All Custom Components are Deployed or Installed

Aspire Maven distribution projects require that all components be stored in either a local or remote repository. When the distribution is re-built (using "mvn clean package assembly:assembly") it will download all of the component JARs from a repository into the distribution target directory.

Therefore, any new component must be copied to a repository first. This can be done with:

  • mvn install - Copies the component JAR to the local repository. The local repository is only available to processes running on the same machine for the same user.

Step 3: Edit Your settings.xml file

Inside the Aspire settings.xml file, you will find two different repositories listed (see Aspire Repository Configuration for more information on Aspire repository configuration).

Remove the Maven repository from the settings.xml file. This means deleting or commenting-out the section which starts with <repository type="maven">.

Step 4: Make sure all of the files in "distribution-files" are up-to-date

The "distribution-files" directory contains the template for your Aspire distribution. This will be the directory from which your Aspire distribution will be built. Therefore, all of the files in "distribution-files" must be up-to-date.

Step 5: Update your Distribution pom.xml

Your distribution itself contains a "pom.xml" which holds the instructions to Maven on how to build your distribution (this is the pom.xml file at the very top of the distribution directory).

All of the components and App Bundles that you need for your Aspire distribution must be specified in this file in the <dependencies> section.

For example, suppose your Aspire installation requires "aspire-tools", "aspire-fetch-url" and "aspire-extract-text". you will need to update your distribution pom.xml to look like this:

<project>
 .
 .
 .

 <dependencies>
   .
   .
   .
   <dependency>
     <groupId>com.searchtechnologies</groupId>
     <artifactId>aspire-tools</artifactId>
     <version>2.2.2</version>
     <type>jar</type>
   </dependency>
   <dependency>
     <groupId>com.searchtechnologies</groupId>
     <artifactId>aspire-fetch-url</artifactId>
     <version>2.2.2</version>
     <type>jar</type>
   </dependency>
   <dependency>
     <groupId>com.searchtechnologies</groupId>
     <artifactId>aspire-extract-text</artifactId>
     <version>2.2.2</version>
     <type>jar</type>
   </dependency>
   .
   .
   .
 </dependencies>

</project


The changes above will automatically copy these components from Maven into your deployment when the distribution is re-built.

Step 6: Update your Distribution distribution.xml

If you are including appbundles in your dependencies, you will need to update the distribution.xml file to include appbundles in the aspire/bundles directory.

Add a line : <include>com.searchtechnologies.appbundles:*</include> like this:

 <assembly>
   .
   .
   .
   <dependencySets>
     <dependencySet>
       .
       .
       .
       <includes>
         <include>com.searchtechnologies:*</include>
         <include>com.searchtechnologies.appbundles:*</include>
       </includes>
     </dependencySet>
     .
     .
     .
   </dependencySets>
   .
   .
   .
 </assembly>

Step 7: Test the pom.xml changes

This is easy to do with the following command:

  mvn clean package assembly:assembly

or (for the latest version of Maven)

  mvn clean package

Now, look in your target/{distribution}/bundles/aspire directory, and you should see all of the JAR files you need for your application.

Step 8: Copy the target to your target computer

Now that you've re-built the target, you can zip it up and copy it to the target computer. The target should contain everything you need, including all of your components in the bundles/aspire directory.