Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 5f1ece5

Browse files
using Java 8 for main target and Java 17 for tests
1 parent afd60a9 commit 5f1ece5

File tree

1 file changed

+51
-14
lines changed

1 file changed

+51
-14
lines changed

standalone/pom.xml

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<packaging>jar</packaging>
1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<jdk.version>1.8</jdk.version>
14-
<jdk.test.version>1.8</jdk.test.version>
13+
<jdk.version>8</jdk.version>
14+
<jdk.test.version>17</jdk.test.version>
1515
<sqlcl.libdir>/usr/local/bin/sqlcl/lib</sqlcl.libdir>
1616
<sqlcl.version>21.4.0</sqlcl.version>
1717
<graalvm.version>21.3.0</graalvm.version>
@@ -99,18 +99,6 @@
9999
</execution>
100100
</executions>
101101
</plugin>
102-
<plugin>
103-
<groupId>org.apache.maven.plugins</groupId>
104-
<version>3.8.1</version>
105-
<artifactId>maven-compiler-plugin</artifactId>
106-
<configuration>
107-
<source>${jdk.version}</source>
108-
<target>${jdk.version}</target>
109-
<!-- not supported by IntelliJ, see https://youtrack.jetbrains.com/issue/IDEA-85478 -->
110-
<testSource>${jdk.test.version}</testSource>
111-
<testTarget>${jdk.test.version}</testTarget>
112-
</configuration>
113-
</plugin>
114102
<plugin>
115103
<groupId>org.apache.maven.plugins</groupId>
116104
<artifactId>maven-shade-plugin</artifactId>
@@ -253,4 +241,53 @@
253241
<url>https://github.com/Trivadis/plsql-formatter-settings</url>
254242
</scm>
255243

244+
<!-- Profiles as workaround for https://youtrack.jetbrains.com/issue/IDEA-85478 as described in -->
245+
<!-- https://intellij-support.jetbrains.com/hc/en-us/community/posts/360009767720-I-want-to-run-tests-with-different-java-version-than-my-source-java-version -->
246+
<profiles>
247+
<profile>
248+
<id>default</id>
249+
<activation>
250+
<activeByDefault>true</activeByDefault>
251+
</activation>
252+
<build>
253+
<plugins>
254+
<plugin>
255+
<groupId>org.apache.maven.plugins</groupId>
256+
<version>3.8.1</version>
257+
<artifactId>maven-compiler-plugin</artifactId>
258+
<configuration>
259+
<!-- different Java version for main and test -->
260+
<!-- works with Maven builder from IDE or command line -->
261+
<release>${jdk.version}</release>
262+
<testRelease>${jdk.test.version}</testRelease>
263+
</configuration>
264+
</plugin>
265+
</plugins>
266+
</build>
267+
</profile>
268+
<profile>
269+
<id>idea</id>
270+
<activation>
271+
<activeByDefault>false</activeByDefault>
272+
<property>
273+
<name>idea.maven.embedder.version</name>
274+
</property>
275+
</activation>
276+
<build>
277+
<plugins>
278+
<plugin>
279+
<groupId>org.apache.maven.plugins</groupId>
280+
<version>3.8.1</version>
281+
<artifactId>maven-compiler-plugin</artifactId>
282+
<configuration>
283+
<!-- IDEA requires same Java version for main and test -->
284+
<!-- see https://youtrack.jetbrains.com/issue/IDEA-85478 -->
285+
<release>${jdk.test.version}</release>
286+
<testRelease>${jdk.test.version}</testRelease>
287+
</configuration>
288+
</plugin>
289+
</plugins>
290+
</build>
291+
</profile>
292+
</profiles>
256293
</project>

0 commit comments

Comments
 (0)