refactorfirst / RefactorFirst

Identifies and prioritizes God Classes Highly Coupled classes, and Class Cycles in Java codebases you should refactor first.
Apache License 2.0
457 stars 42 forks source link

Versions 0.5.0/0.6.1 fail with error NoClassDefFoundError: org/codehaus/doxia/sink/Sink #116

Closed cicirello closed 23 hours ago

cicirello commented 1 week ago

Versions 0.5.0 and 0.6.1 fail with following error:

Error injecting: org.hjug.mavenreport.RefactorFirstMavenReport
java.lang.NoClassDefFoundError: org/codehaus/doxia/sink/Sink

My configuration of the plugin from my pom.xml

<plugin>
  <groupId>org.hjug.refactorfirst.plugin</groupId>
  <artifactId>refactor-first-maven-plugin</artifactId>
  <version>0.6.1</version>       
  <configuration>
    <showDetails>true</showDetails>
  </configuration>
  <executions>
    <execution>
      <id>refactor-first</id>
      <phase>test</phase>
      <goals>
        <goal>report</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Note that this was previously working with version 0.4.0.

Other Potentially Relevant Details:

This is for a Java 17 project.

jimbethancourt commented 4 days ago

Hi @cicirello! Thank you for your bug report! I noticed that you're using it in several of your repositories - thank you! I'd be happy to try to reproduce the issue locally. There weren't any changes to the Maven Report dependency versions between RefactorFirst versions 0.5.0 and 0.6.1 looking at commit history.

What is the URL of the repository you're having issues with? What version of Maven are you using? I'm thinking this might play a part in the issue. What OS are you running on? (though I don't think this will have an impact)

Thanks! Jim

cicirello commented 4 days ago

Hi @jimbethancourt yes, I use it in several repositories (great tool by the way). Here are some more details.

It actually appears that I get the same error with 0.5.0. But, 0.4.0 is working fine. I thought that I had actually tried 0.5.0, but I apparently hadn't actually used 0.5.0 after updating to it. So the issue actually appeared in 0.5.0 for me.

Repository: The repository where I discovered the issue is: https://github.com/cicirello/Chips-n-Salsa

I checked a few others where I use the same plugins, etc, and I get the same error in the following repositories as well.

https://github.com/cicirello/JavaPermutationTools https://github.com/cicirello/rho-mu https://github.com/cicirello/core

The last one of the above has the shortest build time of those 4 repositories, and also doesn't have any dependencies other than Maven plug-ins.

I have RefactorFirst configured in a profile. You can activate it with the following to reproduce the error (for any of the above repositories):

mvn clean package -P "analysis"

Operating System: Windows 10

Maven: Apache Maven 3.8.5

Java: openjdk version "17.0.2" 2022-01-18 OpenJDK Runtime Environment Temurin-17.0.2+8 (build 17.0.2+8) OpenJDK 64-Bit Server VM Temurin-17.0.2+8 (build 17.0.2+8, mixed mode, sharing)

Thanks, Vince

cicirello commented 4 days ago

Hi again @jimbethancourt after my previous reply above, I decided to update Maven to see whether that makes a difference. I still get the same error with Apache Maven 3.9.9.

jimbethancourt commented 1 day ago

Good news @cicirello! It turns out that the issue is resolved if the doxia-reporting dependencies are upgraded to version 4.0.0. I should be able to cut a release tomorrow. It looks like I need to upgrade a few dependencies with CVSS scores higher than I'm comfortable with as well.

jimbethancourt commented 1 day ago

And thank you for your kind words!

cicirello commented 1 day ago

@jimbethancourt great. Thanks for the update.

jimbethancourt commented 23 hours ago

I just released version 0.6.2 that should fix this problem. It should be available in a few hours and definitely by tomorrow.