Skip to content

Commit

Permalink
Take into account JDK versions when patching
Browse files Browse the repository at this point in the history
Signed-off-by: Arjan Tijms <arjan.tijms@omnifish.ee>
  • Loading branch information
arjantijms committed Feb 15, 2024
1 parent 45d8995 commit 3ff7794
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions appserver/distributions/glassfish/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>${ant.version}</version>
</dependency>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b2</version>
<exclusions>
<exclusion>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<executions>
<execution>
<id>do stuff</id>
Expand All @@ -89,24 +107,37 @@
<goal>run</goal>
</goals>
<configuration>
<target>
<target xmlns:if="ant:if" xmlns:unless="ant:unless">
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.plugin.classpath" />

<if>
<bool>
<isgreaterthan arg1="${ant.java.version}" arg2="16"/>
</bool>
<then>
<property name="java17orGreater" value="true"/>
</then>
</if>

<macrodef name="jarupdate">
<attribute name="basedir"/>
<attribute name="includes"/>
<attribute name="destfile"/>
<sequential>
<echo>PATCHING</echo>
<zip destfile="@{destfile}.tmp">
<zipfileset src="@{destfile}" excludes="@{includes}"/>
</zip>
<move file="@{destfile}.tmp" tofile="@{destfile}" />
<zip update="true" basedir="@{basedir}" includes="@{includes}" destfile="@{destfile}" />
</sequential>
</macrodef>
<jarupdate

<jarupdate if:set="java17orGreater"
basedir="${patches}/microprofile-jwt-auth-api" includes="META-INF/MANIFEST.MF"
destfile="${glassfish.modules}/microprofile-jwt-auth-api.jar"
/>
<jarupdate
<jarupdate if:set="java17orGreater"
basedir="${patches}/microprofile-rest-client-api" includes="META-INF/MANIFEST.MF"
destfile="${glassfish.modules}/microprofile-rest-client-api.jar"
/>
Expand Down

0 comments on commit 3ff7794

Please sign in to comment.