Skip to content

Commit 793c207

Browse files
Move module compilation to java9+ profile activated on JDK 9+
Co-authored-by: slawekjaranowski <[email protected]>
1 parent a5f41f8 commit 793c207

File tree

1 file changed

+39
-34
lines changed

1 file changed

+39
-34
lines changed

pom.xml

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -67,40 +67,6 @@
6767
</instructions>
6868
</configuration>
6969
</plugin>
70-
<plugin>
71-
<groupId>org.apache.maven.plugins</groupId>
72-
<artifactId>maven-compiler-plugin</artifactId>
73-
<!-- defaults for compile and testCompile -->
74-
<configuration>
75-
<!-- Only required when JAVA_HOME isn't at least Java 9 and when haven't configured the maven-toolchains-plugin -->
76-
<jdkToolchain>
77-
<version>9</version>
78-
</jdkToolchain>
79-
<release>8</release>
80-
</configuration>
81-
<executions>
82-
<execution>
83-
<id>default-compile</id>
84-
<configuration>
85-
<!-- compile everything to ensure module-info contains right entries -->
86-
<release>9</release>
87-
</configuration>
88-
</execution>
89-
<execution>
90-
<id>base-compile</id>
91-
<goals>
92-
<goal>compile</goal>
93-
</goals>
94-
<!-- recompile everything for target VM except the module-info.java -->
95-
<configuration>
96-
<release>8</release>
97-
<excludes>
98-
<exclude>module-info.java</exclude>
99-
</excludes>
100-
</configuration>
101-
</execution>
102-
</executions>
103-
</plugin>
10470
<plugin>
10571
<groupId>org.apache.maven.plugins</groupId>
10672
<artifactId>maven-scm-publish-plugin</artifactId>
@@ -132,4 +98,43 @@
13298
</plugins>
13399
</build>
134100

101+
<profiles>
102+
<profile>
103+
<id>java9+</id>
104+
<activation>
105+
<jdk>[9,)</jdk>
106+
</activation>
107+
<build>
108+
<plugins>
109+
<plugin>
110+
<groupId>org.apache.maven.plugins</groupId>
111+
<artifactId>maven-compiler-plugin</artifactId>
112+
<executions>
113+
<execution>
114+
<id>default-compile</id>
115+
<configuration>
116+
<!-- compile everything to ensure module-info contains right entries -->
117+
<release>9</release>
118+
</configuration>
119+
</execution>
120+
<execution>
121+
<id>base-compile</id>
122+
<goals>
123+
<goal>compile</goal>
124+
</goals>
125+
<!-- recompile everything for target VM except the module-info.java -->
126+
<configuration>
127+
<release>8</release>
128+
<excludes>
129+
<exclude>module-info.java</exclude>
130+
</excludes>
131+
</configuration>
132+
</execution>
133+
</executions>
134+
</plugin>
135+
</plugins>
136+
</build>
137+
</profile>
138+
</profiles>
139+
135140
</project>

0 commit comments

Comments
 (0)