Skip to content

Commit e821255

Browse files
authored
Fix overriding semantics messaging version in newer openjdk 8 versions (#206)
* Fix overriding semantics messaging version in newer openjdk 8 versions * Added how to run app and override Eiffel-protocol version docs
1 parent c05df8c commit e821255

File tree

3 files changed

+70
-6
lines changed

3 files changed

+70
-6
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ Eiffel REMReM Generate takes a partial message in JSON format, validates it and
3434

3535
3. [**Installation**](wiki/markdown/installation.md)
3636

37-
4. [**Run in Docker**](wiki/markdown/docker.md)
37+
4. [**Run Application**](wiki/markdown/run.md)
3838

39-
5. [**Usage**](wiki/markdown/usage.md)
39+
5. [**Run in Docker**](wiki/markdown/docker.md)
4040

41-
6. [**Logging**](wiki/markdown/logging.md)
41+
6. [**Usage**](wiki/markdown/usage.md)
42+
43+
7. [**Logging**](wiki/markdown/logging.md)
4244

4345
# About this repository
4446
The contents of this repository are licensed under the [Apache License 2.0](./LICENSE).

service/src/main/java/com/ericsson/eiffel/remrem/generate/controller/VersionService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public class VersionService {
6363
*/
6464
public Map<String, Map<String, String>> getMessagingVersions() {
6565
Enumeration<?> resEnum;
66-
6766
try {
6867
resEnum = Thread.currentThread().getContextClassLoader().getResources(JarFile.MANIFEST_NAME);
6968
while (resEnum.hasMoreElements()) {
@@ -77,9 +76,10 @@ public Map<String, Map<String, String>> getMessagingVersions() {
7776
if (versionKey != null) {
7877
String version = mainAttribs.getValue(versionKey);
7978
if (version != null) {
80-
8179
if (mainAttribs.getValue(IS_ENDPOINT_VERSION) != null) {
82-
endpointVersions.put(versionKey, version);
80+
if(endpointVersions.get(versionKey) == null) {
81+
endpointVersions.put(versionKey, version);
82+
}
8383
} else {
8484
serviceVersion.put(versionKey, version);
8585
}

wiki/markdown/run.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Run RemRem-Generate Applciation
2+
3+
RemRem-Generate application can be executed with Maven command or with the maven built war file.
4+
5+
## Requirements
6+
7+
- Java
8+
- Maven
9+
10+
11+
## Run RemRem-Generate With Maven Command
12+
13+
1. Change to service directory:
14+
`cd service`
15+
16+
2. Execute maven command to build and run RemRem-Generate:
17+
`mvn spring-boot:run`
18+
19+
20+
## Run RemRem-Generate With Java Command
21+
22+
1. Go to remrem-generate git root directory
23+
24+
2. Execute maven package command to build the RemRem-Generate war file:
25+
`mvn package -DskipTests`
26+
27+
This will produce a war file in the "target" folder.
28+
The RemRem-Generate released war file can be downloaded from JitPack.
29+
30+
3. Run RemRem-Generate application war file
31+
There is some alternatives to execute the war file with java command.
32+
`java -classpath service/target/generate-service-2.1.5.war org.springframework.boot.loader.WarLauncher`
33+
or
34+
`java -jar service/target/generate-service-2.1.5.war`
35+
36+
37+
Provide customized RemRem-Generate application.properties configuration via the spring.config.location java flag which need to be appended to the java command line:
38+
`-Dspring.config.location=/path/to/application.properties`
39+
40+
41+
## Override RemRem-Generate Eiffel Protocol Version
42+
43+
Eiffel-RemRem Protocol versions is developed and released by Github project:
44+
https://github.com/eiffel-community/eiffel-remrem-semantics
45+
46+
Eiffel-RemRem-Semantic versions is released in Jitpack and can be downloaded as jar file.
47+
Eiffel-Remrem-Semantic releases version jar files:
48+
https://jitpack.io/com/github/eiffel-community/eiffel-remrem-semantics
49+
50+
Example of one Eiffel-Semantic-version Jitpack download url address:
51+
https://jitpack.io/com/github/eiffel-community/eiffel-remrem-semantics/2.2.1/eiffel-remrem-semantics-2.2.1.jar
52+
53+
Eiffel-RemRem-Generate is released with a built-in eiffel-semantic protocol version which can be overridden with a different eiffel-semantic version by adding the external eiffel-semantic version jar file to classpath.
54+
55+
Execute RemRem-Generate application with external eiffel-semantic version jar file to classpath:
56+
`java -classpath /path/to/protocol/eiffel-remrem-semantics-2.2.2.jar:service/target/generate-service-2.1.5.war org.springframework.boot.loader.WarLauncher`
57+
58+
Another alternative (works only with Java 8):
59+
`java -Djava.ext.dirs=/path/to/protocol/eiffel-remrem-semantics-2.2.2.jar -jar service/target/generate-service-2.1.5.war`
60+
61+
Go to http://localhost:8080/versions and "semanticsVersion" field should show the overridden eiffel-semantic version.
62+

0 commit comments

Comments
 (0)