File tree Expand file tree Collapse file tree
src/main/java/org/codehaus/plexus/archiver/jar Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 build :
2424 name : Build it
2525 uses : codehaus-plexus/.github/.github/workflows/maven.yml@master
26+ with :
27+ # Execute on a jdk between 17 and 17.0.2 to explicitly test workaround for jar tool --date support not present in that version
28+ # See org.codehaus.plexus.archiver.jar.JarToolModularJarArchiver.isJarDateOptionSupported
29+ # https://github.com/codehaus-plexus/plexus-archiver/issues/164
30+ matrix-include : >
31+ [
32+ {"jdk": "17.0.2", "os": "windows-latest", distribution: "zulu" }
33+ ]
2634
2735# deploy:
2836# name: Deploy
Original file line number Diff line number Diff line change @@ -153,9 +153,14 @@ protected void postCreateArchive() throws ArchiverException {
153153 private void fixLastModifiedTimeZipEntries () throws IOException {
154154 long timeMillis = getLastModifiedTime ().toMillis ();
155155 Path destFile = getDestFile ().toPath ();
156- PosixFileAttributes posixFileAttributes = Files .getFileAttributeView (
157- destFile , PosixFileAttributeView .class , LinkOption .NOFOLLOW_LINKS )
158- .readAttributes ();
156+ PosixFileAttributeView view =
157+ Files .getFileAttributeView (destFile , PosixFileAttributeView .class , LinkOption .NOFOLLOW_LINKS );
158+
159+ PosixFileAttributes posixFileAttributes = null ;
160+ if (view != null ) {
161+ posixFileAttributes = view .readAttributes ();
162+ }
163+
159164 FileAttribute <?>[] attributes ;
160165 if (posixFileAttributes != null ) {
161166 attributes = new FileAttribute <?>[1 ];
@@ -272,7 +277,7 @@ private static FileTime revertToLocalTime(FileTime time) {
272277 }
273278
274279 /**
275- * Check support for {@code --date} option introduced since Java 17.0.3 ( JDK-8279925) .
280+ * Check support for {@code --date} option introduced since Java 17.0.3 with <a href="https://bugs.openjdk.org/browse/ JDK-8277755">JDK-8277755</a> .
276281 *
277282 * @return true if the JAR tool supports the {@code --date} option
278283 */
You can’t perform that action at this time.
0 commit comments