spotbugs / spotbugs-maven-plugin

Maven Mojo Plug-In to generate reports based on the SpotBugs Analyzer
https://spotbugs.github.io/spotbugs-maven-plugin/
Apache License 2.0
69 stars 51 forks source link

Parent Pom not importing correctly #367

Closed neodem closed 2 years ago

neodem commented 2 years ago

Our company uses Jfrog Artifactory for a maven repo and it is having trouble when importing the plugin.

It appears that the parent pom : https://github.com/spotbugs/spotbugs-maven-plugin/blob/2b57e82ca7c5eadcde1f4479436ef53a1317f685/pom.xml#L6

is not able to be read because of references to: child.project.url.inherit.append.path

Would if be possible to clean this reference out of the parent pom, or better yet, remove the parent pom entirely?

hazendaz commented 2 years ago

@neodem See https://github.com/hazendaz/base-parent/issues/252. Maven added that support but did not update the xsd. Jfrog had a bug and they fixed it in a newer release. You should be able to just use an older copy of the spotbugs plugin for now and just override the spotbugs library to the latest 4.4.2 until your company updates to more recent artifactory.

neodem commented 2 years ago

It seems the older versions of the plugin aren't supporting our upgrade to Java 17, which is why we were upgrading.

Thanks for the quick reply. We will pester our corporate Artifactory team.

neodem commented 2 years ago

vfumo000@HQSML-1719017 pollPosition % mvn spotbugs:check [INFO] Scanning for projects... [INFO] [INFO] -------------< XXX >-------------- [INFO] Building XXX 1.29.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] >>> spotbugs-maven-plugin:4.0.4:check (default-cli) > :spotbugs @ pollPosition >>> [INFO] [INFO] --- spotbugs-maven-plugin:4.0.4:spotbugs (spotbugs) @ pollPosition --- [INFO] Fork Value is true [java] The following errors occurred during analysis: [java] Error scanning XXX for referenced classes [java] java.lang.IllegalArgumentException: Unsupported class file major version 61 [java] At org.objectweb.asm.ClassReader.<init>(ClassReader.java:196) [java] At org.objectweb.asm.ClassReader.<init>(ClassReader.java:177) [java] At org.objectweb.asm.ClassReader.<init>(ClassReader.java:163) [java] At edu.umd.cs.findbugs.asm.FBClassReader.<init>(FBClassReader.java:35)

etc.

hazendaz commented 2 years ago

@neodem I'm in process of releasing a new copy with removal of those attributes so you can get around this. Given this is second report of same issue and knowing most corporate policy would not allow you to get around this in a timely manor and the fact that maven failed to document this well and it doesn't do as advertised anyways, it fealt best to just remove that logic. Expect new version 4.4.2.2 to be available later today.

hazendaz commented 2 years ago

@neodem Release for 4.4.2.2 is now out, please try again and confirm your issue is resolved. Thanks.

neodem commented 2 years ago

Thank you so much for this. You're right, getting my company to upgrade Artifactory in a timely way is a giant undertaking!

This worked. Thank you for the repair.

I did get a Java warning (java 17) when running though. I suppose you know about this already though..

     [java] WARNING: A terminally deprecated method in java.lang.System has been called
     [java] WARNING: System::setSecurityManager has been called by edu.umd.cs.findbugs.ba.jsr305.TypeQualifierValue (file:/Users/vfumo000/.m2/repository/com/github/spotbugs/spotbugs/4.4.2/spotbugs-4.4.2.jar)
     [java] WARNING: Please consider reporting this to the maintainers of edu.umd.cs.findbugs.ba.jsr305.TypeQualifierValue
     [java] WARNING: System::setSecurityManager will be removed in a future release
hazendaz commented 2 years ago

Yes that warning is known and in spot bugs itself. Thanks for confirming it worked.

Sent from my Verizon, Samsung Galaxy smartphone Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Vincent Fumo @.> Sent: Thursday, October 21, 2021 8:22:29 AM To: spotbugs/spotbugs-maven-plugin @.> Cc: Jeremy Landis @.>; Assign @.> Subject: Re: [spotbugs/spotbugs-maven-plugin] Parent Pom not importing correctly (Issue #367)

Thank you so much for this. You're right, getting my company to upgrade Artifactory in a timely way is a giant undertaking!

This worked. Thank you for the repair.

I did get a Java warning (java 17) when running though. I suppose you know about this already though..

 [java] WARNING: A terminally deprecated method in java.lang.System has been called
 [java] WARNING: System::setSecurityManager has been called by edu.umd.cs.findbugs.ba.jsr305.TypeQualifierValue (file:/Users/vfumo000/.m2/repository/com/github/spotbugs/spotbugs/4.4.2/spotbugs-4.4.2.jar)
 [java] WARNING: Please consider reporting this to the maintainers of edu.umd.cs.findbugs.ba.jsr305.TypeQualifierValue
 [java] WARNING: System::setSecurityManager will be removed in a future release

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/spotbugs/spotbugs-maven-plugin/issues/367#issuecomment-948560529, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAHODIZJCHR7AJU6KMU6W3TUIAAYLANCNFSM5GJ5GPOQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

hazendaz commented 2 years ago

closing as original issue resolved for older artifactory.