• Stars
    star
    118
  • Rank 299,007 (Top 6 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 11 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Maven plugins for managing Liberty profile servers #devops

ci.maven Maven Central Latest Build Status

The Liberty Maven plugin supports install and operational control of Liberty runtime and servers. Use it to manage your application on Liberty for integration test and to create Liberty server packages.

Usage - TLDR

  • mvn liberty:dev : All-in-one goal: installs Liberty, features, starts server and deploys app. Runs in the background while you develop your application. Applies code and configuration changes (and optionally runs tests) for immediate feedback
  • mvn liberty:help : List Liberty plugin goals
  • mvn liberty:help -Ddetail=true -Dgoal=dev : Detailed information on parameters for goal, e.g. 'dev'

Build

Use Maven 3.5.0 or later to build the Liberty Maven plugin. We conveniently provide the maven-wrapper script, so you do not need to download maven yourself if you are not using it yet.

  • ./mvnw install : builds the plugin, skipping all tests
  • ./mvnw install -Poffline-its -DlibertyInstallDir=<liberty_install_directory> : builds the plugin and runs the integration tests by providing an existing installation.
  • ./mvnw install -Ponline-its -Druntime=<ol|wlp> -DruntimeVersion=<runtime_version> : builds the plugin and runs the integration tests by downloading a new server. Set runtime to ol to run tests using the Open Liberty runtime, or wlp to run tests using the WebSphere Liberty Java EE 7 runtime.

Plugins

Liberty Maven Plugin

The Liberty Maven Plugin provides a number of goals for managing a Liberty server and applications. Maven 3.5.0 or later is recommended to use the Liberty Maven Plugin.

Java Support

The Liberty Maven Plugin is tested with Long-Term-Support (LTS) releases of Java. The plugin, as of release 3.7, supports Java 8, 11 and 17. Prior to this version, the plugin is supported on Java 8 and 11.

Release 3.0 differences

The new capabilities and behavior differences are summarized in the Liberty Maven Plug-in 3.0 release notes.

Configuration

To enable Liberty Maven Plugin in your project add the following to your pom.xml:

<project>
    ...
    <build>
        <plugins>
            <!-- Enable liberty-maven-plugin -->
            <plugin>
                <groupId>io.openliberty.tools</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <version>3.7.1</version>
                <!-- Specify configuration, executions for liberty-maven-plugin -->
                ...
            </plugin>
        </plugins>
    </build>
    ...
</project>

If you are using a snapshot version of Liberty Maven Plugin then you will also need to add the following plugin repository to your pom.xml:

<project>
    ...
    <pluginRepositories>
        <!-- Configure Sonatype OSS Maven snapshots repository -->
        <pluginRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>
    ...
</project>
Liberty installation configuration

The Liberty Maven Plugin must first be configured with the Liberty server installation information. The installation information can be specified as:

Installing from a Maven artifact is the default installation method. The default runtime artifact is the latest version of io.openliberty:openliberty-kernel. In order to configure WebSphere Liberty for installation, specify the runtimeArtifact with the com.ibm.websphere.appserver.runtime groupId and the specific artifactId and version that is needed. For a full list of artifacts available, see the Liberty installation configuration documentation.

Example using the runtimeArtifact parameter to install a WebSphere Liberty runtime from a Maven artifact:

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

To install an Open Liberty beta runtime, specify the runtimeArtifact with the io.openliberty.beta groupId, open liberty-runtime artifactId and the version that is needed.

Example using the runtimeArtifact parameter to install an Open Liberty beta runtime from a Maven artifact:

<plugin>
    <groupId>io.openliberty.tools</groupId>
    <artifactId>liberty-maven-plugin</artifactId>
    <version>3.7.1</version>
    <configuration>
        <runtimeArtifact>
            <groupId>io.openliberty.beta</groupId>
            <artifactId>openliberty-runtime</artifactId>
            <version>23.0.0.3-beta</version>
            <type>zip</type>
        </runtimeArtifact>
    </configuration>
</plugin>

The Liberty Maven Plugin can also download and install a Liberty server from the Liberty repository or other location using the install parameter.

Goals

The Liberty Maven Plugin provides the following goals.

Goal Description
clean Deletes every file in the ${outputDirectory}/logs, ${outputDirectory}/workarea, ${userDirectory}/dropins or ${userDirectory}/apps.
compile-jsp Compile JSPs in the src/main/webapp into the target/classes directory
create Create a Liberty server.
debug Start a Liberty server in debug mode.
deploy Copy applications to the Liberty server's dropins or apps directory. If the server instance is running, it will also verify the applications started successfully.
dev Start a Liberty server in dev mode.*
devc Start a Liberty server in dev mode in a container.*
display-url Display the application URL in the default browser.
dump Dump diagnostic information from the server into an archive.
generate-features Scan the class files of an application and create a Liberty configuration file in the source configuration directory that contains the Liberty features the application requires.*
install-feature Install a feature packaged as a Subsystem Archive (esa) to the Liberty runtime.
install-server Installs the Liberty runtime. This goal is implicitly invoked by all the other plugin goals and usually does not need to be executed explicitly.
java-dump Dump diagnostic information from the server JVM.
package Package a Liberty server.
prepare-feature Prepare a user feature for installation to the Liberty runtime.
run Start a Liberty server in the foreground. The run goal implicitly creates the server, installs features referenced by the server.xml file, and deploys the application before starting the Liberty server.
start Start a Liberty server in the background. The server instance will be automatically created if it does not exist.
status Check a Liberty server status.
stop Stop a Liberty server. The server instance must exist and must be running.
test-start Allows you to bypass automatically starting the server during the pre-integration-test phase with pom configuration or a Liberty-specific command line argument.
test-stop Allows you to bypass automatically stopping the server during the post-integration-test phase with pom configuration or a Liberty-specific command line argument.
undeploy Undeploy an application to a Liberty server. The server instance must exist and must be running.
uninstall-feature Uninstall a feature from the Liberty runtime.

*The dev, devc, and generate-features goals have a runtime dependency on IBM WebSphere Application Server Migration Toolkit for Application Binaries, which is separately licensed under IBM License Agreement for Non-Warranted Programs. For more information, see the license. Note: The dev and devc goals have this dependency only when auto-generation of features is turned on. By default, auto-generation of features is turned off.

Common Parameters

Parameters shared by all goals. See common parameters.

Common Server Parameters

Additional parameters shared by all server-based goals. See common server parameters.

Extensions

Extensions improve the compatibility or user experience of third party libraries used with Liberty. The Liberty Maven Plugin provides the following extensions.

Extension Description
configure-arquillian goal Integrates arquillian.xml configuration for the Liberty Managed and Remote Arquillian containers in the Liberty Maven Plugin. Automatically configures required arquillian.xml parameters for the Liberty Managed container.
Spring Boot Support The Liberty Maven Plugin provides support for Spring Boot applications, allowing you to install Spring Boot executable JARs directly to the Liberty runtime.

Packaging types

liberty-assembly

The liberty-assembly Maven packaging type is used to create a packaged Liberty server Maven artifact out of existing server installation, compressed archive, or another server Maven artifact. Any applications specified as Maven compile dependencies will be automatically packaged with the assembled server. Liberty features can also be installed and packaged with the assembled server. Any application or test code included in the project is automatically compiled and tests run at appropriate unit or integration test phase. Application code is installed as a loose application WAR file if deployPackages is set to all or project and looseApplication is set to true.

The liberty-assembly default lifecycle includes:

Phase Goal
pre-clean liberty:stop
process-resources maven-resources-plugin:resources
compile maven-compiler-plugin:compile
process-test-resources maven-resources-plugin:testResources
test-compile maven-compiler-plugin:testCompile
test maven-surefire-plugin:test
prepare-package liberty:create, liberty:prepare-feature, liberty:install-feature
package liberty:deploy, liberty:package
pre-integration-test liberty:test-start
integration-test maven-failsafe-plugin:integration-test
post-integration-test liberty:test-stop
verify maven-failsafe-plugin:verify
install maven-install-plugin:install
deploy maven-deploy-plugin:deploy

Example:

<project>
    ...
    <groupId>myGroup</groupId>
    <artifactId>myServer</artifactId>
    <!-- Create Liberty server assembly -->
    <packaging>liberty-assembly</packaging>
    ...
    <dependencies>
        <!-- Package SimpleServlet.war with server assembly -->
        <dependency>
            <groupId>wasdev</groupId>
            <artifactId>SimpleServlet</artifactId>
            <version>1.0</version>
            <type>war</type>
        </dependency>
    </dependencies>
    ...
    <build>
        <plugins>
            <!-- Enable liberty-maven-plugin -->
            <plugin>
                <groupId>io.openliberty.tools</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <version>[3.2.3,)</version>
                <extensions>true</extensions>
                <configuration>
                    <installDirectory>/opt/ibm/wlp</installDirectory>
                    <serverName>test</serverName>
                    <features>
                        <acceptLicense>true</acceptLicense>
                        <feature>mongodb-2.0</feature>
                    </features>
                    <looseApplication>true</looseApplication>
                    <deployPackages>all</deployPackages>
                </configuration>
            </plugin>
        </plugins>
    </build>
    ...
</project>

Getting started

There are multiple starters available to generate a package to start developing your first application on Open Liberty.

If you want to use one of the previously published archetypes that we are no longer enhancing, refer to this documentation.

More Repositories

1

open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
1,069
star
2

open-liberty-tools

Open Liberty Tools are lightweight tools for developing, assembling, and deploying apps to Open Liberty.
Java
51
star
3

openliberty.io

Open Liberty website
JavaScript
49
star
4

ci.gradle

Gradle plugins for managing Liberty profile servers #devops
Groovy
46
star
5

ci.docker

Shell
42
star
6

liberty-bikes

Real-time web based multiplayer game running on OpenLiberty
Java
37
star
7

space-rover-mission

Roam the universe with Open Liberty!
Java
29
star
8

open-liberty-operator

Go
29
star
9

tutorial-microprofile

Dockerfile
26
star
10

guide-kubernetes-intro

An introductory guide on how to deploy microservices to a Kubernetes cluster and manage them with the Kubernetes CLI: https://openliberty.io/guides/kubernetes-intro.html
Java
20
star
11

guide-spring-boot

A guide on how to containerize, package, and run a Spring Boot application on an Open Liberty server without modification.
Java
20
star
12

guide-maven-intro

An introductory guide on how to build applications using Maven on Open Liberty: https://openliberty.io/guides/maven-intro.html
Java
20
star
13

sample-acmegifts

A gift giving and budgeting application written using MicroProfile and Liberty
Java
17
star
14

liberty-tools-vscode

Visual Studio Code extension for Liberty Tools
TypeScript
17
star
15

guide-rest-intro

An introductory guide on how to create a REST application using Java EE running on Open Liberty: http://www.openliberty.io/guides/rest-intro.html
Java
17
star
16

guide-microprofile-openapi

A guide on how to document and filter RESTful APIs from code or static files by using MicroProfile OpenAPI: https://openliberty.io/guides/microprofile-openapi.html
Java
16
star
17

guide-getting-started

An introductory guide to writing and deploying applications on Open Liberty using Maven and Docker: https://openliberty.io/guides/getting-started.html
JavaScript
15
star
18

open-liberty-s2i

Shell
14
star
19

guide-jpa-intro

A guide on how to use Java Persistence API to access and persist data to a database for your microservices: https://openliberty.io/guides/jpa-intro.html
Java
14
star
20

guide-kubernetes-microprofile-config

A guide on how to externalize configuration using MicroProfile Config and configure your microservices using Kubernetes ConfigMaps and Secrets: https://openliberty.io/guides/kubernetes-microprofile-config.html
Java
14
star
21

guide-microprofile-jwt

An introductory guide on how to control user and role access to microservices with MicroProfile JSON Web Token (MicroProfile JWT): https://openliberty.io/guides/microprofile-jwt.html
Java
13
star
22

sample-getting-started

Getting started sample
Java
12
star
23

docs

See Open Liberty documentation on https://openliberty.io/docs/
12
star
24

liberty-tools-intellij

IntelliJ IDEA extension for Liberty
Java
12
star
25

liberty-tools-eclipse

Java
12
star
26

guide-microprofile-config

A guide on how to provide external configuration to microservices using MicroProfile Config: https://openliberty.io/guides/microprofile-config.html
Java
12
star
27

guide-cloud-aws

A guide on how to deploy microservices to Amazon Elastic Container Service for Kubernetes (EKS) on Amazon Web Services (AWS): https://openliberty.io/guides/cloud-aws.html
Java
12
star
28

liberty-arquillian

Arquillian Liberty Managed and Remote containers
Java
11
star
29

guide-docker

A guide on how to use Docker containers for iterative development of microservices: https://openliberty.io/guides/docker.html
Java
11
star
30

guide-microprofile-rest-client

A guide on how to use MicroProfile Rest Client to invoke RESTful microservices over HTTP in a type-safe way: https://openliberty.io/guides/microprofile-rest-client.html
Java
11
star
31

guide-microprofile-opentracing

A guide on how to enable and customize tracing of JAX-RS and non-JAX-RS methods by using MicroProfile OpenTracing: https://openliberty.io/guides/microprofile-opentracing.html
Java
11
star
32

sample-mp-graphql

Java
10
star
33

guides-common

Common Guide files
Python
10
star
34

devfile-stack

Application stack for Open Liberty
Shell
10
star
35

blogs

Blog posts for https://openliberty.io
Shell
10
star
36

guide-rest-client-java

A guide on how to consume a REST service in Java: https://openliberty.io/guides/rest-client-java.html
Java
9
star
37

start.openliberty.io

Open Liberty Starter backend.
Java
9
star
38

demo-devmode

JavaScript
9
star
39

guide-istio-intro

A guide on how to manage microservice traffic with Istio using blue-green deployment as an example: https://openliberty.io/guides/istio-intro.html
Java
8
star
40

ci.ant

Ant tasks for managing Liberty profile server instances #devops
Java
8
star
41

guide-rest-hateoas

A guide on how to create a hypermedia-driven REST application running on Open Liberty: https://openliberty.io/guides/rest-hateoas.html
Java
8
star
42

guide-microprofile-metrics

A guide on how to provide system and application metrics from a microservice with MicroProfile Metrics: https://openliberty.io/guides/microprofile-metrics.html
Java
8
star
43

guide-security-intro

An introductory guide on how to secure a web application through authentication and authorization using Java EE 8 Security API: https://openliberty.io/guides/security-intro.html
Java
8
star
44

guide-cors

A guide on how to enable Cross-Origin Resource Sharing (CORS) in Open Liberty: https://openliberty.io/guides/cors.html
Java
7
star
45

guide-maven-multimodules

A guide on how to create a multi-module application with Maven and Open Liberty: https://openliberty.io/guides/maven-multimodules.html
Java
7
star
46

guide-containerize

A guide on how to containerize and run your microservices with Open Liberty using Docker:
Java
7
star
47

open-liberty-deep-dive

This repository has been archived. Visit https://github.com/openliberty/guide-liberty-deep-dive for the new version of this tutorial..
Java
7
star
48

guide-liberty-deep-dive

An end-to-end tutorial on cloud-native Java application development and deployment using Jakarta EE, MicroProfile & Open Liberty
Java
7
star
49

guide-rest-client-angularjs

A guide on how to consume a REST service with AngularJS: https://openliberty.io/guides/rest-client-angularjs.html
Java
6
star
50

liberty-language-server

The Liberty Config Language Server provides language server features for Liberty server configuration files through any of the supported client IDEs.
Java
6
star
51

guide-cdi-intro

An introductory guide on how to use Contexts and Dependency Injection to manage and inject dependencies into microservices: https://openliberty.io/guides/cdi-intro.html
Java
6
star
52

openliberty-realworld-example-app

Java
5
star
53

sample-async-rest

Java
5
star
54

space-sentry-challenge

C++
5
star
55

archived-guide-cloud-openshift

A guide on how to deploy microservices to Red Hat OpenShift.
Java
5
star
56

guide-bean-validation

An introductory guide on how to use bean validation in Open Liberty to create a microservice to validate user input data: https://openliberty.io/guides/bean-validation.html
Java
5
star
57

guide-cloud-azure

ο»Ώο»ΏA guide on how to deploy microservices to Azure Kubernetes Service (AKS) on Microsoft Azure.
Java
5
star
58

guide-arquillian-managed

A guide on how to develop tests for your microservices with the Arquillian managed container and run the tests on Open Liberty: https://openliberty.io/guides/arquillian-managed.html
Java
5
star
59

archived-guide-microprofile-intro

An introductory guide on how to create a MicroProfile application running on Open Liberty: https://openliberty.io/guides/microprofile-intro.html
Java
5
star
60

guide-kubernetes-microprofile-health

A guide on how to check the health of microservices on Kubernetes by setting up readiness probes to inspect MicroProfile Health Check endpoints: https://openliberty.io/guides/kubernetes-microprofile-health.html
Java
5
star
61

sample-mongodb

Open Liberty sample application for accessing MongoDB
Java
4
star
62

iguide-circuit-breaker

Open Liberty MicroProfile CircuitBreaker and Fallback Guide: https://openliberty.io/guides/circuit-breaker.html
JavaScript
4
star
63

guide-sessions

A guide on how to create, use, and cache HTTP session data for your application:
Java
4
star
64

sample.daytrader8

Java
4
star
65

guide-microprofile-health

A guide on how to report and check the health of a microservice with MicroProfile Health: https://openliberty.io/guides/microprofile-health.html
Java
4
star
66

guide-microprofile-reactive-messaging-rest-integration

A guide on how to integrate RESTful Java microservices with a reactive system by using MicroProfile Reactive Messaging.
Java
4
star
67

guide-microprofile-opentracing-jaeger

(Deprecated) A guide on how to enable and customize tracing of JAX-RS and non-JAX-RS methods by using MicroProfile OpenTracing and Jaeger.
Java
3
star
68

sample.daytrader10

Java
3
star
69

guide-gradle-intro

An introductory guide on how to build and test a simple web application using Gradle and Open Liberty: https://openliberty.io/guides/gradle-intro.html
Java
3
star
70

sample-kubernetes-config

A Kubernetes Sample using Open Liberty and MicroProfile Config
Java
3
star
71

sample-jaxrs-sse

Java
3
star
72

draft-guide-springboot-mvc

Java
3
star
73

guide-cloud-google

A guide on how to deploy microservices to Google Kubernetes Engine (GKE) on Google Cloud Platform (GCP).
Java
3
star
74

guide-mongodb-intro

A guide on how to persist data in your microservices to MongoDB, a document-oriented NoSQL database.
Java
3
star
75

sample-jakarta-data

Java
3
star
76

ci.common

Common functionality for ci.maven and ci.gradle
Java
3
star
77

guide-microprofile-reactive-messaging

A guide on how to write reactive Java microservices using MicroProfile Reactive Messaging.
Java
3
star
78

guide-microprofile-rest-client-async

A guide on how to use MicroProfile Rest Client to invoke RESTful microservices asynchronously over HTTP.
Java
3
star
79

guide-cloud-ibm

A guide on how to deploy microservices to IBM Cloud Kubernetes Service (IKS) and IBM Cloud Private (ICP): https://openliberty.io/guides/cloud-ibm.html
Java
3
star
80

guide-microshed-testing

A guide on how to test a MicroProfile or Jakarta EE application using MicroShed Testing.
Java
3
star
81

guide-reactive-messaging-sse

A guide on how to stream updates from a MicroProfile Reactive Messaging service to a front-end client by using Server-Sent Events.
Java
3
star
82

archived-guide-log4j

Java
2
star
83

sample-sse-chat

Java
2
star
84

draft-guides-template

Guides template
Java
2
star
85

guide-rest-client-reactjs

A guide on how to access a simple RESTful web service and consume its resources with ReactJS in Open Liberty.
HTML
2
star
86

draft-guide-intellij

Java
2
star
87

arquillian-liberty-dependencies

The Liberty dependency bundles for Arquillian make it easy for you to manage versions for your Arquillian installation, the Arquillian Liberty Managed and Remote containers, and JUnit and TestNG libraries.
Java
2
star
88

cloud-hosted-guides

Jupyter Notebook
2
star
89

guide-rest-client-angular

A guide on how to access a simple RESTful web service and consume its resources with Angular in Open Liberty: https://openliberty.io/guides/rest-client-angular.html
JavaScript
2
star
90

guide-okd

(Deprecated) A guide on how to use Minishift to deploy microservices to an Origin Community Distribution of Kubernetes (OKD) cluster.
Java
2
star
91

guide-cloud-openshift-operator

A guide on how to deploy microservices to Red Hat OpenShift by using Kubernetes Operators.
Java
2
star
92

for-automation-testing

This repository is used for testing automation. It does not contain any real function.
Java
2
star
93

sample-keycloak

Sample app using Open Liberty, Jakarta EE Security, MicroProfile JWT, and Keycloak.
Java
2
star
94

guide-microprofile-istio-retry-fallback

A guide on how to manage the impact of failures by using MicroProfile and Istio Fault Tolerance to add retry and fallback behaviours to microservices.
Java
2
star
95

liberty-bikes-ai

Liberty Bikes AI template for hands-on-lab. For more details see https://github.com/OpenLiberty/liberty-bikes
Java
2
star
96

iguide-microprofile-config-intro

Open Liberty MicroProfile Config Guide: https://openliberty.io/guides/microprofile-config-intro.html
JavaScript
2
star
97

sample.daytrader9

Java
2
star
98

guide-microprofile-reactive-messaging-acknowledgment

A guide on how to acknowledge messages by using MicroProfile Reactive Messaging.
Java
2
star
99

guide-social-media-login

A guide on how to allow users to log in to your application with their social media accounts by using the Open Liberty Social Media Login feature.
Java
2
star
100

docs-playbook

Provides the Antora playbook which defines what content (branches) get pulled in from the docs repo and build for openliberty.io
1
star