Skip to content

Commit

Permalink
Merge pull request #68 from debricked/0-callgraph-v4-fix
Browse files Browse the repository at this point in the history
Create different java version profiles
  • Loading branch information
filip-debricked authored Jan 14, 2025
2 parents 1f920bc + 9730e9f commit 915a481
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 10 deletions.
6 changes: 3 additions & 3 deletions java/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM maven:3-jdk-11-slim AS package
FROM maven:3-eclipse-temurin-21-alpine AS package

COPY java/common /vulnfunc/java/common
RUN mvn -f /vulnfunc/java/common --batch-mode --update-snapshots package
RUN mvn -f /vulnfunc/java/common --batch-mode --update-snapshots package -DskipTests

FROM openjdk:11-jre-slim
FROM openjdk:21-slim
RUN apt-get update ; apt-get install --no-install-recommends -y zip
COPY --from=package /vulnfunc/java/common/target/SootWrapper.jar /vulnfunc/java/common/
COPY java/common/*.sh /vulnfunc/java/common/
Expand Down
69 changes: 69 additions & 0 deletions java/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,73 @@
</plugins>
</build>

<profiles>
<!-- Profile for Java 11 -->
<profile>
<id>java11</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<finalName>SootWrapper-java11</finalName>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
</plugin>
</plugins>
</build>
</profile>

<!-- Profile for Java 17 -->
<profile>
<id>java17</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<finalName>SootWrapper-java17</finalName>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
</plugin>
</plugins>
</build>
</profile>

<!-- Profile for Java 21 -->
<profile>
<id>java21</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<finalName>SootWrapper-java21</finalName>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
</plugin>
</plugins>
</build>
</profile>
</profiles>


</project>
6 changes: 3 additions & 3 deletions java/gradle/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM maven:3-jdk-11-slim AS package
FROM maven:3-eclipse-temurin-21-alpine AS package

COPY java/common /vulnfunc/java/common
RUN mvn -f /vulnfunc/java/common --batch-mode --update-snapshots package
RUN mvn -f /vulnfunc/java/common --batch-mode --update-snapshots package -DskipTests

FROM gradle:jre11
FROM gradle:jdk21
RUN apt-get update ; apt-get install --no-install-recommends -y zip
COPY --from=package /vulnfunc/java/common/target/SootWrapper.jar /vulnfunc/java/common/
COPY java/common/*.sh /vulnfunc/java/common/
Expand Down
8 changes: 4 additions & 4 deletions java/maven/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM maven:3-jdk-11-slim AS package
FROM maven:3-eclipse-temurin-21-alpine AS package

COPY java/common /vulnfunc/java/common
RUN mvn -f /vulnfunc/java/common --batch-mode --update-snapshots package
RUN mvn -f /vulnfunc/java/common --batch-mode --update-snapshots package -DskipTests

FROM maven:3-jdk-11-slim
RUN apt-get update ; apt-get install --no-install-recommends -y zip
FROM maven:3-eclipse-temurin-21-alpine
RUN apk add --no-cache zip
COPY --from=package /vulnfunc/java/common/target/SootWrapper.jar /vulnfunc/java/common/
COPY java/common/*.sh /vulnfunc/java/common/
COPY java/maven/*.sh /vulnfunc/java/maven/

0 comments on commit 915a481

Please sign in to comment.