Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package moditect for openSUSE:Factory checked in at 2025-07-22 12:19:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/moditect (Old) and /work/SRC/openSUSE:Factory/.moditect.new.8875 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "moditect" Tue Jul 22 12:19:58 2025 rev:4 rq:1294868 version:1.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/moditect/moditect.changes 2024-09-06 17:18:34.591969994 +0200 +++ /work/SRC/openSUSE:Factory/.moditect.new.8875/moditect.changes 2025-07-22 12:20:03.823542859 +0200 @@ -1,0 +2,9 @@ +Wed Jul 16 14:59:10 UTC 2025 - Fridrich Strba <fst...@suse.com> + +- Do not shade dependencies +- Added patch: + * 0001-Use-maven-archiver-to-parse-ouputTimestamp.patch + + use MavenArchiver.parseBuildOutputTimestamp instead of custom + outputTimestamp parser + +------------------------------------------------------------------- New: ---- 0001-Use-maven-archiver-to-parse-ouputTimestamp.patch ----------(New B)---------- New:- Added patch: * 0001-Use-maven-archiver-to-parse-ouputTimestamp.patch + use MavenArchiver.parseBuildOutputTimestamp instead of custom ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ moditect.spec ++++++ --- /var/tmp/diff_new_pack.EA1CMs/_old 2025-07-22 12:20:04.363565388 +0200 +++ /var/tmp/diff_new_pack.EA1CMs/_new 2025-07-22 12:20:04.363565388 +0200 @@ -1,7 +1,7 @@ # # spec file for package moditect # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,12 +24,18 @@ Group: Development/Libraries/Java URL: https://github.com/%{name}/%{name} Source0: %{url}/archive/refs/tags/%{version}.Final.tar.gz +Patch0: 0001-Use-maven-archiver-to-parse-ouputTimestamp.patch BuildRequires: fdupes BuildRequires: maven-local BuildRequires: mvn(com.beust:jcommander) BuildRequires: mvn(com.github.javaparser:javaparser-core) +BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations) BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin) -BuildRequires: mvn(org.apache.maven.plugins:maven-shade-plugin) +BuildRequires: mvn(org.apache.maven:maven-archiver) +BuildRequires: mvn(org.apache.maven:maven-core) +BuildRequires: mvn(org.apache.maven:maven-plugin-api) +BuildRequires: mvn(org.eclipse.aether:aether-util) +BuildRequires: mvn(org.ow2.asm:asm) BuildArch: noarch %description @@ -63,6 +69,7 @@ %prep %setup -q -n %{name}-%{version}.Final +%patch -P 0 -p1 %pom_remove_parent parent @@ -73,10 +80,10 @@ %pom_disable_module integrationtest %pom_change_dep org.jcommander:jcommander com.beust: core +%pom_remove_plugin :maven-shade-plugin core %build -%{mvn_build} -f -- \ - -Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ) +%{mvn_build} -f %install %mvn_install ++++++ 0001-Use-maven-archiver-to-parse-ouputTimestamp.patch ++++++ >From 444f78dfd8e6919faccc001887597fb3e69e961a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.st...@bluewin.ch> Date: Wed, 16 Jul 2025 17:46:10 +0200 Subject: [PATCH] Use maven-archiver to parse ouputTimestamp --- maven-plugin/pom.xml | 5 ++ .../mavenplugin/add/AddModuleInfoMojo.java | 53 ++----------------- 2 files changed, 8 insertions(+), 50 deletions(-) diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index ea2ca1a..5756d49 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -59,6 +59,11 @@ <artifactId>moditect</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-archiver</artifactId> + <version>3.6.2</version> + </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> diff --git a/maven-plugin/src/main/java/org/moditect/mavenplugin/add/AddModuleInfoMojo.java b/maven-plugin/src/main/java/org/moditect/mavenplugin/add/AddModuleInfoMojo.java index cb5299d..68e0650 100644 --- a/maven-plugin/src/main/java/org/moditect/mavenplugin/add/AddModuleInfoMojo.java +++ b/maven-plugin/src/main/java/org/moditect/mavenplugin/add/AddModuleInfoMojo.java @@ -12,11 +12,6 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; -import java.time.Instant; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeParseException; -import java.time.temporal.ChronoUnit; import java.util.Arrays; import java.util.Enumeration; import java.util.HashMap; @@ -31,6 +26,7 @@ import java.util.jar.JarFile; import java.util.regex.Pattern; import java.util.stream.Collectors; +import org.apache.maven.archiver.MavenArchiver; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.resolver.filter.AndArtifactFilter; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; @@ -189,7 +185,7 @@ public class AddModuleInfoMojo extends AbstractMojo { outputPath, jvmVersion, overwriteExistingFiles, - InstantConverter.convert(outputTimestamp)); + MavenArchiver.parseBuildOutputTimestamp(outputTimestamp).orElse(null)); addModuleInfo.run(); @@ -226,7 +222,7 @@ public class AddModuleInfoMojo extends AbstractMojo { outputPath, jvmVersion, overwriteExistingFiles, - InstantConverter.convert(outputTimestamp)); + MavenArchiver.parseBuildOutputTimestamp(outputTimestamp).orElse(null)); addModuleInfo.run(); try { @@ -490,47 +486,4 @@ public class AddModuleInfoMojo extends AbstractMojo { return null; } - - private static class InstantConverter { - - private static final Instant DATE_MIN = Instant.parse("1980-01-01T00:00:02Z"); - private static final Instant DATE_MAX = Instant.parse("2099-12-31T23:59:59Z"); - - public static Instant convert(String value) { - if (value == null) { - return null; - } - - // Number representing seconds since the epoch - if (!value.isEmpty() && isNumeric(value)) { - return Instant.ofEpochSecond(Long.parseLong(value.trim())); - } - - try { - // Parse the date in UTC such as '2011-12-03T10:15:30Z' or with an offset '2019-10-05T20:37:42+06:00'. - final Instant date = OffsetDateTime.parse(value) - .withOffsetSameInstant(ZoneOffset.UTC).truncatedTo(ChronoUnit.SECONDS).toInstant(); - - if (date.isBefore(DATE_MIN) || date.isAfter(DATE_MAX)) { - throw new IllegalArgumentException("'" + date + "' is not within the valid range " - + DATE_MIN + " to " + DATE_MAX); - } - return date; - } - catch (DateTimeParseException pe) { - throw new IllegalArgumentException("Invalid project.build.outputTimestamp value '" + value + "'", - pe); - } - } - - private static boolean isNumeric(String str) { - try { - Long.parseLong(str.trim()); - return true; - } - catch (NumberFormatException e) { - return false; - } - } - } } -- 2.50.1