Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MJAVADOC-719] - Update Maven Archiver to 3.6.0 #150

Merged
merged 1 commit into from Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 2 additions & 12 deletions pom.xml
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
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
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