Skip to content

Commit

Permalink
Merge pull request #496 from luiseufrasio/payara-mp-5
Browse files Browse the repository at this point in the history
Fixing Payara version for MP 5
  • Loading branch information
Emily-Jiang authored Feb 28, 2024
2 parents 39bc2d6 + 87059a5 commit 4badc99
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public enum Whitelist {
Pattern.compile(".*com.hazelcast.internal.server.tcp.TcpServerConnectionErrorHandler.*"),
Pattern.compile(".*error_prone_annotations.*"),
Pattern.compile(".*error_prone_parent.*"),
Pattern.compile(".*com.hazelcast:name=payara.micro.*"),
}),
LIBERTY("liberty", new Pattern[]{
Pattern.compile(".*FrameworkEvent ERROR.*"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,22 @@ public void createFiles(JessieModel model) {
@Override
public void adaptMavenModel(Model pomFile, JessieModel model, boolean mainProject) {
String payaraVersion = definePayaraVersion(model);
String payaraMavenPluginVersion = definePayaraMavenPluginVersion(payaraVersion);
pomFile.addProperty("payaraVersion", payaraVersion);
pomFile.addProperty("payaraMavenPluginVersion", payaraMavenPluginVersion);
}

private String definePayaraMavenPluginVersion(String payaraVersion) {
return payaraVersion.startsWith("5") ? "1.4.0" : "2.1";
}

private String definePayaraVersion(JessieModel model) {
String payaraVersion = "";
switch (model.getSpecification().getMicroProfileVersion()) {

case NONE:
break;
case MP50:
payaraVersion = "6.2024.1";
payaraVersion = "6.2023.2";
break;
case MP40:
payaraVersion = "5.2021.1";
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/files/gradle/gradlew.bat.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
@rem limitations under the License.
@rem

@rem Add -Djdk.util.zip.disableZip64ExtraFieldValidation=true into ENV: JAVA_TOOL_OPTIONS
set "JAVA_TOOL_OPTIONS=-Djdk.util.zip.disableZip64ExtraFieldValidation=true %JAVA_TOOL_OPTIONS%"

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/files/gradle/gradlew.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add -Djdk.util.zip.disableZip64ExtraFieldValidation=true into ENV: JAVA_TOOL_OPTIONS
export JAVA_TOOL_OPTIONS="-Djdk.util.zip.disableZip64ExtraFieldValidation=true $JAVA_TOOL_OPTIONS"

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/files/readme.md.secondary.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ The generation of the executable jar file can be performed by issuing the follow
mvn clean package

This will create an executable jar file **[# th:text="${jar_file}"/]** within the _target_ maven folder. This can be started by executing the following command
[# th:if="${mp_servername} == 'payara-micro'"]
java -Djdk.util.zip.disableZip64ExtraFieldValidation=true -jar target/[# th:text="${jar_file}"/] [# th:text="${jar_parameters}"/]
[/]
[# th:unless="${mp_servername} == 'payara-micro'"]
java -jar target/[# th:text="${jar_file}"/] [# th:text="${jar_parameters}"/]
[/]
[/]
[# th:if="${build_tool} == 'GRADLE'"]
[# th:if="${mp_servername} == 'payara-micro'"]
./gradlew microBundle
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/files/readme.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ The generation of the executable jar file can be performed by issuing the follow

This will create an executable jar file **[# th:text="${jar_file}"/]** within the _target_ maven folder. This can be started by executing the following command

[# th:if="${mp_servername} == 'payara-micro'"]
java -Djdk.util.zip.disableZip64ExtraFieldValidation=true -jar target/[# th:text="${jar_file}"/]
[/]
[# th:unless="${mp_servername} == 'payara-micro'"]
java -jar target/[# th:text="${jar_file}"/]
[/]

[/][# th:if="${build_tool} == 'GRADLE'"]
[# th:if="${mp_servername} == 'payara-micro'"]
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/pom-servers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
<plugin>
<groupId>fish.payara.maven.plugins</groupId>
<artifactId>payara-micro-maven-plugin</artifactId>
<version>2.1</version>
<version>${payaraMavenPluginVersion}</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/readme_examples/py-service-a-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The generation of the executable jar file can be performed by issuing the follow

This will create an executable jar file **payara-microbundle.jar** within the _target_ maven folder. This can be started by executing the following command

java -jar target/payara-microbundle.jar
java -Djdk.util.zip.disableZip64ExtraFieldValidation=true -jar target/payara-microbundle.jar



Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/readme_examples/py-service-b-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The generation of the executable jar file can be performed by issuing the follow

This will create an executable jar file **payara-microbundle.jar** within the _target_ maven folder. This can be started by executing the following command

java -jar target/payara-microbundle.jar --port 8180
java -Djdk.util.zip.disableZip64ExtraFieldValidation=true -jar target/payara-microbundle.jar --port 8180



Expand Down

0 comments on commit 4badc99

Please sign in to comment.