Skip to content

Commit

Permalink
[MRRESOURCES-139] Bump Bump maven-archiver from 3.6.0 to 3.6.1
Browse files Browse the repository at this point in the history
Avoid using deprecated methods
  • Loading branch information
slawekjaranowski committed Sep 13, 2023
1 parent 296c2ab commit 5ee6079
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ under the License.
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TimeZone;
import java.util.TreeMap;

import org.apache.commons.io.output.DeferredFileOutputStream;
Expand Down Expand Up @@ -800,14 +800,13 @@ public Object internalGet(String key) {
context.put(KEY_PROJECTS_ORGS, null);
// the following properties are cheap to calculate, so we provide them eagerly

// Reproducible Builds: try to use reproducible output timestamp
MavenArchiver archiver = new MavenArchiver();
Date outputDate = archiver.parseOutputTimestamp(outputTimestamp);

String inceptionYear = project.getInceptionYear();
SimpleDateFormat yearFormat = new SimpleDateFormat("yyyy");
yearFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
String year = yearFormat.format((outputDate == null) ? new Date() : outputDate);

// Reproducible Builds: try to use reproducible output timestamp
String year = MavenArchiver.parseBuildOutputTimestamp(outputTimestamp)
.orElseGet(Instant::now)
.atZone(ZoneId.of("UTC+10"))
.format(DateTimeFormatter.ofPattern("yyyy"));

if (inceptionYear == null || inceptionYear.isEmpty()) {
if (getLog().isDebugEnabled()) {
Expand Down

0 comments on commit 5ee6079

Please sign in to comment.