28 Commits

Author SHA256 Message Date
02df442efa Accepting request 1298749 from Java:packages
3.6.4

OBS-URL: https://build.opensuse.org/request/show/1298749
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-archiver?expand=0&rev=10
2025-08-11 11:54:01 +00:00
faf802e726 Accepting request 1295692 from Java:packages
small tiny change again

OBS-URL: https://build.opensuse.org/request/show/1295692
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-archiver?expand=0&rev=9
2025-07-25 15:06:14 +00:00
990b5eac1a OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=26 2025-07-25 07:16:02 +00:00
82be6853a6 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=25 2025-07-25 07:15:06 +00:00
965a2103dc Accepting request 1295480 from Java:packages
rebase patches to accepted pull request

OBS-URL: https://build.opensuse.org/request/show/1295480
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-archiver?expand=0&rev=8
2025-07-24 16:47:20 +00:00
a63287332f OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=23 2025-07-24 09:25:23 +00:00
8357f71b5f Accepting request 1294787 from Java:packages
Some reproducible changes

OBS-URL: https://build.opensuse.org/request/show/1294787
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-archiver?expand=0&rev=7
2025-07-22 10:54:16 +00:00
9a5f609688 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=21 2025-07-21 10:32:50 +00:00
cbde43e471 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=20 2025-07-21 10:20:34 +00:00
5da9d2beef OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=19 2025-07-17 05:27:36 +00:00
dadbd2c225 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=18 2025-07-16 07:13:06 +00:00
1fb345de68 Accepting request 1283730 from Java:packages
Fix exception with empty Automatic-Module-Name

OBS-URL: https://build.opensuse.org/request/show/1283730
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-archiver?expand=0&rev=6
2025-06-10 07:03:21 +00:00
b1c672a73a OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=16 2025-06-06 14:34:33 +00:00
67fd2cd473 Accepting request 1219155 from Java:packages
3.6.3

OBS-URL: https://build.opensuse.org/request/show/1219155
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-archiver?expand=0&rev=5
2024-10-30 16:35:10 +00:00
0d3f944895 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=14 2024-10-29 18:32:37 +00:00
0d50e5e1a4 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=13 2024-10-27 22:11:36 +00:00
1d190bcf17 Accepting request 1109287 from Java:packages
3.6.1

OBS-URL: https://build.opensuse.org/request/show/1109287
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-archiver?expand=0&rev=4
2023-09-06 17:00:08 +00:00
8eb1944e06 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=11 2023-09-06 15:27:42 +00:00
9b282ad9cd OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=10 2023-09-06 14:28:44 +00:00
a9834a436e OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=9 2023-09-05 10:02:02 +00:00
c9f716004b OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=8 2023-09-04 18:53:55 +00:00
efc18d5d44 Accepting request 963334 from Java:packages
Build with source/target levels 8

OBS-URL: https://build.opensuse.org/request/show/963334
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-archiver?expand=0&rev=3
2022-03-21 19:11:02 +00:00
c3f36a51e4 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=6 2022-03-20 19:55:03 +00:00
73af195b70 Accepting request 750558 from Java:packages
3.5.0

OBS-URL: https://build.opensuse.org/request/show/750558
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-archiver?expand=0&rev=2
2019-11-26 15:58:00 +00:00
8c0cb92e44 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=4 2019-11-24 14:41:22 +00:00
11ee017250 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=3 2019-11-22 02:56:51 +00:00
27fc68ff12 Accepting request 690909 from Java:packages
new package

OBS-URL: https://build.opensuse.org/request/show/690909
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-archiver?expand=0&rev=1
2019-04-05 10:01:35 +00:00
2150ccc3a0 OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-archiver?expand=0&rev=1 2019-03-25 06:53:16 +00:00
4 changed files with 0 additions and 139 deletions

View File

