Skip to content

Commit 6dd29bf

Browse files
Bump LibreOffice library odfdom-java to 0.12.0, require JDK 11+ for generating Calc file ODS
Old library contains security issues so should be updated, hope feature is not widely used, so we can bump and require JDK 11+ for this
1 parent 1f7a7e9 commit 6dd29bf

File tree

7 files changed

+1106
-1020
lines changed

7 files changed

+1106
-1020
lines changed

pom.xml

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132

133133
<version.httpcomponents.httpclient>4.5.14</version.httpcomponents.httpclient>
134134
<version.httpcomponents.httpcore>4.4.16</version.httpcomponents.httpcore>
135+
<version.odfdom-java>0.12.0</version.odfdom-java>
135136

136137
<!-- license configuration -->
137138
<license.useMissingFile>true</license.useMissingFile>
@@ -307,8 +308,13 @@
307308
<dependency>
308309
<groupId>org.odftoolkit</groupId>
309310
<artifactId>odfdom-java</artifactId>
310-
<!-- There are later versions, but that versions need JDKs after version 8 -->
311-
<version>0.9.0</version>
311+
<version>${version.odfdom-java}</version>
312+
</dependency>
313+
<!-- XML APIs is needed for JDK 8, was a transitive dependency from old version of odfdom-java -->
314+
<dependency>
315+
<groupId>xml-apis</groupId>
316+
<artifactId>xml-apis</artifactId>
317+
<version>1.4.01</version>
312318
</dependency>
313319
</dependencies>
314320

@@ -461,7 +467,7 @@
461467
<dependency>
462468
<groupId>org.odftoolkit</groupId>
463469
<artifactId>odfdom-java</artifactId>
464-
<version>0.9.0</version>
470+
<version>${version.odfdom-java}</version>
465471
</dependency>
466472
<dependency>
467473
<groupId>commons-io</groupId>
@@ -546,5 +552,48 @@
546552
</plugins>
547553
</reporting>
548554
</profile>
555+
556+
<profile>
557+
<id>java11-mrjar</id>
558+
<activation>
559+
<jdk>[11,)</jdk>
560+
</activation>
561+
562+
<build>
563+
<plugins>
564+
<plugin>
565+
<groupId>org.apache.maven.plugins</groupId>
566+
<artifactId>maven-compiler-plugin</artifactId>
567+
<executions>
568+
<!-- Compile Java 11+ specific code -->
569+
<execution>
570+
<id>java11-compile</id>
571+
<goals>
572+
<goal>compile</goal>
573+
</goals>
574+
<phase>compile</phase>
575+
<configuration>
576+
<release>11</release>
577+
<compileSourceRoots>
578+
<compileSourceRoot>${project.basedir}/src/main/java11</compileSourceRoot>
579+
</compileSourceRoots>
580+
<outputDirectory>${project.build.outputDirectory}/META-INF/versions/11</outputDirectory>
581+
</configuration>
582+
</execution>
583+
</executions>
584+
</plugin>
585+
<plugin>
586+
<groupId>org.apache.maven.plugins</groupId>
587+
<artifactId>maven-surefire-plugin</artifactId>
588+
<configuration>
589+
<classesDirectory>${project.build.outputDirectory}/META-INF/versions/11</classesDirectory>
590+
<additionalClasspathElements>
591+
<additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
592+
</additionalClasspathElements>
593+
</configuration>
594+
</plugin>
595+
</plugins>
596+
</build>
597+
</profile>
549598
</profiles>
550599
</project>

src/it/aggregate-download-licenses-extended-spreadsheet/invoker.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
###
2222
invoker.goals=clean license:aggregate-download-licenses
2323
invoker.failureBehavior=fail-fast
24+
25+
# LibreOffice Calc file (ODS) requires JDK 11+
26+
invoker.java.version = 11+

src/main/java/org/codehaus/mojo/license/AbstractDownloadLicensesMojo.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,8 @@ public abstract class AbstractDownloadLicensesMojo extends AbstractLicensesXmlMo
705705

706706
/**
707707
* Write LibreOffice Calc file (ODS) for goal license:aggregate-download-licenses.
708+
* <p>
709+
* <b>NOTICE</b> Requires JDK 11 or higher.
708710
*
709711
* @since 2.4.0
710712
*/

0 commit comments

Comments
 (0)