Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge staging to prod: Update to MP6.1 #132

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 50
18 changes: 18 additions & 0 deletions .github/workflows/add-pr-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Add PRs to Dependabot PRs dashboard

on:
pull_request:
types:
- opened
- labeled

jobs:
add-to-project:
name: Add PR to dashboard
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.5.0
with:
project-url: https://github.com/orgs/OpenLiberty/projects/26
github-token: ${{ secrets.ADMIN_BACKLOG }}
labeled: dependencies
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ jobs:
- name: Post tests
if: always()
run: |
logsPath=$(sudo find . -name "console.log");
logsPath=$(sudo find . -name "console.log");
sudo cat $logsPath | sudo grep Launching

- name: Archive server logs if failed
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: server-logs
path: finish/target/liberty/wlp/usr/servers/defaultServer/logs/
path: ./target/liberty/wlp/usr/servers/defaultServer/logs
5 changes: 2 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020, 2023 IBM Corporation and others.
// Copyright (c) 2020, 2024 IBM Corporation and others.
// Licensed under Creative Commons Attribution-NoDerivatives
// 4.0 International (CC BY-ND 4.0)
// https://creativecommons.org/licenses/by-nd/4.0/
Expand All @@ -14,7 +14,7 @@
:page-essential-order: 1
:page-description: Learn how to persist data in Java microservices to MongoDB, a document-oriented NoSQL database.
:guide-author: Open Liberty
:page-tags: ['MicroProfile', 'Jakarta EE']
:page-tags: ['microprofile', 'jakarta-ee']
:page-related-guides: ['cdi-intro', 'microprofile-config', 'rest-intro']
:page-permalink: /guides/{projectid}
:repo-description: Visit the https://openliberty.io/guides/{projectid}.html[website] for the rendered version of the guide.
Expand Down Expand Up @@ -514,7 +514,6 @@ Then, run the following commands to stop and remove the `mongo-guide` container
docker stop mongo-guide
docker rm mongo-guide
docker rmi mongo-sample
docker rmi mongo
```

== Great work! You're done!
Expand Down
28 changes: 14 additions & 14 deletions finish/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<!-- OpenLiberty runtime -->
<version.openliberty-runtime>RELEASE</version.openliberty-runtime>
<!-- tag::defaultHttpPort[] -->
<liberty.var.default.http.port>9080</liberty.var.default.http.port>
<liberty.var.http.port>9080</liberty.var.http.port>
<!-- end::defaultHttpPort[] -->
<!-- tag::defaultHttpsPort[] -->
<liberty.var.default.https.port>9443</liberty.var.default.https.port>
<liberty.var.https.port>9443</liberty.var.https.port>
<!-- end::defaultHttpsPort[] -->
<app.name>${project.artifactId}</app.name>
<!-- tag::appContextRoot[] -->
Expand All @@ -39,7 +39,7 @@
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>6.0</version>
<version>6.1</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand All @@ -53,37 +53,37 @@
<dependency>
<groupId>com.ibm.websphere.appserver.api</groupId>
<artifactId>com.ibm.websphere.appserver.api.passwordUtil</artifactId>
<version>1.0.75</version>
<version>1.0.84</version>
<scope>provided</scope>
</dependency>
<!-- end::passwordUtilDependency[] -->
<!-- tag::sslDependency[] -->
<dependency>
<groupId>com.ibm.websphere.appserver.api</groupId>
<artifactId>com.ibm.websphere.appserver.api.ssl</artifactId>
<version>1.5.75</version>
<version>1.6.84</version>
<scope>provided</scope>
</dependency>
<!-- end::sslDependency[] -->
<!-- Required dependencies -->
<!-- tag::mongoDriver[] -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.12.13</version>
<artifactId>mongodb-driver-sync</artifactId>
<version>4.11.1</version>
</dependency>
<!-- end::mongoDriver[] -->
<!-- For tests -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>6.2.3.Final</version>
<version>6.2.7.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-json-binding-provider</artifactId>
<version>6.2.3.Final</version>
<version>6.2.7.Final</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -95,7 +95,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.2</version>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -119,23 +119,23 @@
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.8.2</version>
<version>3.10</version>
</plugin>
<!-- Plugin to run unit tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
<version>3.2.5</version>
</plugin>
<!-- Plugin to run functional tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0</version>
<version>3.2.5</version>
<configuration>
<!-- tag::testsysprops[] -->
<systemPropertyVariables>
<app.http.port>${liberty.var.default.http.port}</app.http.port>
<app.http.port>${liberty.var.http.port}</app.http.port>
<app.context.root>${liberty.var.app.context.root}</app.context.root>
</systemPropertyVariables>
<!-- end::testsysprops[] -->
Expand Down
46 changes: 21 additions & 25 deletions finish/src/main/java/io/openliberty/guides/mongo/MongoProducer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tag::copyright[]
/*******************************************************************************
* Copyright (c) 2020, 2022 IBM Corporation and others.
* Copyright (c) 2020, 2024 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand All @@ -11,24 +11,26 @@
// end::copyright[]
package io.openliberty.guides.mongo;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Disposes;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Inject;
import java.util.Collections;

import javax.net.ssl.SSLContext;

import com.ibm.websphere.ssl.JSSEHelper;
import com.ibm.websphere.ssl.SSLException;
import org.eclipse.microprofile.config.inject.ConfigProperty;

import com.ibm.websphere.crypto.PasswordUtil;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions;
import com.ibm.websphere.ssl.JSSEHelper;
import com.ibm.websphere.ssl.SSLException;
import com.mongodb.ConnectionString;
import com.mongodb.MongoClientSettings;
import com.mongodb.MongoCredential;
import com.mongodb.ServerAddress;
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import com.mongodb.client.MongoDatabase;

import java.util.Collections;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Disposes;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Inject;

@ApplicationScoped
public class MongoProducer {
Expand Down Expand Up @@ -82,20 +84,14 @@ public MongoClient createMongo() throws SSLException {
// end::sslContext[]

// tag::mongoClient[]
return new MongoClient(
// tag::serverAddress[]
new ServerAddress(hostname, port),
// end::serverAddress[]
// tag::creds[]
creds,
// end::creds[]
// tag::optionsBuilder[]
new MongoClientOptions.Builder()
.sslEnabled(true)
.sslContext(sslContext)
.build()
// end::optionsBuilder[]
);
return MongoClients.create(MongoClientSettings.builder()
.applyConnectionString(
new ConnectionString("mongodb://" + hostname + ":" + port))
.credential(creds)
.applyToSslSettings(builder -> {
builder.enabled(true);
builder.context(sslContext); })
.build());
// end::mongoClient[]
}
// end::createMongo[]
Expand Down
10 changes: 5 additions & 5 deletions finish/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<feature>ssl-1.0</feature>
<!-- end::sslFeature[] -->
<!-- tag::mpConfigFeature[] -->
<feature>mpConfig-3.0</feature>
<feature>mpConfig-3.1</feature>
<!-- end::mpConfigFeature[] -->
<!-- tag::passwordUtilFeature[] -->
<feature>passwordUtilities-1.1</feature>
Expand All @@ -20,15 +20,15 @@
</featureManager>
<!-- end::featureManager[] -->

<variable name="default.http.port" defaultValue="9080"/>
<variable name="default.https.port" defaultValue="9443"/>
<variable name="http.port" defaultValue="9080"/>
<variable name="https.port" defaultValue="9443"/>
<variable name="app.context.root" defaultValue="/mongo"/>

<!-- tag::httpEndpoint[] -->
<httpEndpoint
host="*"
httpPort="${default.http.port}"
httpsPort="${default.https.port}"
httpPort="${http.port}"
httpsPort="${https.port}"
id="defaultHttpEndpoint"
/>
<!-- end::httpEndpoint[] -->
Expand Down
28 changes: 14 additions & 14 deletions start/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<!-- OpenLiberty runtime -->
<version.openliberty-runtime>RELEASE</version.openliberty-runtime>
<!-- tag::defaultHttpPort[] -->
<liberty.var.default.http.port>9080</liberty.var.default.http.port>
<liberty.var.http.port>9080</liberty.var.http.port>
<!-- end::defaultHttpPort[] -->
<!-- tag::defaultHttpsPort[] -->
<liberty.var.default.https.port>9443</liberty.var.default.https.port>
<liberty.var.https.port>9443</liberty.var.https.port>
<!-- end::defaultHttpsPort[] -->
<app.name>${project.artifactId}</app.name>
<!-- tag::appContextRoot[] -->
Expand All @@ -39,7 +39,7 @@
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>6.0</version>
<version>6.1</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand All @@ -53,37 +53,37 @@
<dependency>
<groupId>com.ibm.websphere.appserver.api</groupId>
<artifactId>com.ibm.websphere.appserver.api.passwordUtil</artifactId>
<version>1.0.75</version>
<version>1.0.84</version>
<scope>provided</scope>
</dependency>
<!-- end::passwordUtilDependency[] -->
<!-- tag::sslDependency[] -->
<dependency>
<groupId>com.ibm.websphere.appserver.api</groupId>
<artifactId>com.ibm.websphere.appserver.api.ssl</artifactId>
<version>1.5.75</version>
<version>1.6.84</version>
<scope>provided</scope>
</dependency>
<!-- end::sslDependency[] -->
<!-- Required dependencies -->
<!-- tag::mongoDriver[] -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.12.13</version>
<artifactId>mongodb-driver-sync</artifactId>
<version>4.11.1</version>
</dependency>
<!-- end::mongoDriver[] -->
<!-- For tests -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>6.2.3.Final</version>
<version>6.2.7.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-json-binding-provider</artifactId>
<version>6.2.3.Final</version>
<version>6.2.7.Final</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -95,7 +95,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.2</version>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -119,23 +119,23 @@
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.8.2</version>
<version>3.10</version>
</plugin>
<!-- Plugin to run unit tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
<version>3.2.5</version>
</plugin>
<!-- Plugin to run functional tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0</version>
<version>3.2.5</version>
<configuration>
<!-- tag::testsysprops[] -->
<systemPropertyVariables>
<app.http.port>${liberty.var.default.http.port}</app.http.port>
<app.http.port>${liberty.var.http.port}</app.http.port>
<app.context.root>${liberty.var.app.context.root}</app.context.root>
</systemPropertyVariables>
<!-- end::testsysprops[] -->
Expand Down
10 changes: 5 additions & 5 deletions start/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<server description="Sample Liberty server">
<featureManager>
<feature>mpConfig-3.0</feature>
<feature>mpConfig-3.1</feature>
</featureManager>

<variable name="default.http.port" defaultValue="9080"/>
<variable name="default.https.port" defaultValue="9443"/>
<variable name="http.port" defaultValue="9080"/>
<variable name="https.port" defaultValue="9443"/>
<variable name="app.context.root" defaultValue="/mongo"/>

<httpEndpoint
host="*"
httpPort="${default.http.port}"
httpsPort="${default.https.port}"
httpPort="${http.port}"
httpsPort="${https.port}"
id="defaultHttpEndpoint"
/>

Expand Down
Loading