forked from pool/maven-javadoc-plugin
54 lines
2.2 KiB
Diff
54 lines
2.2 KiB
Diff
--- 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<>();
|