parameters = findNamedChild( parametersNode, "parameter" );
++ append( sb, "Available parameters:", 1 );
++ append( sb, "", 0 );
++
++ for ( Node parameter : parameters )
++ {
++ writeParameter( sb, parameter, configurationElement );
++ }
++ }
++ }
++ }
++
++ private void writeParameter( StringBuilder sb, Node parameter, Node configurationElement )
++ throws MojoExecutionException
++ {
++ String parameterName = getValue( parameter, "name" );
++ String parameterDescription = getValue( parameter, "description" );
++
++ Element fieldConfigurationElement = null;
++ if ( configurationElement != null )
++ {
++ fieldConfigurationElement = (Element) findSingleChild( configurationElement, parameterName );
++ }
++
++ String parameterDefaultValue = "";
++ if ( fieldConfigurationElement != null && fieldConfigurationElement.hasAttribute( "default-value" ) )
++ {
++ parameterDefaultValue = " (Default: " + fieldConfigurationElement.getAttribute( "default-value" ) + ")";
++ }
++ append( sb, parameterName + parameterDefaultValue, 2 );
++ Node deprecated = findSingleChild( parameter, "deprecated" );
++ if ( ( deprecated != null ) && isNotEmpty( deprecated.getTextContent() ) )
++ {
++ append( sb, "Deprecated. " + deprecated.getTextContent(), 3 );
++ append( sb, "", 0 );
++ }
++ if ( isNotEmpty( parameterDescription ) ) {
++ append( sb, parameterDescription, 3 );
++ }
++ if ( "true".equals( getValue( parameter, "required" ) ) )
++ {
++ append( sb, "Required: Yes", 3 );
++ }
++ if ( ( fieldConfigurationElement != null ) && isNotEmpty( fieldConfigurationElement.getTextContent() ) )
++ {
++ String property = getPropertyFromExpression( fieldConfigurationElement.getTextContent() );
++ append( sb, "User property: " + property, 3 );
++ }
++
++ append( sb, "", 0 );
++ }
++
++ /**
++ * Repeat a String n
times to form a new string.
++ *
++ * @param str String to repeat
++ * @param repeat number of times to repeat str
++ * @return String with repeated String
++ * @throws NegativeArraySizeException if repeat < 0
++ * @throws NullPointerException if str is null
++ */
++ private static String repeat( String str, int repeat )
++ {
++ StringBuilder buffer = new StringBuilder( repeat * str.length() );
++
++ for ( int i = 0; i < repeat; i++ )
++ {
++ buffer.append( str );
++ }
++
++ return buffer.toString();
++ }
++
++ /**
++ * Append a description to the buffer by respecting the indentSize and lineLength parameters.
++ * Note: The last character is always a new line.
++ *
++ * @param sb The buffer to append the description, not null
.
++ * @param description The description, not null
.
++ * @param indent The base indentation level of each line, must not be negative.
++ */
++ private void append( StringBuilder sb, String description, int indent )
++ {
++ for ( String line : toLines( description, indent, indentSize, lineLength ) )
++ {
++ sb.append( line ).append( '\n' );
++ }
++ }
++
++ /**
++ * Splits the specified text into lines of convenient display length.
++ *
++ * @param text The text to split into lines, must not be null
.
++ * @param indent The base indentation level of each line, must not be negative.
++ * @param indentSize The size of each indentation, must not be negative.
++ * @param lineLength The length of the line, must not be negative.
++ * @return The sequence of display lines, never null
.
++ * @throws NegativeArraySizeException if indent < 0
++ */
++ private static List toLines( String text, int indent, int indentSize, int lineLength )
++ {
++ List lines = new ArrayList();
++
++ String ind = repeat( "\t", indent );
++
++ String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" );
++
++ for ( String plainLine : plainLines )
++ {
++ toLines( lines, ind + plainLine, indentSize, lineLength );
++ }
++
++ return lines;
++ }
++
++ /**
++ * Adds the specified line to the output sequence, performing line wrapping if necessary.
++ *
++ * @param lines The sequence of display lines, must not be null
.
++ * @param line The line to add, must not be null
.
++ * @param indentSize The size of each indentation, must not be negative.
++ * @param lineLength The length of the line, must not be negative.
++ */
++ private static void toLines( List lines, String line, int indentSize, int lineLength )
++ {
++ int lineIndent = getIndentLevel( line );
++ StringBuilder buf = new StringBuilder( 256 );
++
++ String[] tokens = line.split( " +" );
++
++ for ( String token : tokens )
++ {
++ if ( buf.length() > 0 )
++ {
++ if ( buf.length() + token.length() >= lineLength )
++ {
++ lines.add( buf.toString() );
++ buf.setLength( 0 );
++ buf.append( repeat( " ", lineIndent * indentSize ) );
++ }
++ else
++ {
++ buf.append( ' ' );
++ }
++ }
++
++ for ( int j = 0; j < token.length(); j++ )
++ {
++ char c = token.charAt( j );
++ if ( c == '\t' )
++ {
++ buf.append( repeat( " ", indentSize - buf.length() % indentSize ) );
++ }
++ else if ( c == '\u00A0' )
++ {
++ buf.append( ' ' );
++ }
++ else
++ {
++ buf.append( c );
++ }
++ }
++ }
++ lines.add( buf.toString() );
++ }
++
++ /**
++ * Gets the indentation level of the specified line.
++ *
++ * @param line The line whose indentation level should be retrieved, must not be null
.
++ * @return The indentation level of the line.
++ */
++ private static int getIndentLevel( String line )
++ {
++ int level = 0;
++ for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ )
++ {
++ level++;
++ }
++ for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ )
++ {
++ if ( line.charAt( i ) == '\t' )
++ {
++ level++;
++ break;
++ }
++ }
++ return level;
++ }
++
++ private static String getPropertyFromExpression( String expression )
++ {
++ if ( expression != null && expression.startsWith( "${" ) && expression.endsWith( "}" )
++ && !expression.substring( 2 ).contains( "${" ) )
++ {
++ // expression="${xxx}" -> property="xxx"
++ return expression.substring( 2, expression.length() - 1 );
++ }
++ // no property can be extracted
++ return null;
++ }
++}
diff --git a/maven-javadoc-plugin-build.xml b/maven-javadoc-plugin-build.xml
index 3a64dc6..e7da58a 100644
--- a/maven-javadoc-plugin-build.xml
+++ b/maven-javadoc-plugin-build.xml
@@ -14,12 +14,13 @@
value="The Apache Maven Javadoc Plugin is a plugin that uses the javadoc tool for generating javadocs for the specified project."/>
-
+
-
+
-
+
+
diff --git a/maven-javadoc-plugin.changes b/maven-javadoc-plugin.changes
index 65ca0fb..c83f787 100644
--- a/maven-javadoc-plugin.changes
+++ b/maven-javadoc-plugin.changes
@@ -1,3 +1,135 @@
+-------------------------------------------------------------------
+Sun Dec 8 19:49:03 UTC 2024 - Fridrich Strba
+
+- Upgrade to upstream version 3.11.2
+ * New Feature
+ + MJAVADOC-814: Ability to split grouped packages over multiple
+ lines
+ * Improvement
+ + MJAVADOC-823: legacyMode keeps using module-info.java
+ (-sourcedirectory still use as well as java files input)
+ * Task
+ + MJAVADOC-822: parameter skippedModules should scale and easier
+ to use
+
+-------------------------------------------------------------------
+Mon Nov 4 10:11:17 UTC 2024 - Fridrich Strba
+
+- Upgrade to upstream version 3.11.1
+- Version 3.11.1
+ * Bug
+ + MJAVADOC-820: [REGRESSION] MJAVADOC-787 was merged
+ incompletely
+ * New Feature
+ + MJAVADOC-787: Automatic detection of release option for
+ JDK < 9
+ * Task
+ + MJAVADOC-819: Align archive generation code with Maven Source
+ Plugin
+ + MJAVADOC-821: Align toolchain discovery code with Maven
+ Compiler Plugin
+ * Dependency upgrade
+ + MJAVADOC-816: Bump org.codehaus.plexus:plexus-java from
+ 1.2.0 to 1.3.0
+ + MJAVADOC-817: Upgrade to Doxia 2.0.0 GA Stack
+- Modified patches:
+ * maven-javadoc-plugin-bootstrap-resources.patch
+ + Regenerate from non-bootstrap build
+
+-------------------------------------------------------------------
+Thu Oct 3 22:19:41 UTC 2024 - Fridrich Strba
+
+- Upgrade to upstream version 3.10.1
+- Version 3.10.1
+ * Bug
+ + MJAVADOC-810: [REGRESSION] MJAVADOC-791 causes forked Maven
+ execution fail if any toolchains or settings file isn't
+ present
+ + MJAVADOC-811: javadoc.bat fails to execute on Windows when
+ project is not on drive C and AutoRun is configured
+ + MJAVADOC-812: [REGRESSION] maven-javadoc-plugin 3.10.0 creates
+ empty JARs
+- Version 3.10.0
+ * Bug
+ + MJAVADOC-560: Clarify outputDirectory, reportOutputDirectory
+ in javadoc:javadoc documentation
+ * Task
+ + MJAVADOC-776: Plugin depends on plexus-container-default,
+ which is EOL
+ + MJAVADOC-785: Align plugin implementation with
+ AbstractMavenReport (maven-reporting-impl)
+ + MJAVADOC-807: Simplify IT for MJAVADOC-498
+ + MJAVADOC-809: Align Mojo class names
+- Version 3.8.0
+ * Bug
+ + MJAVADOC-603: javadoc:fix failure on JDK10:
+ java.lang.ClassNotFoundException: java.sql.Connection
+ + MJAVADOC-751: No warnings for localized output
+ + MJAVADOC-775: Option 'taglets/taglet/tagletpath' ignored when
+ pointing to a JAR
+ + MJAVADOC-783: Invalid path when using TagletArtifact and
+ TagletPath
+ + MJAVADOC-791: maven-javadoc-plugin not working correctly
+ together with maven-toolchains-plugin
+ * Improvement
+ + MJAVADOC-796: Do not follow links for Java 12+
+ + MJAVADOC-798: Consider passing user settings when using
+ invoker
+ + MJAVADOC-802: Set default value of defaultAuthor parameter
+ in fix goals to ${user.name}
+ + MJAVADOC-803: Add default parameter to force root locale
+ * Test
+ + MJAVADOC-804: Temporary files are left after test execution
+ * Task
+ + MJAVADOC-799: Remove inconsistent
+ 'AbstractFixJavadocMojo#defaultVersion' default value
+- Version 3.7.0
+ * Bug
+ + MJAVADOC-793: java.lang.NullPointerException: Cannot invoke
+ "String.length()" because "text" is null
+- Version 3.6.3
+ * Bug
+ + MJAVADOC-682: Reactor builds fail when multiple modules with
+ same groupId:artifactId, but different versions
+ + MJAVADOC-780: Unit tests create null-null.jar in build root
+ directory
+ * Improvement
+ + MJAVADOC-779: Upgrade maven-plugin parent to 41
+ * Task
+ + MJAVADOC-782: Align read-only parameters naming with other
+ plugins
+- Version 3.6.2
+ * Bug
+ + MJAVADOC-713: Skipping Javadoc reportset leaves empty Javadoc
+ link in site
+ + MJAVADOC-716: The stale file detection does not work
+ + MJAVADOC-726: Maven Java Doc Plugin downloads Log4j-1.2.12
+ dependency transitively
+ + MJAVADOC-762: createTestRepo in JavaDocReportTest shares state
+ + MJAVADOC-774: 3.6.0 release is not reproducible
+ * Improvement
+ + MJAVADOC-730: Deprecate parameter "old"
+- Removed patches:
+ * no-override.patch
+ + not needed with this version
+- Modified patches:
+ * maven-javadoc-plugin-bootstrap-resources.patch
+ + Regenerate using maven-plugin-plugin 3.15 from non-bootstrap
+ build
+ * reproducible-from-environment.patch
+ * stale-data-encoding.patch
+ + adapt to changed context
+- Fetch sources from Github using source service
+
+-------------------------------------------------------------------
+Tue Sep 24 15:00:28 UTC 2024 - Fridrich Strba
+
+- Added patch:
+ * reproducible-from-environment.patch
+ + SOURCE_DATE_EPOCH environmental variable triggers reproducible
+ use of the maven-javadoc-plugin if it is not requested already
+ using the project.build.outputTimestamp option.
+
-------------------------------------------------------------------
Mon Jun 10 16:33:19 UTC 2024 - Fridrich Strba
@@ -114,7 +246,7 @@ Tue Oct 25 14:16:58 UTC 2022 - Fridrich Strba
* maven-javadoc-plugin-ioexception.patch
+ allow building with wider range of plexus-utils versions,
including the 3.5.0 that does not declare IOException as
- thrown in functions where it is actually not thrown.
+ thrown in functions where it is actually not thrown.
-------------------------------------------------------------------
Fri May 13 09:41:52 UTC 2022 - Fridrich Strba
diff --git a/maven-javadoc-plugin.spec b/maven-javadoc-plugin.spec
index 3da0f1d..2fbaeaf 100644
--- a/maven-javadoc-plugin.spec
+++ b/maven-javadoc-plugin.spec
@@ -23,17 +23,18 @@
%bcond_with bootstrap
%endif
%global base_name maven-javadoc-plugin
-Version: 3.6.0
+Version: 3.11.2
Release: 0
Summary: Maven plugin for creating javadocs
License: Apache-2.0
Group: Development/Libraries/Java
URL: https://maven.apache.org/plugins/maven-javadoc-plugin
-Source0: https://repo1.maven.org/maven2/org/apache/maven/plugins/%{base_name}/%{version}/%{base_name}-%{version}-source-release.zip
+Source0: %{base_name}-%{version}.tar.xz
Source1: %{base_name}-build.xml
Patch0: %{base_name}-bootstrap-resources.patch
Patch1: stale-data-encoding.patch
-Patch2: no-override.patch
+Patch2: reproducible-from-environment.patch
+BuildRequires: apache-commons-io
BuildRequires: apache-commons-lang3
BuildRequires: apache-commons-text
BuildRequires: atinject
@@ -43,16 +44,15 @@ BuildRequires: httpcomponents-core
BuildRequires: javapackages-local
BuildRequires: maven-archiver
BuildRequires: maven-common-artifact-filters
-BuildRequires: maven-doxia-core
-BuildRequires: maven-doxia-logging-api
-BuildRequires: maven-doxia-module-xhtml
BuildRequires: maven-doxia-sink-api
BuildRequires: maven-doxia-sitetools
BuildRequires: maven-invoker
BuildRequires: maven-lib
BuildRequires: maven-plugin-annotations
-BuildRequires: maven-reporting-api >= 3.1.0
+BuildRequires: maven-reporting-api
+BuildRequires: maven-reporting-impl
BuildRequires: maven-resolver-api
+BuildRequires: maven-resolver-impl
BuildRequires: maven-resolver-util
BuildRequires: maven-shared-utils
BuildRequires: maven-wagon-provider-api
@@ -65,10 +65,11 @@ BuildRequires: plexus-xml
BuildRequires: qdox
BuildRequires: sisu-inject
BuildRequires: sisu-plexus
+BuildRequires: slf4j
BuildRequires: unzip
BuildRequires: xmvn-install
BuildRequires: xmvn-resolve
-BuildRequires: mvn(org.apache.maven.plugins:maven-plugins:pom:)
+BuildRequires: mvn(org.apache.maven.plugins:maven-plugins:pom:) >= 40
BuildArch: noarch
%if %{with bootstrap}
Name: %{base_name}-bootstrap
@@ -81,7 +82,6 @@ BuildRequires: mvn(org.apache.maven.plugins:maven-compiler-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-jar-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-javadoc-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
-BuildRequires: mvn(org.apache.maven.plugins:maven-plugins:pom:) >= 40
BuildRequires: mvn(org.apache.maven.plugins:maven-resources-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-surefire-plugin)
BuildRequires: mvn(org.codehaus.modello:modello-maven-plugin)
@@ -117,9 +117,6 @@ cp %{SOURCE1} build.xml
%patch -P 1 -p1
%patch -P 2 -p1
-%pom_add_dep org.codehaus.plexus:plexus-xml:3.0.0
-
-%pom_xpath_remove pom:project/pom:parent/pom:relativePath
%pom_remove_dep :::test:
%build
@@ -134,10 +131,9 @@ build-jar-repository -s lib \
maven-archiver/maven-archiver \
maven-common-artifact-filters/maven-common-artifact-filters \
maven-doxia/doxia-core \
- maven-doxia/doxia-logging-api \
- maven-doxia/doxia-module-xhtml \
maven-doxia/doxia-module-xhtml5 \
maven-doxia/doxia-sink-api \
+ maven-doxia-sitetools/doxia-integration-tools \
maven-doxia-sitetools/doxia-site-renderer \
maven-invoker/maven-invoker \
maven/maven-artifact \
@@ -160,8 +156,9 @@ build-jar-repository -s lib \
plexus-languages/plexus-java \
plexus/utils \
plexus/xml \
- qdox
-%{ant} -Dtest.skip=true jar
+ qdox \
+ slf4j/api
+ant -Dtest.skip=true jar
%else
xmvn --batch-mode --offline \
-Dmaven.test.skip=true -DmavenVersion=3.5.0 \
@@ -178,13 +175,9 @@ xmvn --batch-mode --offline \
%fdupes -s %{buildroot}%{_javadocdir}
%files -f .mfiles
-%license LICENSE
-%doc NOTICE
%if %{without bootstrap}
%files javadoc -f .mfiles-javadoc
-%license LICENSE
-%doc NOTICE
%endif
%changelog
diff --git a/no-override.patch b/no-override.patch
deleted file mode 100644
index c72e70b..0000000
--- a/no-override.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- maven-javadoc-plugin-3.5.0/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java 2023-09-14 14:27:44.286360008 +0200
-+++ maven-javadoc-plugin-3.5.0/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java 2023-09-14 14:34:08.848960654 +0200
-@@ -118,7 +118,6 @@
- }
-
- /** {@inheritDoc} */
-- @Override
- public void generate(org.codehaus.doxia.sink.Sink sink, Locale locale) throws MavenReportException {
- generate(sink, null, locale);
- }
diff --git a/reproducible-from-environment.patch b/reproducible-from-environment.patch
new file mode 100644
index 0000000..abb0d0e
--- /dev/null
+++ b/reproducible-from-environment.patch
@@ -0,0 +1,17 @@
+--- 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())
diff --git a/stale-data-encoding.patch b/stale-data-encoding.patch
index 3f55c4d..4a6dd83 100644
--- a/stale-data-encoding.patch
+++ b/stale-data-encoding.patch
@@ -1,6 +1,6 @@
---- maven-javadoc-plugin-3.5.0/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java 2023-09-14 14:20:14.049981880 +0200
-+++ maven-javadoc-plugin-3.5.0/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java 2023-09-14 14:25:18.258705774 +0200
-@@ -41,6 +41,19 @@
+--- 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 {
@@ -20,7 +20,7 @@
/**
* Compute the data used to detect a stale javadoc
*
-@@ -56,13 +69,7 @@
+@@ -55,13 +68,7 @@ public class StaleHelper {
String[] args = cmd.getArguments();
Collections.addAll(options, args);
@@ -35,18 +35,16 @@
for (String arg : args) {
if (arg.startsWith("@")) {
-@@ -116,9 +123,11 @@
+@@ -115,9 +122,11 @@ public class StaleHelper {
*/
public static void writeStaleData(Commandline cmd, Path path) throws MavenReportException {
try {
+ final Charset cs = getDataCharset();
+
- String curdata = getStaleData(cmd);
+ List curdata = getStaleData(cmd);
Files.createDirectories(path.getParent());
-- Files.write(path, Collections.singleton(curdata), Charset.defaultCharset());
-+ Files.write(path, Collections.singleton(curdata), cs);
+- Files.write(path, curdata, StandardCharsets.UTF_8);
++ Files.write(path, curdata, cs);
} catch (IOException e) {
throw new MavenReportException("Error checking stale data", e);
}
-Only in maven-javadoc-plugin-3.5.0/src/main/java/org/apache/maven/plugins/javadoc: StaleHelper.java.orig
-Only in maven-javadoc-plugin-3.5.0/src/main/java/org/apache/maven/plugins/javadoc: StaleHelper.java.rej