Skip to content

Latest commit

 

History

History
209 lines (171 loc) · 11.6 KB

installation-configuration.md

File metadata and controls

209 lines (171 loc) · 11.6 KB

Liberty installation configuration

Using a Maven artifact

Use the runtimeArtifact parameter to specify the name of the Maven artifact that contains a custom Liberty server or use one of the provided on the Maven Central repository. This is the default installation method. The default runtime artifact is the latest version of io.openliberty:openliberty-kernel.

The Maven Central repository includes the following Liberty runtime artifacts. Versions for each artifact can be found at the specified link.

Group ID : Artifact ID Description
io.openliberty:openliberty-runtime Open Liberty runtime.
io.openliberty:openliberty-jakartaee9 Open Liberty runtime with all Jakarta EE 9 features.
io.openliberty:openliberty-javaee8 Open Liberty runtime with all Java EE 8 Full Platform features.
io.openliberty:openliberty-webProfile9 Open Liberty runtime with Jakarta EE 9 Web Profile features.
io.openliberty:openliberty-webProfile8 Open Liberty runtime with Java EE 8 Web Profile features.
io.openliberty:openliberty-microProfile5 Open Liberty runtime with features for a MicroProfile 5 runtime.
io.openliberty:openliberty-microProfile4 Open Liberty runtime with features for a MicroProfile 4 runtime.
io.openliberty:openliberty-microProfile3 Open Liberty runtime with features for a MicroProfile 3 runtime.
io.openliberty:openliberty-kernel Open Liberty runtime kernel.
com.ibm.websphere.appserver.runtime:wlp-jakartaee9 WebSphere Liberty runtime with all Jakarta EE 9 features.
com.ibm.websphere.appserver.runtime:wlp-javaee8 WebSphere Liberty runtime with all Java EE 8 Full Platform features.
com.ibm.websphere.appserver.runtime:wlp-javaee7 WebSphere Liberty runtime with all Java EE 7 Full Platform features.
com.ibm.websphere.appserver.runtime:wlp-webProfile9 WebSphere Liberty runtime with Jakarta EE 9 Web Profile features.
com.ibm.websphere.appserver.runtime:wlp-webProfile8 WebSphere Liberty runtime with Java EE 8 Web Profile features.
com.ibm.websphere.appserver.runtime:wlp-webProfile7 WebSphere Liberty runtime with Java EE 7 Web Profile features.
com.ibm.websphere.appserver.runtime:wlp-kernel WebSphere Liberty runtime kernel.
com.ibm.websphere.appserver.runtime:wlp-osgi WebSphere Liberty runtime with features that support OSGi applications.
com.ibm.websphere.appserver.runtime:wlp-microProfile2 WebSphere Liberty with features for a MicroProfile 2 runtime.
com.ibm.websphere.appserver.runtime:wlp-microProfile1 WebSphere Liberty with features for a MicroProfile 1 runtime.

Example for using the runtimeArtifact parameter:

<plugin>
    <groupId>io.openliberty.tools</groupId>
    <artifactId>liberty-maven-plugin</artifactId>
    <configuration>
        <runtimeArtifact>
            <groupId>com.ibm.websphere.appserver.runtime</groupId>
            <artifactId>wlp-webProfile8</artifactId>
            <version>22.0.0.3</version>
            <type>zip</type>
        </runtimeArtifact>
    </configuration>
</plugin>

The coordinates for runtimeArtifact can be overridden using libertyRuntimeGroupId, libertyRuntimeArtifactId, and libertyRuntimeVersion. These can be set using command line properties, pom.xml properties, or additional plugin configuration. Empty or null values will result in a default value overriding the respective runtimeArtifact coordinate value. More information on these properties can be found in common parameters.

Example of overriding the runtimeArtifact parameter through the command line:

mvn clean install -Dliberty.runtime.groupId=io.openliberty -Dliberty.runtime.artifactId=openliberty-runtime -Dliberty.runtime.version=21.0.0.9

Example of overriding the runtimeArtifact parameter with pom properties:

<properties>
    <liberty.runtime.groupId>io.openliberty</liberty.runtime.groupId>
    <liberty.runtime.artifactId>openliberty-runtime</liberty.runtime.artifactId>
    <liberty.runtime.version>21.0.0.9</liberty.runtime.version>
</properties>

<plugin>
    <groupId>io.openliberty.tools</groupId>
    <artifactId>liberty-maven-plugin</artifactId>
    <configuration>
        <runtimeArtifact>
            <groupId>com.ibm.websphere.appserver.runtime</groupId>
            <artifactId>wlp-webProfile8</artifactId>
            <version>21.0.0.3</version>
            <type>zip</type>
        </runtimeArtifact>
    </configuration>
</plugin>

Example of overriding the runtimeArtifact parameter with plugin configuration:

