13
0

13 Commits

Author SHA256 Message Date
72670980ac Accepting request 1294861 from Java:packages
reproducible: another solution

OBS-URL: https://build.opensuse.org/request/show/1294861
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-javadoc-plugin?expand=0&rev=22
2025-07-22 10:54:20 +00:00
2faf59ff75 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-javadoc-plugin?expand=0&rev=79 2025-07-17 05:41:00 +00:00
f125c3d4c2 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-javadoc-plugin?expand=0&rev=78 2025-07-16 07:21:14 +00:00
aca051d3cb OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-javadoc-plugin?expand=0&rev=77 2025-07-15 11:44:23 +00:00
a7a7f3ba5f 2
OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-javadoc-plugin?expand=0&rev=76
2025-07-15 11:39:56 +00:00
db6efdb020 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-javadoc-plugin?expand=0&rev=75 2025-07-15 11:23:48 +00:00
30c2b5789a OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-javadoc-plugin?expand=0&rev=74 2025-07-15 11:18:41 +00:00
74ec0e37b7 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-javadoc-plugin?expand=0&rev=73 2025-07-15 10:29:12 +00:00
449ee971c5 Accepting request 1292312 from Java:packages
Fix legacy mode

OBS-URL: https://build.opensuse.org/request/show/1292312
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-javadoc-plugin?expand=0&rev=21
2025-07-14 08:50:47 +00:00
8a19e5fd0a OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-javadoc-plugin?expand=0&rev=71 2025-07-12 08:08:07 +00:00
01702e7d0e Accepting request 1282193 from Java:packages
Add dependency on objectweb-asm to build with sisu 0.9.0.M4

OBS-URL: https://build.opensuse.org/request/show/1282193
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-javadoc-plugin?expand=0&rev=20
2025-06-03 15:54:09 +00:00
00bc2930c6 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-javadoc-plugin?expand=0&rev=69 2025-06-03 08:26:56 +00:00
2e72ce1928 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-javadoc-plugin?expand=0&rev=68 2025-06-02 14:30:24 +00:00
6 changed files with 189 additions and 70 deletions

View File

