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:
To make sure neither of these are an issue, we'll configure Aspire to use a local Maven repository located inside the Aspire distribution.
Start by Using the Maven Distribution Archetype to create an Aspire distribution on a computer with an internet connection.
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:
Inside the Aspire settings.xml file, you will find two different repositories listed (see Aspire Repository Configuration for more information on Aspire repository configuration).
Your settings file should go from:
<repositories> <defaultVersion>3.2</defaultVersion> <repository type="distribution"> <directory>bundles/aspire</directory> </repository> <repository type="maven"> <remoteRepositories> <remoteRepository> <id>stPublic</id> <url>https://repository.searchtechnologies.com/artifactory/public/</url> <username>REGISTERED-USERNAME</username> <password>REGISTERED-PASSWORD</password> </remoteRepository> </remoteRepositories> </repository> </repositories>
to
<repositories> <defaultVersion>3.2</defaultVersion> <repository type="maven"> <localRepository>bundles/aspire</localRepository> <remoteRepositories> <remoteRepository> <id>local</id> <url>https://repository.searchtechnologies.com/artifactory/public/</url> <username>REGISTERED-USERNAME</username> <password>REGISTERED-PASSWORD</password> </remoteRepository> </remoteRepositories> </repository> </repositories>
Use the user/password that you registered for Aspire with.
To get the entitlements.xml file go to General Settings
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
Once all the jars you need have been downloaded, stop Aspire and edit the settings file. In the repositories section:
Your settings file should go from:
<repositories> <defaultVersion>3.2</defaultVersion> <repository type="maven"> <localRepository>bundles/aspire</localRepository> <remoteRepositories> <remoteRepository> <id>local</id> <url>https://repository.searchtechnologies.com/artifactory/public/</url> <username>REGISTERED-USERNAME</username> <password>REGISTERED-PASSWORD</password> </remoteRepository> </remoteRepositories> </repository> </repositories>
to
<repositories> <defaultVersion>3.2</defaultVersion> <offline>true</offline> <repository type="maven"> <localRepository>bundles/aspire</localRepository> </repository> </repositories>
You can now move (or copy) the target directory of the distribution to the server without internet access and test
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 instructions on creating an Aspire distribution that can be copied and used on computers without an internet connection.
Basically, you will be using Aspire's "Distribution Repository" mechanism on the target machine instead of the standard "Maven Repository". This means:
Start by Using the Maven Distribution Archetype to create an Aspire distribution on a computer with an internet connection.
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:
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 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">
To get the entitlements.xml file go to Setting Aspire with No Internet Access (Offline)#Get Entitlements Offline
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.
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.aspire</groupId> <artifactId>aspire-tools</artifactId> <version>3.2</version> <type>jar</type> </dependency> <dependency> <groupId>com.searchtechnologies.aspire</groupId> <artifactId>aspire-fetch-url</artifactId> <version>3.2</version> <type>jar</type> </dependency> <dependency> <groupId>com.searchtechnologies.aspire</groupId> <artifactId>aspire-extract-text</artifactId> <version>3.2</version> <type>jar</type> </dependency> . . . </dependencies> </project
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.
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.aspire:*</include> like this:
<assembly> . . . <dependencySets> <dependencySet> . . . <includes> <include>com.searchtechnologies.aspire:*</include> </includes> </dependencySet> . . . </dependencySets> . . . </assembly>
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.
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.
For both options, you need to get the user's entitlements.xml file in order to use the connectors, publishers, and applications that the user is entitled to.
To get your entitlements.xml file for an offline distribution and complete the following steps.
Add Username
Copy or Get Entitlements.xml