Skip to content

Commit efb1073

Browse files
committed
Add module-info and compile it with Java 9+
Signed-off-by: Taylor Smock <[email protected]>
1 parent 0672e46 commit efb1073

File tree

2 files changed

+58
-9
lines changed

2 files changed

+58
-9
lines changed

Source/module-info.java

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
open module com.drew.imaging {
2+
requires xmpcore;
3+
}

pom.xml

+55-9
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,61 @@
8888
<javadoc.opts>-Xdoclint:none</javadoc.opts>
8989
</properties>
9090
</profile>
91+
<profile>
92+
<id>build-module-info-disabled</id>
93+
<activation>
94+
<jdk>(,1.8]</jdk>
95+
</activation>
96+
<build>
97+
<plugins>
98+
<plugin>
99+
<groupId>org.apache.maven.plugins</groupId>
100+
<artifactId>maven-compiler-plugin</artifactId>
101+
<version>3.8.1</version>
102+
<configuration>
103+
<source>1.7</source>
104+
<target>1.7</target>
105+
<excludes>
106+
<exclude>module-info.java</exclude>
107+
</excludes>
108+
</configuration>
109+
</plugin>
110+
</plugins>
111+
</build>
112+
</profile>
113+
<profile>
114+
<id>build-module-info</id>
115+
<activation>
116+
<jdk>[9,)</jdk>
117+
</activation>
118+
<build>
119+
<plugins>
120+
<plugin>
121+
<groupId>org.apache.maven.plugins</groupId>
122+
<artifactId>maven-compiler-plugin</artifactId>
123+
<version>3.11.0</version>
124+
<configuration>
125+
<release>7</release>
126+
</configuration>
127+
<executions>
128+
<execution>
129+
<id>default-compile</id>
130+
<configuration>
131+
<release>9</release>
132+
</configuration>
133+
</execution>
134+
<execution>
135+
<id>base-compile</id>
136+
<goals><goal>compile</goal></goals>
137+
<configuration>
138+
<excludes><exclude>module-info.java</exclude></excludes>
139+
</configuration>
140+
</execution>
141+
</executions>
142+
</plugin>
143+
</plugins>
144+
</build>
145+
</profile>
91146
</profiles>
92147

93148
<build>
@@ -114,15 +169,6 @@
114169
</execution>
115170
</executions>
116171
</plugin>
117-
<plugin>
118-
<groupId>org.apache.maven.plugins</groupId>
119-
<artifactId>maven-compiler-plugin</artifactId>
120-
<version>3.8.1</version>
121-
<configuration>
122-
<source>1.7</source>
123-
<target>1.7</target>
124-
</configuration>
125-
</plugin>
126172
<plugin>
127173
<groupId>org.apache.maven.plugins</groupId>
128174
<artifactId>maven-surefire-plugin</artifactId>

0 commit comments

Comments
 (0)