Skip to content

Update to use maven wrapper #386

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

Open
wants to merge 25 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f72380c
Merge pull request #385 from OpenLiberty/staging
gkwan-ibm May 2, 2025
6f8d986
Updated to use maven wrapper
May 23, 2025
b12f80d
Update the order of imports
May 23, 2025
7af6c37
Fix import lint issues
May 23, 2025
613d509
Update InventoryServiceIT.java
AndrewSasmito May 25, 2025
b274d50
Update InventoryServiceIT.java
AndrewSasmito May 25, 2025
f3dff70
Update InventoryServiceIT.java
AndrewSasmito May 25, 2025
88627c9
Update InventoryServiceIT.java
AndrewSasmito May 25, 2025
c208036
Update InventoryServiceIT.java
AndrewSasmito May 25, 2025
f0bb2cf
Updated the imports
May 26, 2025
d27c987
Update to test with the correct java version
May 26, 2025
4b68f46
Update InventoryServiceIT.java
AndrewSasmito May 27, 2025
e6494f2
Fix typo in guide
GeeTransit May 27, 2025
071fd8e
Bump org.junit.jupiter:junit-jupiter from 5.12.2 to 5.13.0 in /start
dependabot[bot] Jun 1, 2025
0676f09
Bump org.testcontainers:kafka from 1.21.0 to 1.21.1 in /start
dependabot[bot] Jun 1, 2025
d923f89
Bump org.testcontainers:junit-jupiter from 1.21.0 to 1.21.1 in /start
dependabot[bot] Jun 1, 2025
7992bfd
Bump org.junit.jupiter:junit-jupiter from 5.12.2 to 5.13.0 in /finish
dependabot[bot] Jun 1, 2025
6cdc2f7
Bump org.testcontainers:junit-jupiter from 1.21.0 to 1.21.1 in /finish
dependabot[bot] Jun 1, 2025
0fe1bba
Bump org.testcontainers:kafka from 1.21.0 to 1.21.1 in /finish
dependabot[bot] Jun 1, 2025
b4c441a
Merge pull request #387 from OpenLiberty/dependabot/maven/start/org.j…
gkwan-ibm Jun 2, 2025
91cabb7
Merge pull request #388 from OpenLiberty/dependabot/maven/start/org.t…
gkwan-ibm Jun 2, 2025
2209be5
Merge pull request #389 from OpenLiberty/dependabot/maven/start/org.t…
gkwan-ibm Jun 2, 2025
2ac0005
Merge pull request #390 from OpenLiberty/dependabot/maven/finish/org.…
gkwan-ibm Jun 2, 2025
b3e9e9b
Merge pull request #391 from OpenLiberty/dependabot/maven/finish/org.…
gkwan-ibm Jun 2, 2025
9b89042
Merge pull request #392 from OpenLiberty/dependabot/maven/finish/org.…
gkwan-ibm Jun 2, 2025
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
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
VALIDATE_ALL_CODEBASE: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINTER_RULES_PATH: ./tools/pr-checker/linters/
FILTER_REGEX_EXCLUDE: mvnw*
VALIDATE_KUBERNETES_KUBEVAL: false
DEFAULT_BRANCH: prod
- name: Summary
Expand All @@ -53,7 +54,7 @@ jobs:
java-version: 11
- run: unset _JAVA_OPTIONS
- name: Run tests
run: sudo ../scripts/testApp.sh
run: sudo -E ../scripts/testApp.sh
- name: Post tests
if: always()
run: sudo docker images
31 changes: 28 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,36 @@ run an OpenShift build to produce runnable container images of the packaged micr
Ensure that you are in the `start` directory and run the following commands to package the `system` and `inventory`
microservices:

[role='command']
include::{common-includes}/os-tabs.adoc[]

[.tab_content.windows_section]
--
Open command prompt as an administrator and run the following command.

[role=command]
```
mvnw.cmd -pl models clean install
mvnw.cmd clean package
```
--

[.tab_content.mac_section]
--
[role=command]
```
./mvnw -pl models clean install
./mvnw clean package
```
--

[.tab_content.linux_section]
--
[role=command]
```
mvn -pl models clean install
mvn clean package
./mvnw -pl models clean install
./mvnw clean package
```
--

=== Building and pushing the images

Expand Down
Binary file added finish/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions finish/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar
6 changes: 3 additions & 3 deletions finish/inventory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>kafka</artifactId>
<version>1.21.0</version>
<version>1.21.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.12.2</version>
<version>5.13.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>1.21.0</version>
<version>1.21.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tag::copyright[]
/*******************************************************************************
* Copyright (c) 2020, 2024 IBM Corporation and others.
* Copyright (c) 2020, 2025 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 @@ -19,7 +19,6 @@
import java.time.Duration;
import java.util.List;
import java.util.Properties;

// tag::KafkaProducer[]
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerConfig;
Expand All @@ -37,16 +36,16 @@
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.GenericContainer;
// end::KafkaProducer[]
import org.testcontainers.containers.KafkaContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.images.builder.ImageFromDockerfile;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;
import org.testcontainers.kafka.ConfluentKafkaContainer;

import io.openliberty.guides.models.SystemLoad;
import io.openliberty.guides.models.SystemLoad.SystemLoadSerializer;

import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.core.GenericType;
import jakarta.ws.rs.core.Response;
Expand All @@ -70,19 +69,19 @@ public class InventoryServiceIT {
new ImageFromDockerfile("inventory:1.0-SNAPSHOT")
.withDockerfile(Paths.get("./Dockerfile"));

private static KafkaContainer kafkaContainer =
new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:latest"))
.withListener(() -> "kafka:19092")
private static ConfluentKafkaContainer confluentKafkaContainer =
new ConfluentKafkaContainer("confluentinc/cp-kafka:latest")
.withListener("kafka:19092")
.withNetwork(network);

private static GenericContainer<?> inventoryContainer =
new GenericContainer(inventoryImage)
new GenericContainer<>(inventoryImage)
.withNetwork(network)
.withExposedPorts(9085)
.waitingFor(Wait.forHttp("/health/ready").forPort(9085))
.withStartupTimeout(Duration.ofMinutes(2))
.withLogConsumer(new Slf4jLogConsumer(logger))
.dependsOn(kafkaContainer);
.dependsOn(confluentKafkaContainer);

private static InventoryResourceClient createRestClient(String urlPath) {
ClientBuilder builder = ResteasyClientBuilder.newBuilder();
Expand Down Expand Up @@ -110,7 +109,7 @@ public static void startContainers() {
urlPath = "http://localhost:9085";
} else {
System.out.println("Testing with mvn verify");
kafkaContainer.start();
confluentKafkaContainer.start();
inventoryContainer.withEnv(
"mp.messaging.connector.liberty-kafka.bootstrap.servers",
"kafka:19092");
Expand All @@ -135,7 +134,7 @@ public void setUp() {
} else {
producerProps.put(
ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,
kafkaContainer.getBootstrapServers());
confluentKafkaContainer.getBootstrapServers());
}

producerProps.put(
Expand All @@ -155,7 +154,7 @@ public void setUp() {
public static void stopContainers() {
client.resetSystems();
inventoryContainer.stop();
kafkaContainer.stop();
confluentKafkaContainer.stop();
network.close();
}

Expand Down
Loading