Maven goal - liberty:create-server

You can use the liberty:create-server goal to create a Liberty server.

The server must not exist before executing this goal.

Parameters

The following table describes parameters of the create-server goal.

Table 1. The parameters of the create-server goal.

The first column contains a list of parameters, the second column contains a description of each parameter, and the third column states whether this parameter is required.

Parameter Description Required
serverHome Directory location of the Liberty server installation. Yes, only when assemblyArchive and assemblyArtifact parameters are not set.
assemblyArchive Location of the Liberty server compressed archive. The archive will be unpacked into a directory as specified by the installDirectory parameter. Yes, only when serverHome and assemblyArtifact parameters are not set.
assemblyArtifact Maven artifact name of the Liberty server assembly. The assembly will be installed into a directory as specified by the installDirectory parameter. For more information on Liberty server Maven assemblies, see Installation as a Maven artifact. Yes, only when serverHome and assemblyArchive parameters are not set.
installDirectory Local installation directory location of the Liberty server when the server is installed using the assembly archive or artifact option. The default value is ${project.build.directory} /liberty. No
refresh If true, re-install Liberty server into the local directory. This is only used when when the server is installed using the assembly archive or artifact option. The default value is false. No
serverName Name of the Liberty server instance. The default value is defaultServer. No
configFile Location of a server configuration file to be used by the instance. The default value is ${basedir}/src/test/resources/server.xml. No
bootProps Location of a bootstrap properties file to be used by the instance. The default value is ${basedir}/src/test/resources/bootstrap.properties. No
jvmOptions Location of a JVM options file to be used by the instance. The default value is ${basedir}/src/test/resources/jvm.options. No
serverEnv Location of a server environment file to be used by the instance. The default value is ${basedir}/src/test/resources/server.env. No
overwrite Overwrite existing configurtion files such as server.xml, bootstrap.properties, jvm.options, or server.env in the target server even if they are newer. The default value is true. Since liberty-maven-plugin version 1.1. No
Example: creating a server
This is the code snippet that you can use in the pom.xml file of your project.
<build>
    ...
    <plugins>
        <plugin>
            <groupId>com.ibm.websphere.wlp.maven.plugins</groupId>
            <artifactId>liberty-maven-plugin</artifactId> 
            <version>1.0</version>
            <executions>
                ...
                <execution>
                    <id>create-server</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>create-server</goal>
                    </goals>
                </execution>
                ...
            <executions>
            <configuration>
                <serverHome>/opt/ibm/wlp</serverHome>
                <serverName>test</serverName>
            </configuration>              
        </plugin>
    </plugins>
    ...
</build>
Example: creating a server from command line
This is the Maven command that you can use to create a server.
mvn liberty:create-server -DserverHome=/opt/ibm/wlp -DserverName=test

Icon that indicates the type of topic Reference topic



Timestamp icon Last updated: Monday, 5 December 2016
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-libcore-mp&topic=rwlp_maven_createserver
File name: rwlp_maven_createserver.html