@@ -0,0 +1,67 @@
From 33c9f01af9a3d4d28decbabd0bc02c4b3a875c2d Mon Sep 17 00:00:00 2001
From: Fridrich Strba <fridrich@users.noreply.github.com>
Date: Tue, 15 Jul 2025 02:23:18 +0200
Subject: [PATCH 1/3] Be consistent about data encoding when copying files
(#1215)
---
.../maven/plugins/javadoc/StaleHelper.java | 26 ++++++++++++-------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java b/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java
index aabe9840..7517d0fb 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java
@@ -40,6 +40,20 @@ import org.codehaus.plexus.util.cli.Commandline;
*/
public class StaleHelper {
+ /**
+ * Compute the encoding of the stale javadoc
+ *
+ * @return the the encoding of the stale data
+ */
+ private static Charset getDataCharset() {
+ if (JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast("9")
+ && JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore("12")) {
+ return StandardCharsets.UTF_8;
+ } else {
+ return Charset.defaultCharset();
+ }
+ }
+
/**
* Compute the data used to detect a stale javadoc
*
@@ -55,18 +69,10 @@ public class StaleHelper {
String[] args = cmd.getArguments();
Collections.addAll(options, args);
- final Charset cs;
- if (JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast("9")
- && JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore("12")) {
- cs = StandardCharsets.UTF_8;
- } else {
- cs = Charset.defaultCharset();
- }
-
for (String arg : args) {
if (arg.startsWith("@")) {
String name = arg.substring(1);
- options.addAll(Files.readAllLines(dir.resolve(name), cs));
+ options.addAll(Files.readAllLines(dir.resolve(name), getDataCharset()));
ignored.add(name);
}
}
@@ -117,7 +123,7 @@ public class StaleHelper {
try {
List<String> curdata = getStaleData(cmd);
Files.createDirectories(path.getParent());
- Files.write(path, curdata, StandardCharsets.UTF_8);
+ Files.write(path, curdata, getDataCharset());
} catch (IOException e) {
throw new MavenReportException("Error checking stale data", e);
}
--
2.50.1

View File

@@ -0,0 +1,78 @@
From 6535af41fdb17f29df87194c12f7dc725990f647 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
Date: Sat, 12 Jul 2025 09:48:17 +0200
Subject: [PATCH 2/3] Make the legacyMode consistent and actually useful
* Filter out all of the module-info.java files in legacy mode
* Do not use --source-path in legacy mode as not to suck any
of those module-info.java files back
* Generate the javadoc from list of files and not list of
packages, which is not working if --source-path is not
specified
---
.../plugins/javadoc/AbstractJavadocMojo.java | 29 ++++++++++---------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
index 42a20b9d..2c258c7e 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -2022,7 +2022,7 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
getLog().warn("sourceFileIncludes and sourceFileExcludes have no effect when subpackages are specified!");
includesExcludesActive = false;
}
- if (!packageNames.isEmpty() && !includesExcludesActive) {
+ if (!packageNames.isEmpty() && !includesExcludesActive && !legacyMode) {
addCommandLinePackages(cmd, javadocOutputDirectory, packageNames);
// ----------------------------------------------------------------------
@@ -2093,23 +2093,26 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
if (subpackages == null || subpackages.isEmpty()) {
Collection<String> excludedPackages = getExcludedPackages();
- final boolean autoExclude;
- if (release != null) {
- autoExclude = JavaVersion.parse(release).isBefore("9");
- } else if (source != null) {
- autoExclude = JavaVersion.parse(source).isBefore("9");
- } else {
- // if legacy mode is active, treat it like pre-Java 9 (exclude module-info),
- // otherwise don't auto-exclude anything.
- autoExclude = legacyMode;
+ // if legacy mode is active, treat it like pre-Java 9 (exclude module-info),
+ // otherwise don't auto-exclude anything. Do this regardless of the release
+ // or source values specified
+ boolean autoExclude = legacyMode;
+ if (!autoExclude) {
+ if (release != null) {
+ autoExclude = JavaVersion.parse(release).isBefore("9");
+ } else if (source != null) {
+ autoExclude = JavaVersion.parse(source).isBefore("9");
+ }
}
for (Path sourcePath : sourcePaths) {
File sourceDirectory = sourcePath.toFile();
- List<String> files = new ArrayList<>(JavadocUtil.getFilesFromSource(
+ ArrayList<String> files = new ArrayList<>(JavadocUtil.getFilesFromSource(
sourceDirectory, sourceFileIncludes, sourceFileExcludes, excludedPackages));
- if (autoExclude && files.remove("module-info.java")) {
+ // in the aggregate goal (and theoretically in others too), there can be
+ // more then one module-info.java. Filter out all of them.
+ if (autoExclude && files.removeIf(s -> s.endsWith("module-info.java"))) {
getLog().debug("Auto exclude module-info.java due to source value");
}
mappedFiles.put(sourcePath, files);
@@ -4603,7 +4606,7 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
}
if (moduleSourceDir == null) {
- if (!disableSourcepathUsage) {
+ if (!disableSourcepathUsage && !legacyMode) {
addArgIfNotEmpty(
arguments,
"-sourcepath",
--
2.50.0

View File

@@ -1,3 +1,42 @@
-------------------------------------------------------------------
Thu Jul 17 05:40:16 UTC 2025 - Fridrich Strba <fstrba@suse.com>
- Removed patch:
* 0003-reproducible-from-environment.patch
+ We made the modification more central in maven-archiver
-------------------------------------------------------------------
Tue Jul 15 11:40:44 UTC 2025 - Fridrich Strba <fstrba@suse.com>
- Modified patches:
* 0001-Be-consistent-about-data-encoding.patch ->
0001-Be-consistent-about-data-encoding-when-copying-files.patch
+ Take the version of our PR that was integrated upstream
* 0003-reproducible-from-environment.patch
+ Make the situation exactly the same as before if the
SOURCE_DATE_EPOCH is not set
-------------------------------------------------------------------
Sat Jul 12 08:03:13 UTC 2025 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* 0002-Make-the-legacyMode-consistent-and-actually-useful.patch
+ fix the legacy mode so that is behaves really as javadoc 8
generation
- Modified patches:
* stale-data-encoding.patch
--> 0001-Be-consistent-about-data-encoding.patch
+ rebase and fix the coding style so that it corresponds to
our PR to the upstream project
* reproducible-from-environment.patch
--> 0003-reproducible-from-environment.patch
+ rebase and make consistent with upstream coding style
-------------------------------------------------------------------
Tue Jun 3 08:26:53 UTC 2025 - Fridrich Strba <fstrba@suse.com>
- Add dependency on objectweb-asm to build with sisu 0.9.0.M4
-------------------------------------------------------------------
Sun Dec 8 19:49:03 UTC 2024 - Fridrich Strba <fstrba@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package maven-javadoc-plugin
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -32,8 +32,8 @@ URL: https://maven.apache.org/plugins/maven-javadoc-plugin
Source0: %{base_name}-%{version}.tar.xz
Source1: %{base_name}-build.xml
Patch0: %{base_name}-bootstrap-resources.patch
Patch1: stale-data-encoding.patch
Patch2: reproducible-from-environment.patch
Patch1: 0001-Be-consistent-about-data-encoding-when-copying-files.patch
Patch2: 0002-Make-the-legacyMode-consistent-and-actually-useful.patch
BuildRequires: apache-commons-io
BuildRequires: apache-commons-lang3
BuildRequires: apache-commons-text
@@ -56,6 +56,7 @@ BuildRequires: maven-resolver-impl
BuildRequires: maven-resolver-util
BuildRequires: maven-shared-utils
BuildRequires: maven-wagon-provider-api
BuildRequires: objectweb-asm
BuildRequires: plexus-archiver
BuildRequires: plexus-interactivity-api
BuildRequires: plexus-io
@@ -148,6 +149,7 @@ build-jar-repository -s lib \
maven-reporting-api/maven-reporting-api \
maven-shared-utils/maven-shared-utils \
maven-wagon/provider-api \
objectweb-asm/asm \
org.eclipse.sisu.inject \
org.eclipse.sisu.plexus \
plexus/archiver \

View File

@@ -1,17 +0,0 @@
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -2692,6 +2692,14 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
private String getBottomText() {
final String inceptionYear = project.getInceptionYear();
+ if ( outputTimestamp == null ||
+ outputTimestamp.length() < 1 ||
+ ( ( outputTimestamp.length() == 1 )
+ && !Character.isDigit( outputTimestamp.charAt(0) ) ) )
+ {
+ outputTimestamp = System.getenv("SOURCE_DATE_EPOCH");
+ }
+
// get Reproducible Builds outputTimestamp date value or the current local date.
final LocalDate localDate = MavenArchiver.parseBuildOutputTimestamp(outputTimestamp)
.map(instant -> instant.atZone(ZoneOffset.UTC).toLocalDate())

View File

@@ -1,50 +0,0 @@
--- a/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java
@@ -40,6 +40,19 @@ import org.codehaus.plexus.util.cli.Commandline;
*/
public class StaleHelper {
+ private static Charset getDataCharset()
+ {
+ if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast( "9" )
+ && JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore( "12" ) )
+ {
+ return StandardCharsets.UTF_8;
+ }
+ else
+ {
+ return Charset.defaultCharset();
+ }
+ }
+
/**
* Compute the data used to detect a stale javadoc
*
@@ -55,13 +68,7 @@ public class StaleHelper {
String[] args = cmd.getArguments();
Collections.addAll(options, args);
- final Charset cs;
- if (JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast("9")
- && JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore("12")) {
- cs = StandardCharsets.UTF_8;
- } else {
- cs = Charset.defaultCharset();
- }
+ final Charset cs = getDataCharset();
for (String arg : args) {
if (arg.startsWith("@")) {
@@ -115,9 +122,11 @@ public class StaleHelper {
*/
public static void writeStaleData(Commandline cmd, Path path) throws MavenReportException {
try {
+ final Charset cs = getDataCharset();
+
List<String> curdata = getStaleData(cmd);
Files.createDirectories(path.getParent());
- Files.write(path, curdata, StandardCharsets.UTF_8);
+ Files.write(path, curdata, cs);
} catch (IOException e) {
throw new MavenReportException("Error checking stale data", e);
}