Skip to content

Commit 497f80f

Browse files
jorsolslawekjaranowski
authored andcommitted
[MJAVADOC-719] - Update Maven Archiver to 3.6.0
Signed-off-by: Jorge Solórzano <[email protected]>
1 parent 34b501d commit 497f80f

File tree

3 files changed

+17
-23
lines changed

3 files changed

+17
-23
lines changed

pom.xml

+2-12
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ under the License.
212212
<dependency>
213213
<groupId>org.apache.maven</groupId>
214214
<artifactId>maven-archiver</artifactId>
215-
<version>3.5.2</version>
215+
<version>3.6.0</version>
216216
</dependency>
217217
<dependency>
218218
<groupId>org.apache.maven.shared</groupId>
@@ -285,20 +285,10 @@ under the License.
285285
<artifactId>plexus-java</artifactId>
286286
<version>${plexus-java.version}</version>
287287
</dependency>
288-
<dependency>
289-
<groupId>org.codehaus.plexus</groupId>
290-
<artifactId>plexus-archiver</artifactId>
291-
<version>4.2.7</version>
292-
</dependency>
293-
<dependency>
294-
<groupId>org.codehaus.plexus</groupId>
295-
<artifactId>plexus-io</artifactId>
296-
<version>3.2.0</version>
297-
</dependency>
298288
<dependency>
299289
<groupId>org.codehaus.plexus</groupId>
300290
<artifactId>plexus-utils</artifactId>
301-
<version>3.3.0</version>
291+
<version>3.4.2</version>
302292
</dependency>
303293
<dependency>
304294
<groupId>commons-io</groupId>

src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java

+14-10
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@
119119
import java.nio.file.Files;
120120
import java.nio.file.Path;
121121
import java.nio.file.StandardCopyOption;
122+
import java.time.LocalDate;
123+
import java.time.ZoneOffset;
122124
import java.util.ArrayList;
123125
import java.util.Arrays;
124-
import java.util.Calendar;
125126
import java.util.Collection;
126127
import java.util.Collections;
127-
import java.util.Date;
128128
import java.util.HashMap;
129129
import java.util.HashSet;
130130
import java.util.LinkedHashMap;
@@ -3037,14 +3037,12 @@ private String getBottomText()
30373037
{
30383038
final String inceptionYear = project.getInceptionYear();
30393039

3040-
// get Reproducible Builds outputTimestamp value
3041-
final Calendar currentYearCal = Calendar.getInstance();
3042-
final Date reproducibleDate = new MavenArchiver().parseOutputTimestamp( outputTimestamp );
3043-
if ( reproducibleDate != null )
3044-
{
3045-
currentYearCal.setTime( reproducibleDate );
3046-
}
3047-
final String currentYear = String.valueOf( currentYearCal.get( Calendar.YEAR ) );
3040+
// get Reproducible Builds outputTimestamp date value or the current local date.
3041+
final LocalDate localDate = MavenArchiver.parseBuildOutputTimestamp( outputTimestamp )
3042+
.map( instant -> instant.atZone( ZoneOffset.UTC ).toLocalDate() )
3043+
.orElseGet( LocalDate::now );
3044+
3045+
final String currentYear = Integer.toString( localDate.getYear() );
30483046

30493047
String theBottom = StringUtils.replace( this.bottom, "{currentYear}", currentYear );
30503048

@@ -5656,6 +5654,12 @@ private void addStandardDocletOptions( File javadocOutputDirectory,
56565654

56575655
addArgIf( arguments, nosince, "-nosince" );
56585656

5657+
if ( MavenArchiver.parseBuildOutputTimestamp( outputTimestamp ).isPresent() )
5658+
{
5659+
// Override the notimestamp option if a Reproducible Build is requested.
5660+
notimestamp = true;
5661+
}
5662+
56595663
addArgIf( arguments, notimestamp, "-notimestamp", SINCE_JAVADOC_1_5 );
56605664

56615665
addArgIf( arguments, notree, "-notree" );

src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ private File generateArchive( File javadocFiles, String jarFileName )
270270
archiver.setOutputFile( javadocJar );
271271

272272
// configure for Reproducible Builds based on outputTimestamp value
273-
archiver.configureReproducible( outputTimestamp );
273+
archiver.configureReproducibleBuild( outputTimestamp );
274274

275275
if ( !javadocFiles.exists() )
276276
{

0 commit comments

Comments
 (0)