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

Update to MP6.1 #136

Merged
merged 4 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: gradle
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/[email protected]
with:
project-url: https://github.com/orgs/OpenLiberty/projects/26
github-token: ${{ secrets.ADMIN_BACKLOG }}
labeled: dependencies
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ build/
.project
README.html
.DS_Store
bin/
16 changes: 8 additions & 8 deletions finish/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ buildscript {
}
dependencies {
// tag::liberty-dependency[]
classpath 'io.openliberty.tools:liberty-gradle-plugin:3.5.2'
classpath 'io.openliberty.tools:liberty-gradle-plugin:3.7'
// end::liberty-dependency[]
}
}
Expand All @@ -40,25 +40,25 @@ dependencies {
// provided dependencies
// tag::providedcompile[]
providedCompile 'jakarta.platform:jakarta.jakartaee-api:10.0.0'
providedCompile 'org.eclipse.microprofile:microprofile:6.0'
providedCompile 'org.eclipse.microprofile:microprofile:6.1'
// end::providedcompile[]

// test dependencies
// tag::testimplementation[]
// tag::junit[]
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
// end::junit[]
// tag::commons[]
testImplementation 'org.apache.httpcomponents:httpclient:4.5.14'
testImplementation 'org.apache.httpcomponents.client5:httpclient5:5.3.1'
// end::commons[]
// end::testimplementation[]
}
// end::dependencies[]

// tag::ext[]
ext {
liberty.server.var.'default.http.port' = '9080'
liberty.server.var.'default.https.port' = '9443'
liberty.server.var.'http.port' = '9080'
liberty.server.var.'https.port' = '9443'
liberty.server.var.'app.context.root' = project.name
}
// end::ext[]
Expand All @@ -67,7 +67,7 @@ ext {
task openBrowser {
description = 'Open browser to the running application'
doLast {
String port = liberty.server.var.'default.http.port'
String port = liberty.server.var.'http.port'
String context = liberty.server.var.'app.context.root'
String URL = "http://localhost:" + port + "/" + context + "/" + "servlet"
java.awt.Desktop.desktop.browse URL.toURI()
Expand All @@ -87,7 +87,7 @@ test {
}
// tag::systemproperty[]
// tag::httpport[]
systemProperty 'http.port', liberty.server.var.'default.http.port'
systemProperty 'http.port', liberty.server.var.'http.port'
// end::httpport[]
// tag::contextroot[]
systemProperty 'context.root', liberty.server.var.'app.context.root'
Expand Down
2 changes: 1 addition & 1 deletion finish/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<feature>servlet-6.0</feature>
</featureManager>

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

<webApplication id="GradleSample" location="GradleSample.war" contextRoot="${app.context.root}" />
</server>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tag::copyright[]
/*******************************************************************************
* Copyright (c) 2017, 2023 IBM Corporation and others.
* Copyright (c) 2017, 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 @@ -18,11 +18,11 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.apache.http.HttpStatus;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.hc.client5.http.classic.methods.HttpGet;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.hc.core5.http.HttpStatus;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
// end::import[]
Expand All @@ -46,15 +46,15 @@ public static void init() {
// end::test[]
public void testServlet() throws Exception {

CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpClient client = HttpClients.createDefault();
HttpGet httpGet = new HttpGet(webURL);
CloseableHttpResponse response = null;

// tag::try[]
try {
response = client.execute(httpGet);

int statusCode = response.getStatusLine().getStatusCode();
int statusCode = response.getCode();
assertEquals(HttpStatus.SC_OK, statusCode, "HTTP GET failed");

BufferedReader reader = new BufferedReader(new InputStreamReader(
Expand All @@ -69,7 +69,6 @@ public void testServlet() throws Exception {
"Unexpected response body: " + buffer.toString());
} finally {
response.close();
httpGet.releaseConnection();
}
// end::try[]
}
Expand Down
2 changes: 1 addition & 1 deletion start/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<feature>servlet-6.0</feature>
</featureManager>

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

<webApplication id="GradleSample" location="GradleSample.war" contextRoot="${app.context.root}" />
</server>
Loading