Date: Tue, 17 May 2022 12:27:33 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 262278] file(1) fails to identify a JAR file Message-ID: <bug-262278-227-Ce83DqUkrR@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-262278-227@https.bugs.freebsd.org/bugzilla/> References: <bug-262278-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262278 Michael Osipov <michael.osipov@siemens.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michael.osipov@siemens.com --- Comment #3 from Michael Osipov <michael.osipov@siemens.com> --- The 0xcafebabe applies to classes, not to JAR files. Unwritten law how to detect a JAR: Either the first or the second ZIP entry must be the manifest file: > META-INF/ > META-INF/MANIFEST.NF or just > META-INF/MANIFEST.NF Maven produces fully reproducible JARs that those two entries come first: > $ unzip -t maven-core-4.0.0-alpha-1-SNAPSHOT.jar | head > Archive: maven-core-4.0.0-alpha-1-SNAPSHOT.jar > testing: META-INF/ OK > testing: META-INF/MANIFEST.MF OK > testing: META-INF/maven/ OK > testing: META-INF/sisu/ OK > testing: org/ OK > testing: org/apache/ OK Don't expect a JAR to contain a class file. It could solely contain resourc= es, still being a JAR file due to the manifest and the first entry of the manif= est is fixed to "Manifest-Version: 1.0". This is by spec and guaranteed to be written by Maven libraries. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-262278-227-Ce83DqUkrR>