phax / ph-commons

Java 11 Library with tons of utility classes required in all projects
Apache License 2.0
30 stars 18 forks source link

JPMS module system: Consider removing SuppressFBWarnings #36

Closed blutorange closed 1 year ago

blutorange commented 1 year ago

When used within a JPMS module environment (i.e. any project with a module-info.java), SuppressFBWarnings into conflicts with the same annotation from spotbugs-annotations. You could consider using https://mvnrepository.com/artifact/com.github.spotbugs/spotbugs-annotations instead, which seems more like it could be the "official" version for SuppressFBWarnings.

For example, when running Javadoc on a module project, you get errors like this

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.5.0:aggregate-no-fork (default-cli) on project fc-form-common: An error has occurred in Javadoc report generation: 
[ERROR] Exit code: 1
[ERROR] error: module com.google.common reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module net.coobird.thumbnailator reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.reflections reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module de.xima.fc.fc_form_common reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.fontbox reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.checkerframework.checker.qual reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.pdfbox.debugger reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.pdfbox reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module com.google.errorprone.annotations reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.commons.io reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.commons.csv reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.jsoup reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module java.validation reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.commons.collections4 reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module com.helger.commons reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.commons.text reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.commons.codec reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.commons.lang3 reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module de.xima.fc.fc_aspose_processor reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.commons.configuration2 reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.javassist reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.httpcomponents.httpclient reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.pdfbox.tools reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module com.helger.css reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.hibernate.validator reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.apache.httpcomponents.httpcore reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module java.servlet reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module org.mozilla.rhino reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module de.xima.fc.fc_form_function_parser reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: module com.github.spotbugs.annotations reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] error: the unnamed module reads package edu.umd.cs.findbugs.annotations from both com.github.spotbugs.annotations and com.helger.commons
[ERROR] 31 errors
[ERROR] Command line was: /usr/lib/jvm/java-17-openjdk-amd64/bin/javadoc @options @packages
[ERROR] 
[ERROR] Refer to the generated Javadoc files in '/home/madgaksha/git/xima-formcycle-alt-1/fc-form-common/target/site/apidocs' dir.
phax commented 1 year ago

@blutorange thanks for remining me on the legacy issue ;-) Can you please check with the latest 11.0.7-SNAPSHOT version, whether it solves your problem or not? Thanks

blutorange commented 1 year ago

That was fast : ) Perhaps a little bit of background, we are trying to transition a large legacy project to the module system. For now we need had to stop due to other (unrelated) issues. But I did try again with version 11.0.7-SNAPSHOT, it works as expected, so now we have one hurdle less that stands between us and the modular world :+1:

phax commented 1 year ago

Okay cool - so I will build the release version asap so that you can rely on a stable version. As this is a backwards incompatible change, this will mostly end up in release version 11.1.0.

blutorange commented 1 year ago

There's no need to hurry as far as we are concerned, feel free to make a release when you have time ; )

phax commented 1 year ago

@blutorange The final release 11.1.0 is out now fixing this issue. Please also make sure to use ph-css 7.0.1 to have the dependencies right.