Skip to content

Commit 2f7cef2

Browse files
authored
Merge pull request #181 from OpenLiberty/staging
Merge staging to prod: Update to MP6 and JEE10
2 parents 747eca3 + 9936111 commit 2f7cef2

36 files changed

+390
-343
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ jobs:
4646

4747
steps:
4848
- uses: actions/checkout@v2
49-
- name: Set up JDK 8
49+
- name: Set up JDK 11
5050
uses: actions/setup-java@v1
5151
with:
52-
java-version: 8
52+
java-version: 11
5353
- run: unset _JAVA_OPTIONS
5454

5555
- name: Run tests

LICENSE

Lines changed: 246 additions & 172 deletions
Large diffs are not rendered by default.

README.adoc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2018, 2022 IBM Corporation and others.
1+
// Copyright (c) 2018, 2023 IBM Corporation and others.
22
// Licensed under Creative Commons Attribution-NoDerivatives
33
// 4.0 International (CC BY-ND 4.0)
44
// https://creativecommons.org/licenses/by-nd/4.0/
@@ -62,7 +62,7 @@ Access the `inventory` service at the http://localhost:9080/inventory/systems[ht
6262

6363
Next, point your browser to the https://localhost:9443/metrics[http://localhost:9443/metrics^] MicroProfile Metrics endpoint. Log in as the `admin` user with `adminpwd` as the password. You can see both the system and application metrics in a text format.
6464

65-
To see only the application metrics, point your browser to https://localhost:9443/metrics/application[https://localhost:9443/metrics/application^].
65+
To see only the application metrics, point your browser to https://localhost:9443/metrics?scope=application[https://localhost:9443/metrics?scope=application^].
6666
endif::[]
6767

6868
// cloud-hosted guide instructions:
@@ -88,7 +88,7 @@ curl -k --user admin:adminpwd https://localhost:9443/metrics
8888

8989
To see only the application metrics, run the following curl command:
9090
```bash
91-
curl -k --user admin:adminpwd https://localhost:9443/metrics/application
91+
curl -k --user admin:adminpwd https://localhost:9443/metrics?scope=application
9292
```
9393
endif::[]
9494

@@ -128,14 +128,14 @@ application_inventoryAccessCount_total 1
128128

129129
// static guide instructions:
130130
ifndef::cloud-hosted[]
131-
To see only the system metrics, point your browser to https://localhost:9443/metrics/base[https://localhost:9443/metrics/base^].
131+
To see only the system metrics, point your browser to https://localhost:9443/metrics?scope=base[https://localhost:9443/metrics?scope=base^].
132132
endif::[]
133133

134134
// cloud-hosted guide instructions:
135135
ifdef::cloud-hosted[]
136136
To see only the system metrics, run the following curl command:
137137
```bash
138-
curl -k --user admin:adminpwd https://localhost:9443/metrics/base
138+
curl -k --user admin:adminpwd https://localhost:9443/metrics?scope=base
139139
```
140140
endif::[]
141141

@@ -156,14 +156,14 @@ base_classloader_loadedClasses_count 11231
156156

157157
// static guide instructions:
158158
ifndef::cloud-hosted[]
159-
To see only the vendor metrics, point your browser to https://localhost:9443/metrics/vendor[https://localhost:9443/metrics/vendor^].
159+
To see only the vendor metrics, point your browser to https://localhost:9443/metrics?scope=vendor[https://localhost:9443/metrics?scope=vendor^].
160160
endif::[]
161161

162162
// cloud-hosted guide instructions:
163163
ifdef::cloud-hosted[]
164164
To see only the vendor metrics, run the following curl command:
165165
```bash
166-
curl -k --user admin:adminpwd https://localhost:9443/metrics/vendor
166+
curl -k --user admin:adminpwd https://localhost:9443/metrics?scope=vendor
167167
```
168168
endif::[]
169169

