|
119 | 119 | import java.nio.file.Files;
|
120 | 120 | import java.nio.file.Path;
|
121 | 121 | import java.nio.file.StandardCopyOption;
|
| 122 | +import java.time.LocalDate; |
| 123 | +import java.time.ZoneOffset; |
122 | 124 | import java.util.ArrayList;
|
123 | 125 | import java.util.Arrays;
|
124 |
| -import java.util.Calendar; |
125 | 126 | import java.util.Collection;
|
126 | 127 | import java.util.Collections;
|
127 |
| -import java.util.Date; |
128 | 128 | import java.util.HashMap;
|
129 | 129 | import java.util.HashSet;
|
130 | 130 | import java.util.LinkedHashMap;
|
@@ -3037,14 +3037,12 @@ private String getBottomText()
|
3037 | 3037 | {
|
3038 | 3038 | final String inceptionYear = project.getInceptionYear();
|
3039 | 3039 |
|
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() ); |
3048 | 3046 |
|
3049 | 3047 | String theBottom = StringUtils.replace( this.bottom, "{currentYear}", currentYear );
|
3050 | 3048 |
|
@@ -5656,6 +5654,12 @@ private void addStandardDocletOptions( File javadocOutputDirectory,
|
5656 | 5654 |
|
5657 | 5655 | addArgIf( arguments, nosince, "-nosince" );
|
5658 | 5656 |
|
| 5657 | + if ( MavenArchiver.parseBuildOutputTimestamp( outputTimestamp ).isPresent() ) |
| 5658 | + { |
| 5659 | + // Override the notimestamp option if a Reproducible Build is requested. |
| 5660 | + notimestamp = true; |
| 5661 | + } |
| 5662 | + |
5659 | 5663 | addArgIf( arguments, notimestamp, "-notimestamp", SINCE_JAVADOC_1_5 );
|
5660 | 5664 |
|
5661 | 5665 | addArgIf( arguments, notree, "-notree" );
|
|
0 commit comments