This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-reporting-impl.git
The following commit(s) were added to refs/heads/master by this push:
new ccdccd6 Replace maven-shared-utils StringUtils and FileUtils with JDK
calls
ccdccd6 is described below
commit ccdccd6ee932934c39571d78d565f7400c70a0ff
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Sun Nov 8 11:41:52 2026 +0000
Replace maven-shared-utils StringUtils and FileUtils with JDK calls
The logging package stays until the Maven floor is 3.10, so the
maven-shared-utils dependency remains.
Part of apache/maven-shared-utils#452
---
src/it/setup-reporting-plugin/pom.xml | 6 ------
.../java/org/apache/maven/reporting/its/custom/ExternalReport.java | 6 ++++--
.../org/apache/maven/reporting/AbstractMavenReportRenderer.java | 3 +--
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/it/setup-reporting-plugin/pom.xml
b/src/it/setup-reporting-plugin/pom.xml
index a0b1544..9686cf5 100644
--- a/src/it/setup-reporting-plugin/pom.xml
+++ b/src/it/setup-reporting-plugin/pom.xml
@@ -63,12 +63,6 @@ under the License.
<version>@version.maven-plugin-tools@</version>
<scope>provided</scope>
</dependency>
-
- <dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-shared-utils</artifactId>
- <version>3.4.2</version>
- </dependency>
</dependencies>
<build>
diff --git
a/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/ExternalReport.java
b/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/ExternalReport.java
index 3b5d509..9a2a04d 100644
---
a/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/ExternalReport.java
+++
b/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/ExternalReport.java
@@ -21,13 +21,14 @@ package org.apache.maven.reporting.its.custom;
import java.io.IOException;
import java.io.File;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
import java.util.Locale;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.reporting.AbstractMavenReport;
import org.apache.maven.reporting.MavenReportException;
-import org.apache.maven.shared.utils.io.FileUtils;
/**
* Typical code to copy as an external reporting plugin start: choose the goal
name, then implement getOutputName(),
@@ -100,6 +101,7 @@ public class ExternalReport
destDir.mkdirs();
File reportFile = new File( destDir, "report.html" );
- FileUtils.fileWrite( reportFile, "UTF-8", "<html><body><h1>External
Report</h1></body></html>" );
+ Files.write( reportFile.toPath(),
+ "<html><body><h1>External Report</h1></body></html>".getBytes(
StandardCharsets.UTF_8 ) );
}
}
diff --git
a/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
b/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
index 2e9f593..e352bf7 100644
--- a/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
+++ b/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
@@ -29,7 +29,6 @@ import org.apache.maven.doxia.markup.Markup;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.sink.SinkEventAttributes;
import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
-import org.apache.maven.shared.utils.StringUtils;
/**
* <p>An abstract class to manage report generation, with many helper methods
to ease the job: you just need to
@@ -582,7 +581,7 @@ public abstract class AbstractMavenReportRenderer
implements MavenReportRenderer
}
}
- if (!StringUtils.isEmpty(text.substring(lastOffset))) {
+ if (!text.substring(lastOffset).trim().isEmpty()) {
segments.add(text.substring(lastOffset));
segments.add(null);
}