Skip to content

Commit 4706af1

Browse files
committed
Remove jigsaw profile
Unfortunately, this profile does not work if you are compiling a modularized project targeting Java 9+, using Java 9+. It only works if you are targeting Java 8 or earlier, but compiling with Java 9+. This is an exceedingly rare case (I didn't find any SciJava ecosystem projects doing it), and we need to support compilation of modularized Java 11 projects out of the box. Therefore, we remove this profile, to avoid breakage. For modularized projects needing to support Java 8 or earlier, they will need to add the maven-compiler-plugin configuration directly to their own POMs manually, as described at: https://maven.apache.org/plugins/maven-compiler-plugin/examples/module-info.html
1 parent 2a82b31 commit 4706af1

File tree

1 file changed

+1
-58
lines changed

1 file changed

+1
-58
lines changed

pom.xml

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>org.scijava</groupId>
66
<artifactId>pom-scijava-base</artifactId>
7-
<version>10.0.1-SNAPSHOT</version>
7+
<version>11.0.0-SNAPSHOT</version>
88
<packaging>pom</packaging>
99

1010
<name>SciJava Base POM</name>
@@ -1144,63 +1144,6 @@
11441144
</build>
11451145
</profile>
11461146

1147-
<!--
1148-
The jigsaw profile enables support for Java 9 modularization, while
1149-
simultaneously allowing the component to continue targeting an earlier
1150-
version of the JVM as the minimum.
1151-
1152-
When a src/main/java/module-info.java is present, compilation proceeds in
1153-
two steps: 1) all code including module-info.java is compiled with Java 9;
1154-
and then 2) the project is recompiled sans module-info.java to target the
1155-
desired bytecode version.
1156-
1157-
This profile was adapted from the following article:
1158-
https://maven.apache.org/plugins/maven-compiler-plugin/examples/module-info.html
1159-
-->
1160-
<profile>
1161-
<id>jigsaw</id>
1162-
<activation>
1163-
<file>
1164-
<!-- NB: No property, because profile activation is too early. -->
1165-
<exists>${basedir}/src/main/java/module-info.java</exists>
1166-
</file>
1167-
</activation>
1168-
<build>
1169-
<plugins>
1170-
<plugin>
1171-
<artifactId>maven-compiler-plugin</artifactId>
1172-
<executions>
1173-
<execution>
1174-
<id>default-compile</id>
1175-
<configuration>
1176-
<!-- NB: Compile everything with Java 9, for correctness. -->
1177-
<release>9</release>
1178-
</configuration>
1179-
</execution>
1180-
<execution>
1181-
<id>base-compile</id>
1182-
<goals>
1183-
<goal>compile</goal>
1184-
</goals>
1185-
<!-- NB: Recompile minus module-info.java for the target VM. -->
1186-
<configuration>
1187-
<!--
1188-
Workaround for a bug in maven-compiler-plugin.
1189-
(Naively, it seems like this flag's behavior is reversed.)
1190-
See https://issues.apache.org/jira/browse/MCOMPILER-209
1191-
-->
1192-
<useIncrementalCompilation>true</useIncrementalCompilation>
1193-
<excludes>
1194-
<exclude>module-info.java</exclude>
1195-
</excludes>
1196-
</configuration>
1197-
</execution>
1198-
</executions>
1199-
</plugin>
1200-
</plugins>
1201-
</build>
1202-
</profile>
1203-
12041147
<!--
12051148
The kotlin profile enables support for Kotlin projects, and mixed
12061149
Kotlin-Java projects. It turns on automatically when a src/main/kotlin

0 commit comments

Comments
 (0)