OpenLiberty / ci.maven

Maven plugins for managing Liberty profile servers #devops
Apache License 2.0
126 stars 90 forks source link

Improve documentation on using Liberty Maven plugin in CI/CD #1101

Open gasgithub opened 3 years ago

gasgithub commented 3 years ago

Short documentation explaining how plugin can be used in CI/CD, with full pom.xml example showing configuration with and without parent POM.

To include parent POM add following:

   <parent>
        <groupId>io.openliberty.tools</groupId>
        <artifactId>liberty-maven-app-parent</artifactId>
        <version>3.3.4</version>
    </parent>

Currently, if you cannot use parent POM following plugin config is required (taken from the parent POM):

            <!-- Enable liberty-maven plugin -->
            <plugin>
                <groupId>io.openliberty.tools</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <version>3.3.4</version>
                <executions>
                    <execution>
                        <id>stop-before-clean</id>
                        <phase>pre-clean</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>create-server</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>install-server</goal>
                            <goal>create</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>install-feature</id>
                        <phase>prepare-package</phase>
                        <goals>
                          <goal>install-feature</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>install-apps</id>
                        <phase>package</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>package-server</id>
                        <phase>package</phase>
                        <goals>
                            <goal>package</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-start</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>test-start</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-stop</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>test-stop</goal>
                        </goals>
                    </execution>
                    </executions>
            </plugin>   
scottkurz commented 3 years ago

Documenting what you need to do today likely leads to the next question: how to simplify? That's the subject of issue: https://github.com/OpenLiberty/ci.maven/issues/739.