Skip to content

Commit 53caf42

Browse files
Bump LibreOffice library odfdom-java to 0.12.0, require JDK 11+ for generating Calc file ODS (#684)
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 ee4cefd commit 53caf42

10 files changed

Lines changed: 1125 additions & 1028 deletions

File tree

pom.xml

Lines changed: 56 additions & 4 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>
@@ -314,8 +315,13 @@
314315
<dependency>
315316
<groupId>org.odftoolkit</groupId>
316317
<artifactId>odfdom-java</artifactId>
317-
<!-- There are later versions, but that versions need JDKs after version 8 -->
318-
<version>0.9.0</version>
318+
<version>${version.odfdom-java}</version>
319+
</dependency>
320+
<!-- XML APIs is needed for JDK 8, was a transitive dependency from old version of odfdom-java -->
321+
<dependency>
322+
<groupId>xml-apis</groupId>
323+
<artifactId>xml-apis</artifactId>
324+
<version>1.4.01</version>
319325
</dependency>
320326
</dependencies>
321327

@@ -338,7 +344,7 @@
338344
<groupId>org.apache.maven.plugins</groupId>
339345
<artifactId>maven-plugin-plugin</artifactId>
340346
<configuration>
341-
<!-- due to freemarker mixed jar FREEMARKER-228 -->
347+
<!-- due to usage of JDK 11 dependencies with multi-release jar support -->
342348
<requiredJavaVersion>8</requiredJavaVersion>
343349
</configuration>
344350
</plugin>
@@ -468,7 +474,7 @@
468474
<dependency>
469475
<groupId>org.odftoolkit</groupId>
470476
<artifactId>odfdom-java</artifactId>
471-
<version>0.9.0</version>
477+
<version>${version.odfdom-java}</version>
472478
</dependency>
473479
<dependency>
474480
<groupId>commons-io</groupId>
@@ -512,6 +518,9 @@
512518

513519
<profile>
514520
<id>mojo-release</id>
521+
<properties>
522+
<minimalJavaBuildVersion>11</minimalJavaBuildVersion>
523+
</properties>
515524
<build>
516525
<plugins>
517526
<plugin>
@@ -553,5 +562,48 @@
553562
</plugins>
554563
</reporting>
555564
</profile>
565+
566+
<profile>
567+
<id>java11-mrjar</id>
568+
<activation>
569+
<jdk>[11,)</jdk>
570+
</activation>
571+
572+
<build>
573+
<plugins>
574+
<plugin>
575+
<groupId>org.apache.maven.plugins</groupId>
576+
<artifactId>maven-compiler-plugin</artifactId>
577+
<executions>
578+
<!-- Compile Java 11+ specific code -->
579+
<execution>
580+
<id>java11-compile</id>
581+
<goals>
582+
<goal>compile</goal>
583+
</goals>
584+
<phase>compile</phase>
585+
<configuration>
586+
<release>11</release>
587+
<compileSourceRoots>
588+
<compileSourceRoot>${project.basedir}/src/main/java11</compileSourceRoot>
589+
</compileSourceRoots>
590+
<outputDirectory>${project.build.outputDirectory}/META-INF/versions/11</outputDirectory>
591+
</configuration>
592+
</execution>
593+
</executions>
594+
</plugin>
595+
<plugin>
596+
<groupId>org.apache.maven.plugins</groupId>
597+
<artifactId>maven-surefire-plugin</artifactId>
598+
<configuration>
599+
<classesDirectory>${project.build.outputDirectory}/META-INF/versions/11</classesDirectory>
600+
<additionalClasspathElements>
601+
<additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
602+
</additionalClasspathElements>
603+
</configuration>
604+
</plugin>
605+
</plugins>
606+
</build>
607+
</profile>
556608
</profiles>
557609
</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/license/THIRD-PARTY.properties

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
22
#-------------------------------------------------------------------------------
33
# Already used licenses in project :
4+
# - 0BSD
45
# - Apache 2
56
# - Apache 2.0
67
# - Apache License 2.0
78
# - Apache License, Version 2.0
8-
# - Apache Public License 2.0
99
# - Apache-2.0
1010
# - BSD
1111
# - BSD 2-Clause License
1212
# - BSD License
13-
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
13+
# - BSD-3-Clause
1414
# - Eclipse Public License v2.0
15-
# - Eclipse Public License, Version 1.0
16-
# - GNU General Public License, version 2 (GPL2), with the classpath exception
15+
# - Eclipse Public License, Version 2.0
1716
# - Lesser General Public License (LGPL) v 3.0
1817
# - MIT License
19-
# - MIT license
2018
# - Public Domain
2119
# - The Apache License, Version 2.0
2220
# - The Apache Software License, Version 2.0
@@ -27,5 +25,6 @@
2725
# Please fill the missing licenses for dependencies :
2826
#
2927
#
30-
#Fri Nov 29 08:49:34 CET 2024
28+
#Sun Jan 04 10:55:37 CET 2026
3129
org.codehaus.plexus--plexus-i18n--1.0-beta-10=The Apache Software License, Version 2.0
30+
xalan--serializer--2.7.3=The Apache Software License, Version 2.0

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)