Skip to content

Commit 04f32b3

Browse files
authored
Merge pull request #20 from oracle-devrel/J17
J17
2 parents 8ecb077 + f63a3c8 commit 04f32b3

File tree

8 files changed

+290
-42
lines changed

8 files changed

+290
-42
lines changed

helidon-storefront-full/.classpath

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,43 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="src" output="target/classes" path="src/main/java">
3+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
44
<attributes>
5-
<attribute name="optional" value="true"/>
65
<attribute name="maven.pomderived" value="true"/>
6+
<attribute name="optional" value="true"/>
77
</attributes>
88
</classpathentry>
9-
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
9+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
1010
<attributes>
11+
<attribute name="test" value="true"/>
1112
<attribute name="maven.pomderived" value="true"/>
13+
<attribute name="optional" value="true"/>
1214
</attributes>
1315
</classpathentry>
14-
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
16+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
1517
<attributes>
16-
<attribute name="test" value="true"/>
17-
<attribute name="optional" value="true"/>
1818
<attribute name="maven.pomderived" value="true"/>
1919
</attributes>
2020
</classpathentry>
21-
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
21+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
2222
<attributes>
23-
<attribute name="test" value="true"/>
2423
<attribute name="maven.pomderived" value="true"/>
2524
</attributes>
2625
</classpathentry>
27-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
26+
<classpathentry kind="src" path="target/generated-sources/annotations">
2827
<attributes>
28+
<attribute name="optional" value="true"/>
2929
<attribute name="maven.pomderived" value="true"/>
30+
<attribute name="ignore_optional_problems" value="true"/>
31+
<attribute name="m2e-apt" value="true"/>
3032
</attributes>
3133
</classpathentry>
32-
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
34+
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
3335
<attributes>
36+
<attribute name="optional" value="true"/>
3437
<attribute name="maven.pomderived" value="true"/>
38+
<attribute name="ignore_optional_problems" value="true"/>
39+
<attribute name="m2e-apt" value="true"/>
40+
<attribute name="test" value="true"/>
3541
</attributes>
3642
</classpathentry>
3743
<classpathentry kind="output" path="target/classes"/>

helidon-storefront-full/.factorypath

Lines changed: 162 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.apt.aptEnabled=true
3+
org.eclipse.jdt.apt.genSrcDir=target/generated-sources/annotations
4+
org.eclipse.jdt.apt.genTestSrcDir=target/generated-test-sources/test-annotations
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
23
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
35
org.eclipse.jdt.core.compiler.compliance=17
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
49
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
510
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
6-
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
11+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
12+
org.eclipse.jdt.core.compiler.processAnnotations=enabled
713
org.eclipse.jdt.core.compiler.release=enabled
814
org.eclipse.jdt.core.compiler.source=17

helidon-storefront-full/pom.xml

