forked from pool/maven-javadoc-plugin
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 14 06:23:46 UTC 2022 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
- Added patch:
|
||||
* stale-data-encoding.patch
|
||||
+ respect specified encoding when writing stale data
|
||||
+ fixes build with utf-8 sources on non utf-8 platforms
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 11 07:05:23 UTC 2022 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
|
@@ -32,6 +32,7 @@ URL: http://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
|
||||
Source1: %{base_name}-build.xml
|
||||
Patch0: %{base_name}-bootstrap-resources.patch
|
||||
Patch1: stale-data-encoding.patch
|
||||
BuildRequires: apache-commons-cli
|
||||
BuildRequires: apache-commons-io
|
||||
BuildRequires: apache-commons-lang3
|
||||
@@ -120,6 +121,7 @@ API documentation for %{name}.
|
||||
cp %{SOURCE1} build.xml
|
||||
%patch0 -p1
|
||||
%endif
|
||||
%patch1 -p1
|
||||
|
||||
%pom_xpath_remove pom:project/pom:parent/pom:relativePath
|
||||
%pom_remove_dep :::test:
|
||||
|
53
stale-data-encoding.patch
Normal file
53
stale-data-encoding.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
--- maven-javadoc-plugin-3.3.2/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java 2022-02-07 20:52:42.000000000 +0100
|
||||
+++ maven-javadoc-plugin-3.3.2/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java 2022-03-14 07:21:32.537764730 +0100
|
||||
@@ -5969,7 +5969,7 @@
|
||||
if ( !isUpToDate( cmd ) )
|
||||
{
|
||||
doExecuteJavadocCommandLine( cmd, javadocOutputDirectory );
|
||||
- StaleHelper.writeStaleData( cmd, staleDataPath.toPath() );
|
||||
+ StaleHelper.writeStaleData( cmd, staleDataPath.toPath(), Charset.forName(getEncoding()) );
|
||||
}
|
||||
}
|
||||
else
|
||||
--- maven-javadoc-plugin-3.3.2/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java 2022-02-07 20:52:42.000000000 +0100
|
||||
+++ maven-javadoc-plugin-3.3.2/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java 2022-03-14 07:19:21.228985255 +0100
|
||||
@@ -134,16 +134,17 @@
|
||||
*
|
||||
* @param cmd the command line
|
||||
* @param path the stale data path
|
||||
+ * @param encoding the encoding of source files
|
||||
* @throws MavenReportException if an error occurs
|
||||
*/
|
||||
- public static void writeStaleData( Commandline cmd, Path path )
|
||||
+ public static void writeStaleData( Commandline cmd, Path path, Charset charset )
|
||||
throws MavenReportException
|
||||
{
|
||||
try
|
||||
{
|
||||
String curdata = getStaleData( cmd );
|
||||
Files.createDirectories( path.getParent() );
|
||||
- Files.write( path, Collections.singleton( curdata ), Charset.defaultCharset() );
|
||||
+ Files.write( path, Collections.singleton( curdata ), charset );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
@@ -151,6 +152,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Write the data used to detect a stale javadoc
|
||||
+ *
|
||||
+ * @param cmd the command line
|
||||
+ * @param path the stale data path
|
||||
+ * @throws MavenReportException if an error occurs
|
||||
+ */
|
||||
+ public static void writeStaleData( Commandline cmd, Path path )
|
||||
+ throws MavenReportException
|
||||
+ {
|
||||
+ writeStaleData( cmd, path, Charset.defaultCharset());
|
||||
+ }
|
||||
+
|
||||
private static Collection<Path> walk( Path dir )
|
||||
{
|
||||
Collection<Path> paths = new ArrayList<>();
|
Reference in New Issue
Block a user