Skip to content

Commit cd5846f

Browse files
committed
refactor event hash generator: rename packages
add support for Quarkus arc deployments
1 parent 8ea43c6 commit cd5846f

File tree

48 files changed

+821
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+821
-254
lines changed

.github/workflows/maven-cli.yml

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
steps:
1717
- name: checkout from git
1818
uses: actions/checkout@v3
19-
- name: Set up JDK 17
20-
uses: actions/setup-java@v3
19+
- name: Set up GraalVM 21
20+
uses: graalvm/setup-graalvm@v1
2121
with:
22-
java-version: '17'
23-
distribution: 'temurin'
22+
java-version: '21'
23+
distribution: 'graalvm-community'
2424
cache: maven
2525
- name: Install gpg secret key
2626
run: |
@@ -79,7 +79,7 @@ jobs:
7979
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
8080
with:
8181
upload_url: ${{steps.create_release.outputs.upload_url}}
82-
asset_path: 'quarkus-app/target/openepcis-event-hash-generator-service-runner.jar'
82+
asset_path: 'quarkus/quarkus-app/target/openepcis-event-hash-generator-service-runner.jar'
8383
asset_name: 'openepcis-event-hash-generator-service-${{env.GIT_TAG_NAME}}.jar'
8484
asset_content_type: application/java-archive
8585
- name: 'Upload Release CLI Asset'
@@ -139,11 +139,11 @@ jobs:
139139
username: ${{github.actor}}
140140
password: ${{secrets.GITHUB_TOKEN}}
141141

142-
- name: Set up JDK 17
143-
uses: actions/setup-java@v3
142+
- name: Set up GraalVM 21
143+
uses: graalvm/setup-graalvm@v1
144144
with:
145-
java-version: '17'
146-
distribution: 'temurin'
145+
java-version: '21'
146+
distribution: 'graalvm-community'
147147
cache: maven
148148

149149
- name: "Prepare Build"
@@ -152,7 +152,7 @@ jobs:
152152
153153
- name: "Build ${{matrix.platform}} native Image"
154154
run: |
155-
mvn --no-transfer-progress --batch-mode -Pci-build package -Dnative -DskipTests -f ./quarkus-app/pom.xml \
155+
mvn --no-transfer-progress --batch-mode -Pci-build package -Dnative -DskipTests -f ./quarkus/quarkus-app/pom.xml \
156156
-Dquarkus.native.container-build=true \
157157
-Dquarkus.container-image.build=true \
158158
-Dquarkus.container-image.name=event-hash-generator-service-native \
@@ -232,11 +232,11 @@ jobs:
232232
id: builder
233233
uses: docker/setup-buildx-action@v1
234234

235-
- name: Set up JDK 17
236-
uses: actions/setup-java@v3
235+
- name: Set up GraalVM 21
236+
uses: graalvm/setup-graalvm@v1
237237
with:
238-
java-version: '17'
239-
distribution: 'temurin'
238+
java-version: '21'
239+
distribution: 'graalvm-community'
240240
cache: maven
241241

242242
- name: "Prepare Build"
@@ -246,7 +246,7 @@ jobs:
246246
- name: "Build linux/amd64 Image"
247247
run: |
248248
mvn --no-transfer-progress --batch-mode \
249-
clean package -Pci-build -f ./quarkus-app/pom.xml \
249+
clean package -Pci-build -f ./quarkus/quarkus-app/pom.xml \
250250
-Dquarkus.container-image.name=event-hash-generator-service \
251251
-Dquarkus.container-image.build=true \
252252
-Dquarkus.container-image.registry=ghcr.io \
@@ -258,7 +258,7 @@ jobs:
258258
- name: "Build linux/arm64 Image"
259259
run: |
260260
mvn --no-transfer-progress --batch-mode \
261-
clean package -Pci-build -f ./quarkus-app/pom.xml \
261+
clean package -Pci-build -f ./quarkus/quarkus-app/pom.xml \
262262
-Dquarkus.container-image.name=event-hash-generator-service \
263263
-Dquarkus.container-image.build=true \
264264
-Dquarkus.container-image.registry=ghcr.io \
@@ -290,16 +290,19 @@ jobs:
290290