@@ -277,7 +277,7 @@ Apply the [hotspot=gaugeForGetTotal]`@Gauge` annotation to the [hotspot=getTotal
277277
|===
278278

279279
Additional information about these annotations, relevant metadata fields, and more are available at
280-
the https://openliberty.io/docs/latest/reference/javadoc/microprofile-4.0-javadoc.html#package=org/eclipse/microprofile/metrics/annotation/package-frame.html&class=org/eclipse/microprofile/metrics/annotation/package-summary.html[MicroProfile Metrics Annotation Javadoc^].
280+
the https://openliberty.io/docs/latest/reference/javadoc/microprofile-5.0-javadoc.html#package=org/eclipse/microprofile/metrics/annotation/package-frame.html&class=org/eclipse/microprofile/metrics/annotation/package-summary.html[MicroProfile Metrics Annotation Javadoc^].
281281

282282

283283
== Enabling vendor metrics for the microservices
@@ -290,7 +290,7 @@ include::finish/src/main/liberty/config/server.xml[]
290290

291291
MicroProfile Metrics API implementers can provide vendor metrics in the same forms as the base and application metrics do. Open Liberty as a vendor supplies server component metrics when the [hotspot=mpMetrics]`mpMetrics` feature is enabled in the [hotspot]`server.xml` configuration file.
292292

293-
You can see the vendor-only metrics in the `metrics/vendor` endpoint. You see metrics from the runtime components, such as Web Application, ThreadPool and Session Management. Note that these metrics are specific to the Liberty application server. Different vendors may provide other metrics. Visit the https://openliberty.io/docs/ref/general/#metrics-list.html[Metrics reference list^] for more information.
293+
You can see the vendor-only metrics in the `metrics?scope=vendor` endpoint. You see metrics from the runtime components, such as Web Application, ThreadPool and Session Management. Note that these metrics are specific to the Liberty application server. Different vendors may provide other metrics. Visit the https://openliberty.io/docs/ref/general/#metrics-list.html[Metrics reference list^] for more information.
294294

295295
// =================================================================================================
296296
// Building and running the application
@@ -304,9 +304,9 @@ The Open Liberty server was started in development mode at the beginning of the
304304
ifndef::cloud-hosted[]
305305
Point your browser to the https://localhost:9443/metrics[https://localhost:9443/metrics^] URL to review all the metrics that are enabled through MicroProfile Metrics. Log in with `admin` as your username and `adminpwd` as your password. You see only the system and vendor metrics because the server just started, and the `inventory` service has not been accessed.
306306

307-
Next, point your browser to the http://localhost:9080/inventory/systems[http://localhost:9080/inventory/systems^] URL. Reload the https://localhost:9443/metrics[https://localhost:9443/metrics^] URL, or access only the application metrics at the https://localhost:9443/metrics/application[https://localhost:9443/metrics/application^] URL.
307+
Next, point your browser to the http://localhost:9080/inventory/systems[http://localhost:9080/inventory/systems^] URL. Reload the https://localhost:9443/metrics[https://localhost:9443/metrics^] URL, or access only the application metrics at the https://localhost:9443/metrics?scope=application[https://localhost:9443/metrics?scope=application^] URL.
308308

309-
You can see the system metrics in the https://localhost:9443/metrics/base[^] URL as well as see the vendor metrics in the https://localhost:9443/metrics/vendor[^] URL.
309+
You can see the system metrics in the https://localhost:9443/metrics?scope=base[^] URL as well as see the vendor metrics in the https://localhost:9443/metrics?scope=vendor[^] URL.
310310
endif::[]
311311

312312
// cloud-hosted guide instructions:
@@ -328,17 +328,17 @@ curl -k --user admin:adminpwd https://localhost:9443/metrics
328328

329329
or access only the application metrics by running following curl command:
330330
```bash
331-
curl -k --user admin:adminpwd https://localhost:9443/metrics/application
331+
curl -k --user admin:adminpwd https://localhost:9443/metrics?scope=application
332332
```
333333

334334
You can see the system metrics by running following curl command:
335335
```bash
336-
curl -k --user admin:adminpwd https://localhost:9443/metrics/base
336+
curl -k --user admin:adminpwd https://localhost:9443/metrics?scope=base
337337
```
338338

339339
as well as see the vendor metrics by running following curl command:
340340
```bash
341-
curl -k --user admin:adminpwd https://localhost:9443/metrics/vendor
341+
curl -k --user admin:adminpwd https://localhost:9443/metrics?scope=vendor
342342
```
343343
endif::[]
344344

@@ -369,13 +369,13 @@ InventoryManager.java
369369
include::finish/src/main/java/io/openliberty/guides/inventory/InventoryManager.java[]
370370
----
371371

372-
* The [hotspot=testPropertiesRequestTimeMetric file=0]`testPropertiesRequestTimeMetric()` test case validates the [hotspot=timedForGet file=1]`@Timed` metric. The test case sends a request to the `\http://localhost:9080/inventory/systems/localhost` URL to access the `inventory` service, which adds the `localhost` host to the inventory. Next, the test case makes a connection to the `\https://localhost:9443/metrics/application` URL to retrieve application metrics as plain text. Then, it asserts whether the time that is needed to retrieve the system properties for localhost is less than 4 seconds.
372+
* The [hotspot=testPropertiesRequestTimeMetric file=0]`testPropertiesRequestTimeMetric()` test case validates the [hotspot=timedForGet file=1]`@Timed` metric. The test case sends a request to the `\http://localhost:9080/inventory/systems/localhost` URL to access the `inventory` service, which adds the `localhost` host to the inventory. Next, the test case makes a connection to the `\https://localhost:9443/metrics?scope=application` URL to retrieve application metrics as plain text. Then, it asserts whether the time that is needed to retrieve the system properties for localhost is less than 4 seconds.
373373

374374
* The [hotspot=testInventoryAccessCountMetric file=0]`testInventoryAccessCountMetric()` test case validates the [hotspot=countedForList file=1]`@Counted` metric. The test case obtains metric data before and after a request to the `\http://localhost:9080/inventory/systems` URL. It then asserts that the metric was increased after the URL was accessed.
375375

376376
* The [hotspot=testInventorySizeGaugeMetric file=0]`testInventorySizeGaugeMetric()` test case validates the [hotspot=gaugeForGetTotal file=1]`@Gauge` metric. The test case first ensures that the localhost is in the inventory, then looks for the [hotspot=gaugeForGetTotal file=1]`@Gauge` metric and asserts that the inventory size is greater or equal to 1.
377377

378-
* The [hotspot=testPropertiesAddTimeMetric file=0]`testPropertiesAddTimeMetric()` test case validates the [hotspot=timedForAdd file=1]`@Timed` metric. The test case sends a request to the `\http://localhost:9080/inventory/systems/localhost` URL to access the `inventory` service, which adds the `localhost` host to the inventory. Next, the test case makes a connection to the `\https://localhost:9443/metrics/application` URL to retrieve application metrics as plain text. Then, it looks for the [hotspot=timedForAdd file=1]`@Timed` metric and asserts true if the metric exists.
378+
* The [hotspot=testPropertiesAddTimeMetric file=0]`testPropertiesAddTimeMetric()` test case validates the [hotspot=timedForAdd file=1]`@Timed` metric. The test case sends a request to the `\http://localhost:9080/inventory/systems/localhost` URL to access the `inventory` service, which adds the `localhost` host to the inventory. Next, the test case makes a connection to the `\https://localhost:9443/metrics?scope=application` URL to retrieve application metrics as plain text. Then, it looks for the [hotspot=timedForAdd file=1]`@Timed` metric and asserts true if the metric exists.
379379

380380
The [hotspot=oneTimeSetup file=0]`oneTimeSetup()` method retrieves the port number for the server and builds a base URL string to set up the tests. Apply the [hotspot=BeforeAll file=0]`@BeforeAll` annotation to this method to run it before any of the test cases.
381381

finish/pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1313
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
14-
<maven.compiler.source>1.8</maven.compiler.source>
15-
<maven.compiler.target>1.8</maven.compiler.target>
14+
<maven.compiler.source>11</maven.compiler.source>
15+
<maven.compiler.target>11</maven.compiler.target>
1616
<!-- Liberty configuration -->
1717
<liberty.var.default.http.port>9080</liberty.var.default.http.port>
1818
<liberty.var.default.https.port>9443</liberty.var.default.https.port>
@@ -23,35 +23,35 @@
2323
<dependency>
2424
<groupId>jakarta.platform</groupId>
2525
<artifactId>jakarta.jakartaee-api</artifactId>
26-
<version>9.1.0</version>
26+
<version>10.0.0</version>
2727
<scope>provided</scope>
2828
</dependency>
2929
<dependency>
3030
<groupId>org.eclipse.microprofile</groupId>
3131
<!-- tag::microprofile[] -->
3232
<artifactId>microprofile</artifactId>
3333
<!-- end::microprofile[] -->
34-
<version>5.0</version>
34+
<version>6.0</version>
3535
<type>pom</type>
3636
<scope>provided</scope>
3737
</dependency>
3838
<!-- For tests -->
3939
<dependency>
4040
<groupId>org.junit.jupiter</groupId>
4141
<artifactId>junit-jupiter</artifactId>
42-
<version>5.8.2</version>
42+
<version>5.9.2</version>
4343
<scope>test</scope>
4444
</dependency>
4545
<dependency>
4646
<groupId>org.jboss.resteasy</groupId>
4747
<artifactId>resteasy-client</artifactId>
48-
<version>6.0.0.Final</version>
48+
<version>6.2.3.Final</version>
4949
<scope>test</scope>
5050
</dependency>
5151
<dependency>
5252
<groupId>org.jboss.resteasy</groupId>
5353
<artifactId>resteasy-json-binding-provider</artifactId>
54-
<version>6.0.0.Final</version>
54+
<version>6.2.3.Final</version>
5555
<scope>test</scope>
5656
</dependency>
5757
<dependency>
@@ -80,7 +80,7 @@
8080
<plugin>
8181
<groupId>org.apache.maven.plugins</groupId>
8282
<artifactId>maven-surefire-plugin</artifactId>
83-
<version>2.22.2</version>
83+
<version>3.0.0</version>
8484
</plugin>
8585
<!-- Enable liberty-maven plugin -->
8686
<plugin>
@@ -92,7 +92,7 @@
9292
<plugin>
9393
<groupId>org.apache.maven.plugins</groupId>
9494
<artifactId>maven-failsafe-plugin</artifactId>
95-
<version>2.22.2</version>
95+
<version>3.0.0</version>
9696
<configuration>
9797
<systemPropertyVariables>
9898
<http.port>${liberty.var.default.http.port}</http.port>

finish/src/main/java/io/openliberty/guides/inventory/InventoryApplication.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
/*******************************************************************************
33
* Copyright (c) 2017, 2022 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
5-
* are made available under the terms of the Eclipse Public License v1.0
5+
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
7-
* http://www.eclipse.org/legal/epl-v10.html
7+
* http://www.eclipse.org/legal/epl-2.0/
88
*
9-
* Contributors:
10-
* IBM Corporation - Initial implementation
9+
* SPDX-License-Identifier: EPL-2.0
1110
*******************************************************************************/
1211
// end::copyright[]
1312
package io.openliberty.guides.inventory;

finish/src/main/java/io/openliberty/guides/inventory/InventoryManager.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
/*******************************************************************************
33
* Copyright (c) 2017, 2022 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
5-
* are made available under the terms of the Eclipse Public License v1.0
5+
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
7-
* http://www.eclipse.org/legal/epl-v10.html
7+
* http://www.eclipse.org/legal/epl-2.0/
88
*
9-
* Contributors:
10-
* IBM Corporation - Initial implementation
9+
* SPDX-License-Identifier: EPL-2.0
1110
*******************************************************************************/
1211
// end::copyright[]
1312
// tag::InventoryManager[]

finish/src/main/java/io/openliberty/guides/inventory/InventoryResource.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
/*******************************************************************************
33
* Copyright (c) 2017, 2022 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
5-
* are made available under the terms of the Eclipse Public License v1.0
5+
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
7-
* http://www.eclipse.org/legal/epl-v10.html
7+
* http://www.eclipse.org/legal/epl-2.0/
88
*
9-
* Contributors:
10-
* IBM Corporation - Initial implementation
9+
* SPDX-License-Identifier: EPL-2.0
1110
*******************************************************************************/
1211
// end::copyright[]
1312
package io.openliberty.guides.inventory;

finish/src/main/java/io/openliberty/guides/inventory/InventoryUtils.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
/*******************************************************************************
33
* Copyright (c) 2017, 2022 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
5-
* are made available under the terms of the Eclipse Public License v1.0
5+
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
7-
* http://www.eclipse.org/legal/epl-v10.html
7+
* http://www.eclipse.org/legal/epl-2.0/
88
*
9-
* Contributors:
10-
* IBM Corporation - Initial implementation
9+
* SPDX-License-Identifier: EPL-2.0
1110
*******************************************************************************/
1211
// end::copyright[]
1312
package io.openliberty.guides.inventory;

finish/src/main/java/io/openliberty/guides/inventory/client/SystemClient.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
/*******************************************************************************
33
* Copyright (c) 2017, 2022 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
5-
* are made available under the terms of the Eclipse Public License v1.0
5+
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
7-
* http://www.eclipse.org/legal/epl-v10.html
7+
* http://www.eclipse.org/legal/epl-2.0/
88
*
9-
* Contributors:
10-
* IBM Corporation - Initial implementation
9+
* SPDX-License-Identifier: EPL-2.0
1110
*******************************************************************************/
1211
// end::copyright[]
1312
// tag::client[]

finish/src/main/java/io/openliberty/guides/inventory/client/UnknownUrlException.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
/*******************************************************************************
33
* Copyright (c) 2017, 2022 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
5-
* are made available under the terms of the Eclipse Public License v1.0
5+
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
7-
* http://www.eclipse.org/legal/epl-v10.html
7+
* http://www.eclipse.org/legal/epl-2.0/
88
*
9-
* Contributors:
10-
* IBM Corporation - Initial implementation
9+
* SPDX-License-Identifier: EPL-2.0
1110
*******************************************************************************/
1211
// end::copyright[]
1312
// tag::exception[]

0 commit comments

Comments
 (0)