Lines changed: 98 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
23
<!-- Copyright (c) 2023 Oracle and/or its affiliates.
34
45
The Universal Permissive License (UPL), Version 1.0
@@ -34,65 +35,119 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3435
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3536
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3637
SOFTWARE. -->
37-
38-
<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">
38+
<project xmlns="http://maven.apache.org/POM/4.0.0"
39+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
40+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3941
<modelVersion>4.0.0</modelVersion>
40-
41-
<parent>
42-
<groupId>io.helidon.applications</groupId>
43-
<artifactId>helidon-mp</artifactId>
44-
<version>3.1.2</version>
45-
<relativePath/>
46-
</parent>
42+
<parent>
43+
<groupId>io.helidon.applications</groupId>
44+
<artifactId>helidon-mp</artifactId>
45+
<version>3.2.12</version>
46+
<relativePath />
47+
</parent>
48+
4749
<properties>
4850
<mainClass>com.oracle.labs.helidon.storefront.Main</mainClass>
4951
<maven.compiler.source>17</maven.compiler.source>
5052
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
51-
<version.lombok>1.18.26</version.lombok>
53+
<version.lombok>1.18.36</version.lombok>
5254
<version.jib>3.3.1</version.jib>
55+
<version.jandex>3.1.2</version.jandex>
5356
<sonar.skip>true</sonar.skip>
54-
<container.image>ghcr.io/graalvm/graalvm-ce:ol9-java17-22.3.1</container.image>
57+
<container.image>ghcr.io/graalvm/jdk-community:17</container.image>
5558
</properties>
5659
<groupId>com.oracle.labs.helidon</groupId>
5760
<artifactId>storefront</artifactId>
58-
<version>${project.parent.version}</version>
59-
<name>${project.artifactId}</name>
60-
6161
<dependencies>
6262
<dependency>
6363
<groupId>io.helidon.microprofile.bundles</groupId>
6464
<artifactId>helidon-microprofile</artifactId>
6565
</dependency>
66+
<dependency>
67+
<groupId>io.helidon.microprofile.bundles</groupId>
68+
<artifactId>helidon-microprofile-core</artifactId>
69+
</dependency>
70+
<dependency>
71+
<groupId>io.helidon.microprofile.openapi</groupId>
72+
<artifactId>helidon-microprofile-openapi</artifactId>
73+
</dependency>
74+
<dependency>
75+
<groupId>io.helidon.microprofile.health</groupId>
76+
<artifactId>helidon-microprofile-health</artifactId>
77+
</dependency>
78+
<dependency>
79+
<groupId>jakarta.json.bind</groupId>
80+
<artifactId>jakarta.json.bind-api</artifactId>
81+
</dependency>
82+
<dependency>
83+
<groupId>org.glassfish.jersey.media</groupId>
84+
<artifactId>jersey-media-json-binding</artifactId>
85+
<scope>runtime</scope>
86+
</dependency>
87+
<dependency>
88+
<groupId>io.helidon.logging</groupId>
89+
<artifactId>helidon-logging-jul</artifactId>
90+
<scope>runtime</scope>
91+
</dependency>
92+
<!-- this is for pre helidon 4 -->
6693
<dependency>
6794
<groupId>org.jboss</groupId>
6895
<artifactId>jandex</artifactId>
6996
<scope>runtime</scope>
7097
<optional>true</optional>
7198
</dependency>
99+
<!-- this is for helidon 4 and later
100+
<dependency>
101+
<groupId>io.smallrye</groupId>
102+
<artifactId>jandex</artifactId>
103+
<scope>runtime</scope>
104+
</dependency>-->
72105
<dependency>
73106
<groupId>jakarta.activation</groupId>
74107
<artifactId>jakarta.activation-api</artifactId>
75-
<scope>runtime</scope>
108+
</dependency>
109+
<dependency>
110+
<groupId>org.eclipse.microprofile.metrics</groupId>
111+
<artifactId>microprofile-metrics-api</artifactId>
112+
</dependency>
113+
<dependency>
114+
<groupId>io.helidon.microprofile.metrics</groupId>
115+
<artifactId>helidon-microprofile-metrics</artifactId>
76116
</dependency>
77117
<dependency>
78118
<groupId>org.junit.jupiter</groupId>
79119
<artifactId>junit-jupiter-api</artifactId>
80120
<scope>test</scope>
81-
</dependency> <!-- Utilities -->
121+
</dependency>
122+
<!-- for helidon 4 and later
123+
<dependency>
124+
<groupId>io.helidon.microprofile.testing</groupId>
125+
<artifactId>helidon-microprofile-testing-junit5</artifactId>
126+
<scope>test</scope>
127+
</dependency>
128+
-->
129+
<dependency>
130+
<groupId>org.hamcrest</groupId>
131+
<artifactId>hamcrest-all</artifactId>
132+
<scope>test</scope>
133+
</dependency>
134+
<!-- Utilities -->
82135
<!-- Lombok does the auto method creation -->
83136
<dependency>
84137
<groupId>org.projectlombok</groupId>
85138
<artifactId>lombok</artifactId>
86139
<version>${version.lombok}</version>
87140
<scope>provided</scope>
88141
</dependency>
89-
<!-- not quite sure why it fails to run withouh this entry, given this package is imported elsewhere,
142+
<!-- not quite sure why it fails to run withouh this entry, given this
143+
package is imported elsewhere,
90144
but it seems to fail if this isn't present on my system at least -->
91145
<dependency>
92146
<groupId>com.fasterxml.jackson.core</groupId>
93147
<artifactId>jackson-databind</artifactId>
94148
</dependency>
95-
<!-- SLF4J is a logging facade that let's us change the actual logger used
149+
<!-- SLF4J is a logging facade that let's us change the actual logger
150+
used
96151
under the covers without changing our code, slf4j-jdk14 is for output to
97152
the standard Java logging utilities. By making the dependency declaration
98153
below Maven will bring in the core SLF4J jar files, and also the SLJ4J to
@@ -105,11 +160,20 @@ SOFTWARE. -->
105160
<groupId>org.slf4j</groupId>
106161
<artifactId>slf4j-jdk14</artifactId>
107162
</dependency>
108-
<!-- tracing calls -->
109-
<dependency>
110-
<groupId>io.helidon.tracing</groupId>
111-
<artifactId>helidon-tracing-zipkin</artifactId>
112-
</dependency>
163+
164+
<!-- <dependency>-->
165+
<!-- <groupId>org.jboss</groupId>-->
166+
<!-- <artifactId>jandex</artifactId>-->
167+
<!-- <version>${version.jandex}</version>-->
168+
<!-- <scope>runtime</scope>-->
169+
<!-- <optional>true</optional>-->
170+
<!-- </dependency>-->
171+
172+
<!-- tracing calls -->
173+
<!-- <dependency>-->
174+
<!-- <groupId>io.helidon.tracing</groupId>-->
175+
<!-- <artifactId>helidon-tracing-zipkin</artifactId>-->
176+
<!-- </dependency>-->
113177
</dependencies>
114178