291291
strategy:
292292
matrix:
293-
os: ['ubuntu-latest', 'ubuntu-22.04-arm64', 'macos-latest', 'windows-latest']
293+
os: ['ubuntu-latest', 'ubuntu-22.04-arm64', "macos-13", 'macos-latest', 'windows-latest']
294294
include:
295295
- os: 'ubuntu-latest'
296296
label: 'linux-amd64'
297297
exe: ""
298298
- os: 'ubuntu-22.04-arm64'
299299
label: 'linux-arm64'
300300
exe: ""
301+
- os: 'macos-13'
302+
label: 'mac-x64'
303+
exe: ""
301304
- os: 'macos-latest'
302-
label: 'mac'
305+
label: 'mac-arm'
303306
exe: ""
304307
- os: 'windows-latest'
305308
label: 'windows'
@@ -330,10 +333,10 @@ jobs:
330333
run: |
331334
echo "::set-env name=UPLOAD_URL::$(cat upload_url.txt)"
332335
333-
- name: Set up GraalVM
336+
- name: Set up GraalVM 21
334337
uses: graalvm/setup-graalvm@v1
335338
with:
336-
java-version: '17'
339+
java-version: '21'
337340
distribution: 'graalvm-community'
338341
native-image-job-reports: 'true'
339342
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -344,7 +347,7 @@ jobs:
344347
345348
- name: "Build Native Quarkus Executable"
346349
run: |
347-
mvn --no-transfer-progress --batch-mode clean package -Pnative -Pci-build -DskipTests -f ./quarkus-app/pom.xml
350+
mvn --no-transfer-progress --batch-mode clean package -Pnative -Pci-build -DskipTests -f ./quarkus/quarkus-app/pom.xml
348351
349352
- name: 'Release Native Quarkus Executable'
350353
if: success() && contains(github.ref, 'v')
@@ -355,24 +358,27 @@ jobs:
355358
with:
356359
upload_url: ${{env.UPLOAD_URL}}
357360
asset_name: 'openepcis-event-hash-generator-service-runner-${{env.GIT_TAG_NAME}}-${{matrix.label}}${{matrix.exe}}'
358-
asset_path: 'quarkus-app/target/openepcis-event-hash-generator-service-runner${{matrix.exe}}'
361+
asset_path: 'quarkus/quarkus-app/target/openepcis-event-hash-generator-service-runner${{matrix.exe}}'
359362
asset_content_type: application/octet-stream
360363

361364
build-cli-native-executable:
362365
name: 'Build CLI Native Executable'
363366
needs: [build-jar-job]
364367
strategy:
365368
matrix:
366-
os: ['ubuntu-latest', 'ubuntu-22.04-arm64', 'macos-latest', 'windows-latest']
369+
os: ['ubuntu-latest', 'ubuntu-22.04-arm64', "macos-13", 'macos-latest', 'windows-latest']
367370
include:
368371
- os: 'ubuntu-latest'
369372
label: 'linux-amd64'
370373
exe: ""
371374
- os: 'ubuntu-22.04-arm64'
372375
label: 'linux-arm64'
373376
exe: ""
377+
- os: 'macos-13'
378+
label: 'mac-x64'
379+
exe: ""
374380
- os: 'macos-latest'
375-
label: 'mac'
381+
label: 'mac-arm'
376382
exe: ""
377383
- os: 'windows-latest'
378384
label: 'windows'
@@ -382,13 +388,11 @@ jobs:
382388
- name: checkout from git
383389
uses: actions/checkout@v3
384390

385-
- name: Set up GraalVM
391+
- name: Set up GraalVM 21
386392
uses: graalvm/setup-graalvm@v1
387393
with:
388-
java-version: '17'
394+
java-version: '21'
389395
distribution: 'graalvm-community'
390-
native-image-job-reports: 'true'
391-
github-token: ${{ secrets.GITHUB_TOKEN }}
392396

393397
- name: 'Get Version Number'
394398
env:

