Skip to content

Commit

Permalink
[MJAVADOC-719] - Update Maven Archiver to 3.6.0
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Solórzano <jorsol@gmail.com>
  • Loading branch information
jorsol authored and slawekjaranowski committed Jul 4, 2022
1 parent 34b501d commit 497f80f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
14 changes: 2 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ under the License.
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
<version>3.5.2</version>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
Expand Down Expand Up @@ -285,20 +285,10 @@ under the License.
<artifactId>plexus-java</artifactId>
<version>${plexus-java.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.2.7</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.3.0</version>
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.time.LocalDate;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
Expand Down Expand Up @@ -3037,14 +3037,12 @@ private String getBottomText()
{
final String inceptionYear = project.getInceptionYear();

// get Reproducible Builds outputTimestamp value
final Calendar currentYearCal = Calendar.getInstance();
final Date reproducibleDate = new MavenArchiver().parseOutputTimestamp( outputTimestamp );
if ( reproducibleDate != null )
{
currentYearCal.setTime( reproducibleDate );
}
final String currentYear = String.valueOf( currentYearCal.get( Calendar.YEAR ) );
// get Reproducible Builds outputTimestamp date value or the current local date.
final LocalDate localDate = MavenArchiver.parseBuildOutputTimestamp( outputTimestamp )
.map( instant -> instant.atZone( ZoneOffset.UTC ).toLocalDate() )
.orElseGet( LocalDate::now );

final String currentYear = Integer.toString( localDate.getYear() );

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

Expand Down Expand Up @@ -5656,6 +5654,12 @@ private void addStandardDocletOptions( File javadocOutputDirectory,

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

if ( MavenArchiver.parseBuildOutputTimestamp( outputTimestamp ).isPresent() )
{
// Override the notimestamp option if a Reproducible Build is requested.
notimestamp = true;
}

addArgIf( arguments, notimestamp, "-notimestamp", SINCE_JAVADOC_1_5 );

addArgIf( arguments, notree, "-notree" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private File generateArchive( File javadocFiles, String jarFileName )
archiver.setOutputFile( javadocJar );

// configure for Reproducible Builds based on outputTimestamp value
archiver.configureReproducible( outputTimestamp );
archiver.configureReproducibleBuild( outputTimestamp );

if ( !javadocFiles.exists() )
{
Expand Down

0 comments on commit 497f80f

Please sign in to comment.