Page History
Default Aspire installations use the Maven Repository
to automatically
download components and
add them to Aspire.
What if your target machine has no internet connection? Or if Maven is not installed?
In that case, you'll need to update the configuration of Aspire in order to remove the need for an internet connection.
There are two methods you can use. Both require you to install Aspire on a machine
that has internet access initially, and download the required jars before moving to a server with no internet access.
The two methods are detailed below:
tocLocal Maven Repository
How it works
When you run Aspire on a server connected to the internet, Aspire will download any bundles (jar files) you need as you install services, content sources and applications. Once they're downloaded, the bundles are stored in a local cache on disk that by default is located under the users home directory in a directory named .m2. This directory structure is know as the local maven repository.
If you're already using Maven for non Aspire related things, this directory structure would contain any files downloaded by the command line version of Maven. To make Aspire run on a machine not connected to the internet, you could just copy this structure from a machine connected to the internet, thereby copying all the files you need. However, this would have a couple of disadvantages:
- You have to (find and) copy the structure from its location, as well as copying the Aspire distribution
- The local Maven repository could contain files not required for Aspire
To make sure neither of these are an issue, we'll configure Aspire to use a local Maven repository located inside the Aspire distribution.
Step 1: Create and
Testtest Aspire on a
Computercomputer with an
Internet Connectioninternet connection
Start by using Use the Aspire Maven Distribution Archetype to create an Aspire distribution on a computer with an internet connection.
Step 2: Make
Sure All Custom Components are Deployed or Installedsure 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) 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.
- mvn deploy - Copies the component JAR to the remote repository (see Connecting Connect to the Search Technologies Maven Repository) so that the component will be available to anyone creating distributions.
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 distribution repository
- Change the id of the maven repository to local
- Add a <localRepository> of bundles/aspire
Your settings file should go from:
Code Block | ||
---|---|---|
| ||
<repositories> <defaultVersion>3.0</defaultVersion> <repository type="distribution"> <directory>bundles/aspire</directory> </repository> <repository type="maven"> <defaultVersion>2.2.2</defaultVersion> <remoteRepositories> <remoteRepository> <id>stPublic</id> <url>http<url>https://repository.searchtechnologies.com/artifactory/simple/community-public/</url> <user>[email protected]</user><username>REGISTERED-USERNAME</username> <password>encrypted:F8CBFF4564F6781D63B5DAD8F30EC630< <password>REGISTERED-PASSWORD</password> </remoteRepository> </remoteRepositories> </repository> </repositories> |
to
Code Block | ||
---|---|---|
| ||
<repositories> <defaultVersion>3.0</defaultVersion> <repository type="maven"> <localRepository>bundles/aspire</localRepository> <defaultVersion>2.2.2</defaultVersion> <remoteRepositories> <remoteRepository> <id>local</id> <url>http<url>https://repository.searchtechnologies.com/artifactory/simple/community-public/</url> <user>[email protected]</user><username>REGISTERED-USERNAME</username> <password>encrypted:F8CBFF4564F6781D63B5DAD8F30EC630< <password>REGISTERED-PASSWORD</password> </remoteRepository> </remoteRepositories> </repository> </repositories> |
Note |
---|
Use |
the |
user/password |
that |
you |
registered |
for |
Aspire |
with. |
Step 4: Get the entitlements.xml file
To get the entitlements.xml file go to Get Entitlements Offline
Step 5: Run Aspire
Once you've updated the settings file, start Aspire and install all the connectors, services and applications you require. You only need to install one of each type. For example, if you wanted to have three file system connectors, two of which publish to SOLR and one that publishes to Elastic, you would only need to add one FileSystem content source, one SOLR publisher and one Elastic publisher.
You do not need to fully configure the sources/publishers. The intention is just to allow them to be downloaded to the local repository
Step
56: Edit your settings.xml file again
Once all the jars you need have been downloaded, stop Aspire and edit the settings file. In the repositories section:
- Add an <offline> tag set to true
- Remove the <remoteRepositories> tag
Your settings file should go from:
Code Block | ||
---|---|---|
| ||
<repositories> <defaultVersion>3.0</defaultVersion> <repository type="maven"> <localRepository>bundles/aspire</localRepository> <defaultVersion>2.2.2</defaultVersion> <remoteRepositories> <remoteRepository> <id>local</id> <url>http<url>https://repository.searchtechnologies.com/artifactory/simple/community-public/</url> <user>[email protected]</user><username>REGISTERED-USERNAME</username> <password>encrypted:F8CBFF4564F6781D63B5DAD8F30EC630< <password>REGISTERED-PASSWORD</password> </remoteRepository> </remoteRepositories> </repository> </repositories> |
to
Code Block | ||
---|---|---|
| ||
<repositories> <defaultVersion>3.0</defaultVersion> <offline>true</offline> <repository type="maven"> <localRepository>bundles/aspire</localRepository> <defaultVersion>2.2.2</defaultVersion> </repository> </repositories> |
Step
57: Move the distribution
You can now move (or copy) the target directory of the distribution to the server without internet access and test
Aspire Distribution Repository
There is an option in Aspire , called the "Distribution Repository" which is designed to allow you to load jars from a file system.
Below are step-by-step instructions on creating an Aspire distribution which that can be copied and used on computers without an internet connection.
How
It Worksit works
Basically, you will be using Aspire's "Distribution Repository" mechanism on the target machine instead of the standard "Maven Repository". This means:
- 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).
- The "settings.xml" file will only contain the "distribution" repository (delete or disable the maven repository configuration) as well as the entitlements configuration used for dynamic fill of applications, publisher and connector lists in the UI.
Step 1: Create and
Testtest Aspire on a
Computercomputer with an
Internet Connectioninternet connection
Start by using Use the Aspire Maven Distribution Archetype to create an Aspire distribution on a computer with an internet connection.
Step 2: Make
Sure All Custom Components are Deployed or Installedsure 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) 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.
- mvn deploy - Copies the component JAR to the remote repository (see Connecting Connect to the Search Technologies Maven Repository) so that the component will be available to anyone creating distributions.
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 for more information on Aspire repository configuration).
Remove or disable the Maven repository from the settings.xml file. This means deleting, commenting-out the section which starts with <repository type="maven">. or adding the <offline>true</offline> tag to it.
Also change the tag <entitlements online="true"> to <entitlements online="false">
Step 4: Get the entitlements.xml file
To get the entitlements.xml file go to Get Entitlements Offline
Step 5: 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
56: Update your
Distributiondistribution 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:
Code Block | ||
---|---|---|
| ||
<project> . . . <dependencies> . . . <dependency> <groupId>com.searchtechnologies.aspire</groupId> <artifactId>aspire-tools</artifactId> <version>2<version>3.2.2<0</version> <type>jar</type> </dependency> <dependency> <groupId>com.searchtechnologies.aspire</groupId> <artifactId>aspire-fetch-url</artifactId> <version>2<version>3.2.2<0</version> <type>jar</type> </dependency> <dependency> <groupId>com.searchtechnologies.aspire</groupId> <artifactId>aspire-extract-text</artifactId> <version>2<version>3.2.2<0</version> <type>jar</type> </dependency> . . . </dependencies> </project |
Note |
---|
aspire-application is always required to be present in the <dependencies> |
The changes above will automatically copy these components from Maven into your deployment when the distribution is re-built.
Step
67: Update your
Distributiondistribution.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.appbundlesaspire:*</include> like this:
Code Block | ||
---|---|---|
| ||
<assembly> . . . <dependencySets> <dependencySet> . . . <includes> <include>com.searchtechnologies.aspire:*</include> </includes> </dependencySet> . . . </dependencySets> . . . </assembly> |
Step
78: Test the pom.xml changes
This is easy to do with the following command:
Code Block | ||||
---|---|---|---|---|
| ||||
mvn clean package assembly:assembly |
or (for the latest version of Maven)
Code Block | ||||
---|---|---|---|---|
| ||||
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
89: 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.
Get Entitlements Offline
For both options, you need to get the user's entitlements.xml file in order to use the connectors, publishers, and applications that user is entitled to.
To get your entitlements.xml file for an offline distribution you should do the following steps:
- Go to http://entitlements.searchtechnologies.com/entitlements
- Put the username and click Get Entitlements.
- Copy or replace the entitlements.xml file in the config folder of the Aspire distribution with the one provided.
Add Username
Copy or Get Entitlements.xml