cli/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
<transformers>
9595
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
9696
<manifestEntries>
97-
<Main-Class>io.openepcis.epc.eventhash.main.HashGenerator</Main-Class>
97+
<Main-Class>io.openepcis.eventhash.main.HashGenerator</Main-Class>
9898
<Specification-Title>${project.artifactId}</Specification-Title>
9999
<Specification-Version>${project.version}</Specification-Version>
100100
<Implementation-Title>${project.artifactId}</Implementation-Title>
@@ -136,7 +136,7 @@
136136
</executions>
137137
<configuration>
138138
<imageName>epcis-event-hash</imageName>
139-
<mainClass>io.openepcis.epc.eventhash.main.HashGenerator</mainClass>
139+
<mainClass>io.openepcis.eventhash.main.HashGenerator</mainClass>
140140
<buildArgs>
141141
<arg>--enable-all-security-services</arg>
142142
<arg>--enable-http</arg>

cli/src/main/java/io/openepcis/epc/eventhash/main/HashGenerator.java renamed to cli/src/main/java/io/openepcis/eventhash/main/HashGenerator.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.openepcis.epc.eventhash.main;
16+
package io.openepcis.eventhash.main;
1717

18-
import io.openepcis.epc.eventhash.EventHashGenerator;
18+
import io.openepcis.eventhash.EventHashGenerator;
1919
import java.io.*;
20-
import java.time.temporal.ChronoUnit;
2120
import java.util.*;
2221
import java.util.concurrent.ExecutorService;
2322
import java.util.concurrent.Executors;

core/src/main/java/io/openepcis/epc/eventhash/ContextNode.java renamed to core/src/main/java/io/openepcis/eventhash/ContextNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.openepcis.epc.eventhash;
16+
package io.openepcis.eventhash;
1717

1818
import com.fasterxml.jackson.databind.JsonNode;
1919
import com.fasterxml.jackson.databind.node.ArrayNode;
2020
import io.openepcis.constants.CBVVersion;
2121
import io.openepcis.constants.EPCIS;
22-
import io.openepcis.epc.eventhash.constant.ConstantEventHashInfo;
22+
import io.openepcis.eventhash.constant.ConstantEventHashInfo;
2323
import io.openepcis.epc.translator.util.ConverterUtil;
2424
import lombok.Getter;
2525
import lombok.NoArgsConstructor;
@@ -29,7 +29,7 @@
2929
import java.util.*;
3030
import java.util.stream.Collectors;
3131

32-
import static io.openepcis.epc.eventhash.constant.ConstantEventHashInfo.*;
32+
import static io.openepcis.eventhash.constant.ConstantEventHashInfo.*;
3333

