Skip to content

Commit

Permalink
chore: switch to wildfly maven plugin (#2272)
Browse files Browse the repository at this point in the history
Switch to new WildFly Maven Plugin because the old WildFly JAR Maven
Plugin is old and deprecated.

Solves PZ-4902
  • Loading branch information
edgarvonk authored Dec 19, 2024
1 parent c6e52d8 commit f2c076a
Showing 5 changed files with 27 additions and 26 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -44,7 +44,8 @@ RUN date -Iseconds > /build_timestamp.txt
ENV WILDFLY_OVERRIDING_ENV_VARS=1

# Start zaakafhandelcomponent
ENTRYPOINT ["java", "-jar", "zaakafhandelcomponent.jar"]
# make sure that the WildFly management port is accessible from outside the container
ENTRYPOINT ["java", "-Djboss.bind.address.management=0.0.0.0", "-jar", "zaakafhandelcomponent.jar"]
EXPOSE 8080 9990

ENV BRANCH_NAME=$branchName COMMIT_HASH=$commitHash VERSION_NUMBER=$versionNumber
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -709,7 +709,7 @@ tasks {

register<Maven>("generateWildflyBootableJar") {
dependsOn("war")
execGoal("wildfly-jar:package")
execGoal("wildfly:package")

val wildflyResources = srcMainResources.dir("wildfly")
inputs.files(wildflyResources.asFileTree)
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -640,7 +640,7 @@ services:
"sh",
"-c",
# entrypoint may be overridden by environment variable to pass on extra arguments
"${ZAC_DOCKER_ENTRYPOINT:-java -Xms1024m -Xmx1024m -Xlog:gc::time,uptime -jar zaakafhandelcomponent.jar}",
"${ZAC_DOCKER_ENTRYPOINT:-java -Djboss.bind.address.management=0.0.0.0 -Xms1024m -Xmx1024m -Xlog:gc::time,uptime -jar zaakafhandelcomponent.jar}"
]
deploy:
resources:
44 changes: 21 additions & 23 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -19,26 +19,34 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- please follow the instructions in 'updatingDependencies.md' when upgrading WildFly -->
<wildfly.version>34.0.1.Final</wildfly.version>
<wildfly-jar-maven-plugin.version>11.0.2.Final</wildfly-jar-maven-plugin.version>
<wildfly-maven-plugin.version>5.1.0.Final</wildfly-maven-plugin.version>
<wildfly-datasources-galleon-pack.version>9.1.0.Final</wildfly-datasources-galleon-pack.version>
<wildfly-cloud-galleon-pack.version>7.0.2.Final</wildfly-cloud-galleon-pack.version>
</properties>

<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-jar-maven-plugin</artifactId>
<version>${wildfly-jar-maven-plugin.version}</version>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${wildfly-maven-plugin.version}</version>
<configuration>
<bootableJar>true</bootableJar>
<skipDeployment>true</skipDeployment>
<bootableJarName>${project.artifactId}.jar</bootableJarName>
<featurePacks>
<featurePack>
<location>wildfly@maven(org.jboss.universe:community-universe)#${wildfly.version}</location>
</featurePack>
<featurePack>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-datasources-galleon-pack</artifactId>
<version>${wildfly-datasources-galleon-pack.version}</version>
<location>org.wildfly:wildfly-galleon-pack:${wildfly.version}</location>
</featurePack>
<featurePack>
<location>org.wildfly:wildfly-datasources-galleon-pack:${wildfly-datasources-galleon-pack.version}</location>
</featurePack>
<featurePack>
<location>org.wildfly.cloud:wildfly-cloud-galleon-pack:${wildfly-cloud-galleon-pack.version}</location>
</featurePack>
</featurePacks>
<layers>
@@ -51,29 +59,19 @@
<layer>microprofile-rest-client</layer>
<layer>opentelemetry</layer>
<layer>postgresql-driver</layer>
<layer>cloud-server</layer>
</layers>
<excludedLayers>
<layer>deployment-scanner</layer>
</excludedLayers>
<cliSessions>
<cliSession>
<scriptFiles>
<packagingScripts>
<packagingScript>
<scripts>
<script>src/main/resources/wildfly/configure-wildfly.cli</script>
<script>src/main/resources/wildfly/deploy-zaakafhandelcomponent.cli</script>
</scriptFiles>
<resolveExpressions>false</resolveExpressions>
</cliSession>
</cliSessions>
<cloud>
<type>kubernetes</type>
</cloud>
<jvmArguments>
<!-- uncomment the following line to enable remote debugging -->
<!-- <argument>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8787</argument> -->
</jvmArguments>
<outputFileName>${project.artifactId}.jar</outputFileName>
<jarFileName>${project.artifactId}.jar</jarFileName>
<hollow-jar>true</hollow-jar>
</scripts>
</packagingScript>
</packagingScripts>
</configuration>
<executions>
<execution>
2 changes: 2 additions & 0 deletions src/itest/kotlin/nl/lifely/zac/itest/config/ProjectConfig.kt
Original file line number Diff line number Diff line change
@@ -68,6 +68,8 @@ class ProjectConfig : AbstractProjectConfig() {
"ZAC_DOCKER_ENTRYPOINT" to
"java" +
" -javaagent:/jacoco-agent/org.jacoco.agent-runtime.jar=destfile=/jacoco-report/jacoco-it.exec" +
// make sure that the WildFly management port is accessible from outside the container
" -Djboss.bind.address.management=0.0.0.0" +
" -Xms1024m" +
" -Xmx1024m" +
" -jar zaakafhandelcomponent.jar",

0 comments on commit f2c076a

Please sign in to comment.