@@ -1,54 +0,0 @@
--- maven-archiver-3.6.3/src/main/java/org/apache/maven/archiver/MavenArchiver.java 2025-07-24 11:19:55.246162093 +0200
+++ maven-archiver-3.6.3/src/main/java/org/apache/maven/archiver/MavenArchiver.java 2025-07-24 11:21:19.107011760 +0200
@@ -597,7 +597,9 @@
String automaticModuleName = manifest.getMainSection().getAttributeValue("Automatic-Module-Name");
if (automaticModuleName != null) {
- if (!isValidModuleName(automaticModuleName)) {
+ if (automaticModuleName.isEmpty()) {
+ manifest.getMainSection().removeAttribute("Automatic-Module-Name");
+ } else if (!isValidModuleName(automaticModuleName)) {
throw new ManifestException("Invalid automatic module name: '" + automaticModuleName + "'");
}
}
--- maven-archiver-3.6.3/src/test/java/org/apache/maven/archiver/MavenArchiverTest.java 2025-07-24 11:19:55.246960737 +0200
+++ maven-archiver-3.6.3/src/test/java/org/apache/maven/archiver/MavenArchiverTest.java 2025-07-24 11:21:19.107155460 +0200
@@ -563,9 +563,37 @@
}
/*
- * Test to make sure that manifest sections are present in the manifest prior to the archive has been created.
+ * Test to make sure that empty Automatic-Module-Name will result in no
+ * Automatic-Module-Name attribute at all, but that the archive will be created.
*/
@Test
+ void testManifestWithEmptyAutomaticModuleName() throws Exception {
+ File jarFile = new File("target/test/dummy.jar");
+ JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
+
+ MavenArchiver archiver = getMavenArchiver(jarArchiver);
+
+ MavenSession session = getDummySession();
+ MavenProject project = getDummyProject();
+ MavenArchiveConfiguration config = new MavenArchiveConfiguration();
+
+ Map<String, String> manifestEntries = new HashMap<>();
+ manifestEntries.put("Automatic-Module-Name", "");
+ config.setManifestEntries(manifestEntries);
+
+ archiver.createArchive(session, project, config);
+ assertThat(jarFile).exists();
+
+ final Manifest jarFileManifest = getJarFileManifest(jarFile);
+ Attributes manifest = jarFileManifest.getMainAttributes();
+
+ assertThat(manifest).doesNotContainKey(new Attributes.Name("Automatic-Module-Name"));
+ }
+
+ //
+ // Test to make sure that manifest sections are present in the manifest prior to the archive has been created.
+ //
+ @Test
void testManifestSections() throws Exception {
MavenArchiver archiver = new MavenArchiver();

BIN
maven-archiver-3.6.1-source-release.zip (Stored with Git LFS)

Binary file not shown.

BIN
maven-archiver-3.6.3-source-release.zip (Stored with Git LFS)

Binary file not shown.

View File

@@ -1,79 +0,0 @@
--- maven-archiver-3.6.3/pom.xml 2025-07-25 08:59:38.427807182 +0200
+++ maven-archiver-3.6.3/pom.xml 2025-07-25 08:59:51.766807935 +0200
@@ -115,4 +115,22 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <excludedEnvironmentVariables>
+ <excludedEnvironmentVariable>SOURCE_DATE_EPOCH</excludedEnvironmentVariable>
+ </excludedEnvironmentVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
</project>
--- maven-archiver-3.6.3/src/main/java/org/apache/maven/archiver/MavenArchiver.java 2025-07-25 08:59:38.426221268 +0200
+++ maven-archiver-3.6.3/src/main/java/org/apache/maven/archiver/MavenArchiver.java 2025-07-25 09:00:55.991543025 +0200
@@ -66,7 +66,6 @@
*
* @author <a href="evenisse@apache.org">Emmanuel Venisse</a>
* @author kama
- * @version $Id: $Id
*/
public class MavenArchiver {
@@ -745,6 +744,9 @@
* <p>Either as {@link java.time.format.DateTimeFormatter#ISO_OFFSET_DATE_TIME} or as a number representing seconds
* since the epoch (like <a href="https://reproducible-builds.org/docs/source-date-epoch/">SOURCE_DATE_EPOCH</a>).
*
+ * <p>Since 3.6.4, if not configured or disabled, the {@code SOURCE_DATE_EPOCH} environment variable is used as
+ * a fallback value, to ease forcing Reproducible Build externally when the build has not enabled it natively in POM.
+ *
* @param outputTimestamp the value of {@code ${project.build.outputTimestamp}} (may be {@code null})
* @return the parsed timestamp as an {@code Optional<Instant>}, {@code empty} if input is {@code null} or input
* contains only 1 character (not a number)
@@ -753,12 +755,19 @@
* the valid range 1980-01-01T00:00:02Z to 2099-12-31T23:59:59Z as defined by
* <a href="https://pkwaredownloads.blob.core.windows.net/pem/APPNOTE.txt">ZIP application note</a>,
* section 4.4.6.
+ * @see <a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=74682318">Maven Wiki "Reproducible/Verifiable
+ * Builds"</a>
*/
public static Optional<Instant> parseBuildOutputTimestamp(String outputTimestamp) {
- // Fail-fast on nulls
+ // Fail fast on null and no timestamp configured (1 character configuration is useful to override
+ // a full value during pom inheritance)
+ if (outputTimestamp == null || (outputTimestamp.length() < 2 && !isNumeric(outputTimestamp))) {
+ // Reproducible Builds not configured or disabled => fallback to SOURCE_DATE_EPOCH env
+ outputTimestamp = System.getenv("SOURCE_DATE_EPOCH");
if (outputTimestamp == null) {
return Optional.empty();
}
+ }
// Number representing seconds since the epoch
if (isNumeric(outputTimestamp)) {
@@ -771,12 +780,6 @@
return Optional.of(date);
}
- // no timestamp configured (1 character configuration is useful to override a full value during pom
- // inheritance)
- if (outputTimestamp.length() < 2) {
- return Optional.empty();
- }
-
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(outputTimestamp)