A Liberty profile server can be installed as a Maven artifact. There are two options for installing as a Maven artifact: using the Maven install plug-in and using the Liberty assembly packaging method.
You can use maven-install-plugin to install a compressed archive that contains Liberty profile server files as a Maven artifact. The compressed archive can be generated, for example, by the liberty:package-server goal.
mvn install:install-file
-Dfile=/opt/ibm/wlp.zip \
-DgroupId=myGroup \
-DartifactId=myServer \
-Dversion=1.0 \
-Dpackaging=zip \
...
<plugin>
<!-- Install the Liberty server zip into the local Maven repository -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>install-liberty-to-repo</id>
<phase>process-resources</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>/opt/ibm/wlp.zip</file>
<groupId>myGroup</groupId>
<artifactId>myServer</artifactId>
<version>1.0</version>
<packaging>zip</packaging>
</configuration>
</execution>
</plugin>
...
You can use liberty-assembly packaging type to create Liberty profile 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 in the dropins/ directory.
<project>
...
<groupId>myGroup</groupId>
<artifactId>myServer</artifactId>
<!-- Create Liberty profile 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>com.ibm.websphere.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>1.0</version>
<extensions>true</extensions>
<configuration>
<serverHome>/opt/ibm/wlp</serverHome>
<serverName>test</serverName>
</configuration>
</plugin>
</plugins>
</build>
...
</project>