-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update liberty:dev and docs for Podman (#1727)
* Update DevMojo parameters and aliases * Add dev-container-it and skip-container-its profile * Add Podman info to docs * Skip dev-container-it * Update dev goal aliases and docs
- Loading branch information
Showing
14 changed files
with
919 additions
and
44 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>io.openliberty.tools.it</groupId> | ||
<artifactId>dev-container-it</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<maven.compiler.source>8</maven.compiler.source> | ||
<maven.compiler.target>8</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.13.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.openliberty.tools</groupId> | ||
<artifactId>liberty-maven-plugin</artifactId> | ||
<version>@pom.version@</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-httpclient</groupId> | ||
<artifactId>commons-httpclient</artifactId> | ||
<version>3.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
<version>2.11.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.codehaus.plexus</groupId> | ||
<artifactId>plexus-utils</artifactId> | ||
<version>3.4.2</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.openliberty.tools</groupId> | ||
<artifactId>liberty-maven-plugin</artifactId> | ||
<version>@pom.version@</version> | ||
<configuration> | ||
<assemblyArtifact> | ||
<groupId>${runtimeGroupId}</groupId> | ||
<artifactId>${runtimeArtifactId}</artifactId> | ||
<version>${runtimeVersion}</version> | ||
<type>zip</type> | ||
</assemblyArtifact> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<version>3.0.0</version> | ||
<configuration> | ||
<redirectTestOutputToFile>true</redirectTestOutputToFile> | ||
<forkCount>1</forkCount> | ||
<reuseForks>true</reuseForks> | ||
<forkedProcessTimeoutInSeconds>2400</forkedProcessTimeoutInSeconds> | ||
<argLine>-enableassertions</argLine> | ||
<workingDirectory>${project.build.directory}</workingDirectory> | ||
<includes> | ||
<include>**/*Test.java</include> | ||
</includes> | ||
<systemPropertyVariables> | ||
<mavenPluginVersion>@pom.version@</mavenPluginVersion> | ||
<runtimeVersion>${runtimeVersion}</runtimeVersion> | ||
</systemPropertyVariables> | ||
<trimStackTrace>false</trimStackTrace> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>integration-test</id> | ||
<goals> | ||
<goal>integration-test</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>verify</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>verify</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>3.0.0</version> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>3.2.2</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>test-jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
33 changes: 33 additions & 0 deletions
33
liberty-maven-plugin/src/it/dev-container-it/resources/container-test-project/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Start with OL runtime. | ||
# tag::from[] | ||
FROM icr.io/appcafe/open-liberty:full-java11-openj9-ubi | ||
# end::from[] | ||
|
||
ARG VERSION=1.0 | ||
ARG REVISION=SNAPSHOT | ||
# tag::label[] | ||
|
||
LABEL \ | ||
org.opencontainers.image.authors="Your Name" \ | ||
org.opencontainers.image.vendor="IBM" \ | ||
org.opencontainers.image.url="local" \ | ||
org.opencontainers.image.source="https://github.com/OpenLiberty/guide-docker" \ | ||
org.opencontainers.image.version="$VERSION" \ | ||
org.opencontainers.image.revision="$REVISION" \ | ||
vendor="Open Liberty" \ | ||
name="system" \ | ||
version="$VERSION-$REVISION" \ | ||
summary="The system microservice from the Docker Guide" \ | ||
# tag::description[] | ||
description="This image contains the system microservice running with the Open Liberty runtime." | ||
# end::description[] | ||
# end::label[] | ||
|
||
|
||
USER root | ||
|
||
COPY --chown=1001:0 src/main/liberty/config/server.xml /config/ | ||
|
||
COPY --chown=1001:0 target/*.war /config/apps/ | ||
|
||
USER 1001 |
123 changes: 123 additions & 0 deletions
123
liberty-maven-plugin/src/it/dev-container-it/resources/container-test-project/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation= | ||
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>io.openliberty.tools</groupId> | ||
<artifactId>dev-containers-it</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>war</packaging> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<!-- Liberty configuration --> | ||
<liberty.var.default.http.port>9080</liberty.var.default.http.port> | ||
<liberty.var.default.https.port>9443</liberty.var.default.https.port> | ||
</properties> | ||
|
||
<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> | ||
|
||
<dependencies> | ||
|
||
<!-- Provided dependencies --> | ||
<dependency> | ||
<groupId>jakarta.platform</groupId> | ||
<artifactId>jakarta.jakartaee-api</artifactId> | ||
<version>9.1.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.microprofile</groupId> | ||
<artifactId>microprofile</artifactId> | ||
<version>5.0</version> | ||
<type>pom</type> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<!-- For tests --> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>5.8.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.resteasy</groupId> | ||
<artifactId>resteasy-client</artifactId> | ||
<version>6.0.0.Final</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.resteasy</groupId> | ||
<artifactId>resteasy-json-binding-provider</artifactId> | ||
<version>6.0.0.Final</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.glassfish</groupId> | ||
<artifactId>jakarta.json</artifactId> | ||
<version>2.0.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.xml.bind</groupId> | ||
<artifactId>jaxb-api</artifactId> | ||
<version>2.3.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>rest</finalName> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>3.3.2</version> | ||
</plugin> | ||
|
||
<!-- Enable liberty-maven plugin --> | ||
<plugin> | ||
<groupId>io.openliberty.tools</groupId> | ||
<artifactId>liberty-maven-plugin</artifactId> | ||
<version>SUB_VERSION</version> | ||
<configuration> | ||
<skipTests>true</skipTests> | ||
</configuration> | ||
</plugin> | ||
|
||
<!-- Plugin to run functional tests --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<version>2.22.2</version> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<liberty.test.port> | ||
${liberty.var.default.http.port} | ||
</liberty.test.port> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
43 changes: 43 additions & 0 deletions
43
...s/container-test-project/src/main/java/io/openliberty/guides/rest/PropertiesResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// tag::copyright[] | ||
/******************************************************************************* | ||
* Copyright (c) 2017, 2022 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* IBM Corporation - Initial implementation | ||
*******************************************************************************/ | ||
// end::copyright[] | ||
package io.openliberty.guides.rest; | ||
|
||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Produces; | ||
|
||
import jakarta.json.JsonObject; | ||
import jakarta.json.JsonObjectBuilder; | ||
import jakarta.json.Json; | ||
|
||
// tag::Path[] | ||
@Path("properties") | ||
// end::Path[] | ||
public class PropertiesResource { | ||
|
||
@GET | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public JsonObject getProperties() { | ||
|
||
JsonObjectBuilder builder = Json.createObjectBuilder(); | ||
|
||
System.getProperties() | ||
.entrySet() | ||
.stream() | ||
.forEach(entry -> builder.add((String) entry.getKey(), | ||
(String) entry.getValue())); | ||
|
||
return builder.build(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...es/container-test-project/src/main/java/io/openliberty/guides/rest/SystemApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// tag::copyright[] | ||
/******************************************************************************* | ||
* Copyright (c) 2017, 2022 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* IBM Corporation - Initial implementation | ||
*******************************************************************************/ | ||
// end::copyright[] | ||
package io.openliberty.guides.rest; | ||
|
||
import jakarta.ws.rs.core.Application; | ||
import jakarta.ws.rs.ApplicationPath; | ||
|
||
@ApplicationPath("system") | ||
public class SystemApplication extends Application { | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
...c/it/dev-container-it/resources/container-test-project/src/main/liberty/config/server.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<server description="Sample Liberty server"> | ||
|
||
<featureManager> | ||
<feature>restfulWS-3.0</feature> | ||
<feature>jsonb-2.0</feature> | ||
<feature>jsonp-2.0</feature> | ||
</featureManager> | ||
|
||
<variable name="default.http.port" defaultValue="9080"/> | ||
<variable name="default.https.port" defaultValue="9443"/> | ||
|
||
<httpEndpoint httpPort="${default.http.port}" httpsPort="${default.https.port}" | ||
id="defaultHttpEndpoint" host="*" /> | ||
|
||
<webApplication location="rest.war" contextRoot="/"/> | ||
</server> |
Oops, something went wrong.