<plugin>
    <groupId>io.openliberty.tools</groupId>
    <artifactId>liberty-maven-plugin</artifactId>
    <configuration>
        <libertyRuntimeGroupId>io.openliberty</libertyRuntimeGroupId>
        <libertyRuntimeArtifactId>openliberty-runtime</libertyRuntimeArtifactId>
        <libertyRuntimeVersion>21.0.0.9</libertyRuntimeVersion>
        <runtimeArtifact>
            <groupId>com.ibm.websphere.appserver.runtime</groupId>
            <artifactId>wlp-webProfile8</artifactId>
            <version>21.0.0.3</version>
            <type>zip</type>
        </runtimeArtifact>
    </configuration>
</plugin>

Calculating the runtime artifact version

If a version is provided in the runtimeArtifact parameter configuration it will be used as the version of the runtime artifact used for the Liberty installation unless it is overridden by the libertyRuntimeVersion property.

If a version is not provided with the runtimeArtifact parameter configuration or libertyRuntimeVersion property then, first, the runtime artifact groupId and artifactId will be calculated (via parameter config, properties, or default values). If this runtime artifact groupId and artifactId matches those of a project dependency then the version of this dependency will be set as the version of the runtime artifact used for Liberty installation. If there is no matching project dependency than the project's dependencyManagement is checked for a dependency matching the runtime artifact groupId and artifactId and if such a dependency is found, this version will be set as the version of the runtime artifact used for Liberty installation.

If a version is not provided with the runtimeArtifact parameter configuration or libertyRuntimeVersion property and also there is no matching dependency listed as a project dependency or in the project's dependency management, then a default version value is chosen, generally the most recent available version of Liberty.

Example

Example "resolving" the runtimeArtifact version from matching dependencyManagement configuration:

<dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.openliberty</groupId>
        <artifactId>openliberty-runtime</artifactId>
        <version>22.0.0.2</version>
        <type>zip</type>
      </dependency>
    </dependencies>
</dependencyManagement>

<plugins>  
   <plugin>
    <groupId>io.openliberty.tools</groupId>
    <artifactId>liberty-maven-plugin</artifactId>
    <configuration>
        <runtimeArtifact>
            <groupId>io.openliberty</groupId>
            <artifactId>openliberty-runtime</artifactId>
        </runtimeArtifact>
    </configuration>
  </plugin>

Using an existing installation

Use the installDirectory parameter to specify the directory of an existing Liberty server installation. For example:

<plugin>
    <groupId>io.openliberty.tools</groupId>
    <artifactId>liberty-maven-plugin</artifactId>
    <configuration>
        <installDirectory>/opt/ibm/wlp</installDirectory>
    </configuration>
</plugin>

Using a packaged server

Use the runtimeArchive parameter to specify a packaged server archive (created using server package command) that contains Liberty server files. For example:

<plugin>
    <groupId>io.openliberty.tools</groupId>
    <artifactId>liberty-maven-plugin</artifactId>
    <configuration>
        <runtimeArchive>/opt/ibm/wlp.zip</runtimeArchive>
    </configuration>
</plugin>

Using the install-liberty Ant Task

Use the install parameter to configure a runtime installation using the install-liberty Ant task. The Ant task allows you to install a Liberty runtime from a specified location (via runtimeUrl) or automatically resolve it from the Wasdev Liberty repository or Open Liberty repository based on a version and a runtime type.

For full documentation of the usage and parameters, please read the install-liberty Ant task documentation.

Ant Task Usage Examples

  • Install from the Open Liberty repository. The plugin will use the Open Liberty repository to find the Open Liberty runtime archive to install based on the given version and type. This is the default installation method - no extra configuration is required. By default, the latest Open Liberty runtime will be installed.
   <plugin>
       <groupId>io.openliberty.tools</groupId>
       <artifactId>liberty-maven-plugin</artifactId>
   </plugin>
  • Install the latest WebSphere Liberty runtime with Java EE 7 Web Profile features from the Wasdev Liberty repository.
   <plugin>
       <groupId>io.openliberty.tools</groupId>
       <artifactId>liberty-maven-plugin</artifactId>
       <configuration>
           <install>
               <type>webProfile7</type>
               <useOpenLiberty>false</useOpenLiberty>
           </install>
       </configuration>
   </plugin>
  • Install from a given location. The runtimeUrl sub-parameter specifies a location of the Liberty runtime .jar or .zip file to install. The licenseCode is only needed when installing from .jar file.
   <plugin>
       <groupId>io.openliberty.tools</groupId>
       <artifactId>liberty-maven-plugin</artifactId>
       <configuration>
           <install>
               <runtimeUrl><url to .jar or .zip file></runtimeUrl>
               <licenseCode><license code></licenseCode>
           </install>
       </configuration>
   </plugin>