115179
<build>
@@ -123,6 +187,17 @@ SOFTWARE. -->
123187
</execution>
124188
</executions>
125189
</plugin>
190+
<!-- post helidon 4
191+
<plugin>
192+
<groupId>io.smallrye</groupId>
193+
<artifactId>jandex-maven-plugin</artifactId>
194+
<executions>
195+
<execution>
196+
<id>make-index</id>
197+
</execution>
198+
</executions>
199+
</plugin>-->
200+
<!-- pre helidon 4 -->
126201
<plugin>
127202
<groupId>org.jboss.jandex</groupId>
128203
<artifactId>jandex-maven-plugin</artifactId>

helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/Main.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ private static Config buildConfig() {
9595
// need to
9696
// build it before we can add it to the list. again if there were three or less
9797
// we could pass the ConfigSource builder directly into the sources method of
98-
// the
99-
// config builder.
98+
// the config builder.
10099
List<Supplier<? extends ConfigSource>> configSourcesToScan = new ArrayList<>(5);
101100
configSourcesToScan.add(ConfigSources.file("conf/storefront-config.yaml")
102101
.pollingStrategy(PollingStrategies.regular(Duration.ofSeconds(5))).optional().build());

helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/data/ItemRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Software and the Larger Work(s), and to sublicense the foregoing rights on
4545
@Data
4646
@NoArgsConstructor
4747
@AllArgsConstructor
48-
@Schema(name = "ItemRequest", description = "Details of a Item reservation request", example = "{\"requestedItem\", \"Pin\", \"requestedCount\",5}")
48+
@Schema(name = "ItemRequest", description = "Details of a Item reservation request", example = "{\"requestedItem\": \"Pin\", \"requestedCount\": 5}")
4949
public class ItemRequest {
5050
@Schema(required = true, description = "Name of the item being requested", example = "Pin")
5151
private String requestedItem;

helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/resources/StorefrontResource.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ Software and the Larger Work(s), and to sublicense the foregoing rights on
4545
import org.eclipse.microprofile.faulttolerance.Fallback;
4646
import org.eclipse.microprofile.faulttolerance.Timeout;
4747
import org.eclipse.microprofile.metrics.annotation.Counted;
48-
import org.eclipse.microprofile.metrics.annotation.Metered;
4948
import org.eclipse.microprofile.metrics.annotation.Timed;
5049
import org.eclipse.microprofile.openapi.annotations.Operation;
5150
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
@@ -137,9 +136,6 @@ public class StorefrontResource {
137136
@Fallback(fallbackMethod = "failedListStockItem")
138137
// add a timer to track how long is spent in this call
139138
@Timed(name = "listAllStockTimer")
140-
// add a Meter to track how often we're called, absolute=true means the name
141-
// given is used directly and not added to the class
142-
@Metered(name = "listAllStockMeter", absolute = true)
143139
@Operation(summary = "List stock items", description = "Returns a list of all of the stock items currently held in the database (the list may be empty if there are no items)")
144140
@APIResponse(description = "A set of ItemDetails representing the current data in the database", responseCode = "200", content = @Content(schema = @Schema(name = "ItemDetails", implementation = ItemDetails.class, type = SchemaType.ARRAY), example = "[{\"itemCount\": 10, \"itemName\": \"Pencil\"},"
145141
+ "{\"itemCount\": 50, \"itemName\": \"Eraser\"}," + "{\"itemCount\": 4600, \"itemName\": \"Pin\"},"
@@ -191,7 +187,7 @@ public Collection<ItemDetails> listAllStock() {
191187
@APIResponse(description = "The requested change does not meet the minimum level required for the change (i.e. is <= the minimumChange value)", responseCode = "406")
192188
@APIResponse(description = "There are not enough of the requested item to fulfil your request", responseCode = "409")
193189
public ItemDetails reserveStockItem(
194-
@RequestBody(description = "The details of the item being requested", required = true, content = @Content(schema = @Schema(name = "ItemRequest", implementation = ItemRequest.class), example = "{\"requestedItem\",\"Pencil\",\"requestedCount\",5}")) ItemRequest itemRequest,
190+
@RequestBody(description = "The details of the item being requested", required = true, content = @Content(schema = @Schema(name = "ItemRequest", implementation = ItemRequest.class), example = "{\"requestedItem\": \"Pencil\",\"requestedCount\": 5}")) ItemRequest itemRequest,
195191
@Context SecurityContext securityContext)
196192
throws MinimumChangeException, UnknownItemException, NotEnoughItemsException {
197193
log.info("Requesting the reservation of " + itemRequest.getRequestedCount() + " items of "

0 commit comments

Comments
 (0)