3434
/**
3535
* This class is utilized by EventHash and SaxHandler during the parsing of XML/JSON EPCIS document

core/src/main/java/io/openepcis/epc/eventhash/DocumentWrapperSupport.java renamed to core/src/main/java/io/openepcis/eventhash/DocumentWrapperSupport.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.openepcis.epc.eventhash;
16+
package io.openepcis.eventhash;
1717

1818
import com.fasterxml.jackson.core.JsonFactory;
1919
import com.fasterxml.jackson.core.JsonParser;
2020
import com.fasterxml.jackson.core.JsonToken;
2121
import com.fasterxml.jackson.databind.JsonNode;
22-
import io.openepcis.epc.eventhash.exception.EventHashException;
23-
import jakarta.inject.Inject;
22+
import io.openepcis.eventhash.exception.EventHashException;
2423
import jakarta.inject.Singleton;
2524
import lombok.RequiredArgsConstructor;
2625
import org.eclipse.microprofile.context.ManagedExecutor;

core/src/main/java/io/openepcis/epc/eventhash/EventHashGenerator.java renamed to core/src/main/java/io/openepcis/eventhash/EventHashGenerator.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.openepcis.epc.eventhash;
16+
package io.openepcis.eventhash;
1717

1818
import com.fasterxml.jackson.databind.JsonNode;
1919
import com.fasterxml.jackson.databind.node.ObjectNode;
2020
import io.openepcis.constants.CBVVersion;
2121
import io.openepcis.constants.EPCIS;
22-
import io.openepcis.epc.eventhash.constant.ConstantEventHashInfo;
23-
import io.openepcis.epc.eventhash.exception.EventHashException;
22+
import io.openepcis.eventhash.constant.ConstantEventHashInfo;
23+
import io.openepcis.eventhash.exception.EventHashException;
2424
import io.openepcis.reactive.publisher.ObjectNodePublisher;
2525
import io.smallrye.mutiny.Multi;
2626
import io.smallrye.mutiny.subscription.MultiEmitter;
@@ -31,7 +31,6 @@
3131
import java.util.function.Consumer;
3232
import javax.xml.parsers.SAXParserFactory;
3333

34-
import lombok.Getter;
3534
import lombok.extern.slf4j.Slf4j;
3635
import org.apache.commons.lang3.StringUtils;
3736

core/src/main/java/io/openepcis/epc/eventhash/HashIdGenerator.java renamed to core/src/main/java/io/openepcis/eventhash/HashIdGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.openepcis.epc.eventhash;
16+
package io.openepcis.eventhash;
1717

1818
import io.openepcis.constants.CBVVersion;
1919
import jakarta.xml.bind.DatatypeConverter;

core/src/main/java/io/openepcis/epc/eventhash/HashNodeComparator.java renamed to core/src/main/java/io/openepcis/eventhash/HashNodeComparator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.openepcis.epc.eventhash;
16+
package io.openepcis.eventhash;
1717

1818
import java.util.ArrayList;
1919
import java.util.Comparator;

core/src/main/java/io/openepcis/epc/eventhash/SaxHandler.java renamed to core/src/main/java/io/openepcis/eventhash/SaxHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.openepcis.epc.eventhash;
16+
package io.openepcis.eventhash;
1717

1818
import io.openepcis.constants.EPCIS;
19-
import io.openepcis.epc.eventhash.constant.ConstantEventHashInfo;
19+
import io.openepcis.eventhash.constant.ConstantEventHashInfo;
2020
import io.smallrye.mutiny.subscription.MultiEmitter;
2121
import java.util.ArrayDeque;
2222
import java.util.Deque;

core/src/main/java/io/openepcis/epc/eventhash/TemplateNodeMap.java renamed to core/src/main/java/io/openepcis/eventhash/TemplateNodeMap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.openepcis.epc.eventhash;
16+
package io.openepcis.eventhash;
1717

1818
import io.openepcis.constants.EPCIS;
19-
import io.openepcis.epc.eventhash.constant.ConstantEventHashInfo;
19+
import io.openepcis.eventhash.constant.ConstantEventHashInfo;
2020
import java.util.*;
2121
import java.util.concurrent.atomic.AtomicReference;
2222

core/src/main/java/io/openepcis/epc/eventhash/constant/ConstantEventHashInfo.java renamed to core/src/main/java/io/openepcis/eventhash/constant/ConstantEventHashInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.openepcis.epc.eventhash.constant;
16+
package io.openepcis.eventhash.constant;
1717

1818
import static java.util.Map.entry;
1919

core/src/main/java/io/openepcis/epc/eventhash/exception/EventHashException.java renamed to core/src/main/java/io/openepcis/eventhash/exception/EventHashException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.openepcis.epc.eventhash.exception;
16+
package io.openepcis.eventhash.exception;
1717

1818
public class EventHashException extends RuntimeException {
1919
public EventHashException(String msg, Throwable parent) {

core/src/test/java/io/openepcis/epc/eventhash/EventHashGeneratorPublisherTest.java renamed to core/src/test/java/io/openepcis/eventhash/EventHashGeneratorPublisherTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.openepcis.epc.eventhash;
16+
package io.openepcis.eventhash;
1717

1818
import io.openepcis.constants.CBVVersion;
1919
import io.smallrye.mutiny.Multi;

core/src/test/java/io/openepcis/epc/eventhash/ParallelExecutionTests.java renamed to core/src/test/java/io/openepcis/eventhash/ParallelExecutionTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.openepcis.epc.eventhash;
16+
package io.openepcis.eventhash;
1717

1818
import static org.junit.Assert.assertEquals;
1919

0 commit comments

Comments
 (0)