Skip to content

Wrong version of transitive Maven dependency included in build #37620

Description

@neon-dev

Describe the bug

Apache poi-ooxml 5.2.5 requires commons-compress 1.25.0
Quarkus 3.6.1 requires commons-compress 1.24.0
When building the project, 1.24.0 is included and the project only breaks at runtime when trying to call affected methods.

Expected behavior

Writing a POI workbook should work.

Actual behavior

Trying to write a POI workbook fails with the following error:

java.lang.NoSuchMethodError: 'void org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.putArchiveEntry(org.apache.commons.compress.archivers.zip.ZipArchiveEntry)'
	at org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager.saveImpl(ZipContentTypeManager.java:65)
	at org.apache.poi.openxml4j.opc.internal.ContentTypeManager.save(ContentTypeManager.java:450)
	at org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:608)
	at org.apache.poi.openxml4j.opc.OPCPackage.save(OPCPackage.java:1532)
	at org.apache.poi.openxml4j.opc.OPCPackage.close(OPCPackage.java:506)
	at org.apache.poi.ooxml.POIXMLDocument.close(POIXMLDocument.java:189)
	at org.apache.poi.xssf.usermodel.XSSFWorkbook.close(XSSFWorkbook.java:640)

How to Reproduce?

  1. Get and extract reproducer.zip
  2. Run it via mvn quarkus:dev

Output of uname -a or ver

No response

Output of java -version

OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS)

Quarkus version or git rev

3.6.1

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

This is not the first time I experienced such issues. Last time was on Quarkus 3.5 when trying to include commons-text 1.11.0, causing similar runtime errors due to version conflicts with transitive dependency of commons-lang3.

I could not figure out how to force the correct version in the pom.xml. IntelliJ's dependency analysis doesn't even show conflicts and instead claims that the poi-ooxml requires exactly the same version of commons-compress that Quarkus requires, which is wrong (and changes once you comment out all quarkus dependencies).
Any help would be greatly appreciated! Hopefully such issues can be detected at compile time in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions