From 2a72bd0b5f2ddc62a42bb86a8467686c5c75ea39 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Mon, 1 Jul 2024 23:07:50 +0200 Subject: [PATCH] Cleanups code and dependencies Apply hints from dependencies:analyze --- pom.xml | 53 +++++++++++++------ .../codehaus/mojo/taglist/FileAnalyser.java | 2 +- .../codehaus/mojo/taglist/TagListReport.java | 2 +- .../taglist/beans/FileReportTestCase.java | 15 ++++-- 4 files changed, 51 insertions(+), 21 deletions(-) diff --git a/pom.xml b/pom.xml index 106d716..1659d59 100644 --- a/pom.xml +++ b/pom.xml @@ -101,6 +101,7 @@ ${project.version} + @@ -156,6 +157,16 @@ org.apache.maven.reporting maven-reporting-impl 3.1.0 + + + org.apache.maven + maven-core + + + org.apache.maven + maven-plugin-api + + @@ -164,6 +175,12 @@ doxia-core ${doxiaVersion} runtime + + + org.codehaus.plexus + plexus-container-default + + org.apache.maven.doxia @@ -176,6 +193,27 @@ org.apache.maven.doxia doxia-site-renderer ${doxia-sitetoolsVersion} + + + org.apache.maven + maven-artifact + + + org.codehaus.plexus + plexus-container-default + + + + + + + org.apache.commons + commons-lang3 + 3.14.0 + + + org.codehaus.plexus + plexus-utils @@ -201,11 +239,6 @@ - - org.eclipse.aether - aether-api - 1.1.0 - org.slf4j slf4j-simple @@ -307,16 +340,6 @@ org.apache.maven.plugins maven-javadoc-plugin - org.codehaus.mojo taglist-maven-plugin diff --git a/src/main/java/org/codehaus/mojo/taglist/FileAnalyser.java b/src/main/java/org/codehaus/mojo/taglist/FileAnalyser.java index e5f3672..9d9c2d2 100644 --- a/src/main/java/org/codehaus/mojo/taglist/FileAnalyser.java +++ b/src/main/java/org/codehaus/mojo/taglist/FileAnalyser.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.Locale; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.maven.plugin.logging.Log; import org.codehaus.mojo.taglist.beans.FileReport; import org.codehaus.mojo.taglist.beans.TagReport; diff --git a/src/main/java/org/codehaus/mojo/taglist/TagListReport.java b/src/main/java/org/codehaus/mojo/taglist/TagListReport.java index 211c8d0..4a3ee1b 100644 --- a/src/main/java/org/codehaus/mojo/taglist/TagListReport.java +++ b/src/main/java/org/codehaus/mojo/taglist/TagListReport.java @@ -38,7 +38,6 @@ import org.apache.maven.project.MavenProject; import org.apache.maven.reporting.AbstractMavenReport; import org.apache.maven.reporting.MavenReportException; -import org.apache.maven.shared.utils.io.FileUtils; import org.codehaus.mojo.taglist.beans.FileReport; import org.codehaus.mojo.taglist.beans.TagReport; import org.codehaus.mojo.taglist.options.Tag; @@ -51,6 +50,7 @@ import org.codehaus.mojo.taglist.tags.InvalidTagException; import org.codehaus.mojo.taglist.tags.TagClass; import org.codehaus.mojo.taglist.tags.TagFactory; +import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.PathTool; import org.codehaus.plexus.util.StringUtils; diff --git a/src/test/java/org/codehaus/mojo/taglist/beans/FileReportTestCase.java b/src/test/java/org/codehaus/mojo/taglist/beans/FileReportTestCase.java index a3ae548..d3fc0e6 100644 --- a/src/test/java/org/codehaus/mojo/taglist/beans/FileReportTestCase.java +++ b/src/test/java/org/codehaus/mojo/taglist/beans/FileReportTestCase.java @@ -21,16 +21,23 @@ import java.io.File; -import org.codehaus.plexus.PlexusTestCase; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Tests for file report. * * @author Dennis Lundberg */ -public class FileReportTestCase extends PlexusTestCase { - public void testGetClassName() { - File file = new File(getBasedir() + "/src/test/resources/org/codehaus/mojo/taglist/beans/XYjavatest.java"); +class FileReportTestCase { + + @Test + void testGetClassName() throws Exception { + + File file = new File(getClass() + .getResource("/org/codehaus/mojo/taglist/beans/XYjavatest.java") + .toURI()); FileReport fileReport = new FileReport(file, "UTF-8"); assertEquals("org.codehaus.mojo.taglist.beans.XYjavatest", fileReport.getClassName()); }