Page MenuHomeSoftware Heritage

Consider using jar command to extract jar archives
Closed, MigratedEdits Locked

Description

Currently, the maven loader uses the following command to extract a jar file: unzip -q -d <dest_dir> <jar_file>.
However based on sentry reports from our staging infrastructure, there is numerous cases where that command fails to extract archives.
Using the jar command instead seems to work better, see examples below.

(swh) anlambert@carnavalet:/tmp/jar_test$ wget https://repo1.maven.org/maven2/org/pustefixframework/pustefix-archetype-basic/0.15.20/pustefix-archetype-basic-0.15.20-sources.jar
--2022-06-09 13:33:16--  https://repo1.maven.org/maven2/org/pustefixframework/pustefix-archetype-basic/0.15.20/pustefix-archetype-basic-0.15.20-sources.jar
Resolving repo1.maven.org (repo1.maven.org)... 151.101.120.209
Connecting to repo1.maven.org (repo1.maven.org)|151.101.120.209|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 45637 (45K) [application/java-archive]
Saving to: ‘pustefix-archetype-basic-0.15.20-sources.jar’

pustefix-archetype-basic-0.15.20-sources.jar                           100%[=========================================================================================================================================================================>]  44,57K  --.-KB/s    in 0,005s  

2022-06-09 13:33:16 (9,03 MB/s) - ‘pustefix-archetype-basic-0.15.20-sources.jar’ saved [45637/45637]

(swh) anlambert@carnavalet:/tmp/jar_test$ unzip -q -d . pustefix-archetype-basic-0.15.20-sources.jar 
warning:  stripped absolute path spec from /
mapname:  conversion of  failed
warning:  stripped absolute path spec from /home/
warning:  stripped absolute path spec from /home/mhm/
warning:  stripped absolute path spec from /home/mhm/Projects/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/site/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/txt/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/txt/pages/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/WEB-INF/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/xml/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/dyntxt/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/css/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/xsl/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/img/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/modules-override/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/modules-override/pustefix-core/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/modules-override/pustefix-core/dyntxt/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/java/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/java/state/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/java/handler/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/java/wrapper/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/java/context/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/META-INF/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/META-INF/maven/
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/pom.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/.project
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/site/site.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/txt/pages/Home.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/txt/pages/Bye.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/WEB-INF/spring.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/WEB-INF/depend.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/WEB-INF/app.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/WEB-INF/project.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/WEB-INF/web.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/WEB-INF/pfixlog.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/xml/frame.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/dyntxt/statusmessages.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/dyntxt/statuscodeinfo.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/css/style.css
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/xsl/metatags.xsl
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/xsl/skin.xsl
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/img/logo.png
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/webapp/modules-override/pustefix-core/dyntxt/statusmessages-core-merged.xml
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/java/state/ByeState.java
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/java/handler/RegistrationHandler.java
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/java/wrapper/Registration.iwrp
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/archetype-resources/src/main/java/context/User.java
warning:  stripped absolute path spec from /home/mhm/Projects/pustefix/framework/target/checkout/pustefix-archetypes/pustefix-archetype-basic/target/classes/META-INF/maven/archetype-metadata.xml
(swh) anlambert@carnavalet:/tmp/jar_test$ echo $?
2
(swh) anlambert@carnavalet:/tmp/jar_test$ ls
home  META-INF  pustefix-archetype-basic-0.15.20-sources.jar
(swh) anlambert@carnavalet:/tmp/jar_test$ rm -rf home/ META-INF/
(swh) anlambert@carnavalet:/tmp/jar_test$ jar -xf pustefix-archetype-basic-0.15.20-sources.jar 
(swh) anlambert@carnavalet:/tmp/jar_test$ echo $?
0
(swh) anlambert@carnavalet:/tmp/jar_test$ ls
home  META-INF  pustefix-archetype-basic-0.15.20-sources.jar
(swh) anlambert@carnavalet:/tmp/jar_test$ wget https://repo1.maven.org/maven2/org/webjars/bower/pako/1.0.3/pako-1.0.3-sources.jar
--2022-06-09 13:39:25--  https://repo1.maven.org/maven2/org/webjars/bower/pako/1.0.3/pako-1.0.3-sources.jar
Resolving repo1.maven.org (repo1.maven.org)... 151.101.120.209
Connecting to repo1.maven.org (repo1.maven.org)|151.101.120.209|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 22 [application/java-archive]
Saving to: ‘pako-1.0.3-sources.jar’

pako-1.0.3-sources.jar                                                 100%[=========================================================================================================================================================================>]      22  --.-KB/s    in 0s      

2022-06-09 13:39:26 (839 KB/s) - ‘pako-1.0.3-sources.jar’ saved [22/22]

(swh) anlambert@carnavalet:/tmp/jar_test$ unzip -q -d . pako-1.0.3-sources.jar 
warning [pako-1.0.3-sources.jar]:  zipfile is empty
(swh) anlambert@carnavalet:/tmp/jar_test$ echo $?
1
(swh) anlambert@carnavalet:/tmp/jar_test$ jar -xf pako-1.0.3-sources.jar 
(swh) anlambert@carnavalet:/tmp/jar_test$ echo $?
0
(swh) anlambert@carnavalet:/tmp/jar_test$ wget https://repo1.maven.org/maven2/com/github/langlan/langlan-sql-weaver/1.0/langlan-sql-weaver-1.0-sources.jar
--2022-06-09 13:41:13--  https://repo1.maven.org/maven2/com/github/langlan/langlan-sql-weaver/1.0/langlan-sql-weaver-1.0-sources.jar
Resolving repo1.maven.org (repo1.maven.org)... 151.101.120.209
Connecting to repo1.maven.org (repo1.maven.org)|151.101.120.209|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27586 (27K) [application/java-archive]
Saving to: ‘langlan-sql-weaver-1.0-sources.jar’

langlan-sql-weaver-1.0-sources.jar                                     100%[=========================================================================================================================================================================>]  26,94K  --.-KB/s    in 0,002s  

2022-06-09 13:41:13 (12,3 MB/s) - ‘langlan-sql-weaver-1.0-sources.jar’ saved [27586/27586]

(swh) anlambert@carnavalet:/tmp/jar_test$ unzip -q -d . langlan-sql-weaver-1.0-sources.jar 
(swh) anlambert@carnavalet:/tmp/jar_test$ ls langlan
ls: cannot open directory 'langlan': Permission denied
(swh) anlambert@carnavalet:/tmp/jar_test$ sudo rm -rf langlan META-INF/
(swh) anlambert@carnavalet:/tmp/jar_test$ jar -xf langlan-sql-weaver-1.0-sources.jar 
(swh) anlambert@carnavalet:/tmp/jar_test$ echo $?
0
(swh) anlambert@carnavalet:/tmp/jar_test$ ls langlan
sql

I think we should use the jar command when available in the runtime environment to extract jar files and fallback on using unzip otherwise.
This would require installing the openjdk-11-jdk-headless debian package on workers though.

(swh) anlambert@carnavalet:/tmp/jar_test$ sudo dpkg -L openjdk-11-jdk-headless
/.
/usr
/usr/lib
/usr/lib/jvm
/usr/lib/jvm/java-11-openjdk-amd64
/usr/lib/jvm/java-11-openjdk-amd64/bin
/usr/lib/jvm/java-11-openjdk-amd64/bin/jaotc
/usr/lib/jvm/java-11-openjdk-amd64/bin/jar
/usr/lib/jvm/java-11-openjdk-amd64/bin/jarsigner
/usr/lib/jvm/java-11-openjdk-amd64/bin/javac
/usr/lib/jvm/java-11-openjdk-amd64/bin/javadoc
/usr/lib/jvm/java-11-openjdk-amd64/bin/javap
/usr/lib/jvm/java-11-openjdk-amd64/bin/jcmd
/usr/lib/jvm/java-11-openjdk-amd64/bin/jdb
/usr/lib/jvm/java-11-openjdk-amd64/bin/jdeprscan
/usr/lib/jvm/java-11-openjdk-amd64/bin/jdeps
/usr/lib/jvm/java-11-openjdk-amd64/bin/jfr
/usr/lib/jvm/java-11-openjdk-amd64/bin/jhsdb
/usr/lib/jvm/java-11-openjdk-amd64/bin/jimage
/usr/lib/jvm/java-11-openjdk-amd64/bin/jinfo
/usr/lib/jvm/java-11-openjdk-amd64/bin/jlink
/usr/lib/jvm/java-11-openjdk-amd64/bin/jmap
/usr/lib/jvm/java-11-openjdk-amd64/bin/jmod
/usr/lib/jvm/java-11-openjdk-amd64/bin/jps
/usr/lib/jvm/java-11-openjdk-amd64/bin/jrunscript
/usr/lib/jvm/java-11-openjdk-amd64/bin/jshell
/usr/lib/jvm/java-11-openjdk-amd64/bin/jstack
/usr/lib/jvm/java-11-openjdk-amd64/bin/jstat
/usr/lib/jvm/java-11-openjdk-amd64/bin/jstatd
/usr/lib/jvm/java-11-openjdk-amd64/bin/rmic
/usr/lib/jvm/java-11-openjdk-amd64/bin/serialver
/usr/lib/jvm/java-11-openjdk-amd64/include
/usr/lib/jvm/java-11-openjdk-amd64/include/classfile_constants.h
/usr/lib/jvm/java-11-openjdk-amd64/include/jdwpTransport.h
/usr/lib/jvm/java-11-openjdk-amd64/include/jni.h
/usr/lib/jvm/java-11-openjdk-amd64/include/jvmti.h
/usr/lib/jvm/java-11-openjdk-amd64/include/jvmticmlr.h
/usr/lib/jvm/java-11-openjdk-amd64/include/linux
/usr/lib/jvm/java-11-openjdk-amd64/include/linux/jni_md.h
/usr/lib/jvm/java-11-openjdk-amd64/jmods
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.base.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.compiler.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.datatransfer.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.desktop.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.instrument.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.logging.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.management.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.management.rmi.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.naming.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.net.http.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.prefs.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.rmi.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.scripting.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.se.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.security.jgss.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.security.sasl.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.smartcardio.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.sql.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.sql.rowset.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.transaction.xa.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.xml.crypto.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/java.xml.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.accessibility.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.aot.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.attach.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.charsets.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.compiler.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.crypto.cryptoki.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.crypto.ec.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.dynalink.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.editpad.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.hotspot.agent.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.httpserver.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.internal.ed.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.internal.jvmstat.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.internal.le.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.internal.opt.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.internal.vm.ci.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.internal.vm.compiler.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.internal.vm.compiler.management.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.jartool.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.javadoc.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.jcmd.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.jconsole.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.jdeps.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.jdi.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.jdwp.agent.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.jfr.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.jlink.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.jshell.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.jsobject.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.jstatd.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.localedata.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.management.agent.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.management.jfr.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.management.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.naming.dns.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.naming.ldap.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.naming.rmi.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.net.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.pack.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.rmic.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.scripting.nashorn.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.scripting.nashorn.shell.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.sctp.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.security.auth.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.security.jgss.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.unsupported.desktop.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.unsupported.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.xml.dom.jmod
/usr/lib/jvm/java-11-openjdk-amd64/jmods/jdk.zipfs.jmod
/usr/lib/jvm/java-11-openjdk-amd64/lib
/usr/lib/jvm/java-11-openjdk-amd64/man
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/jar.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/jarsigner.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/javac.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/javadoc.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/javap.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/jcmd.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/jdb.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/jdeps.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/jinfo.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/jmap.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/jps.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/jrunscript.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/jstack.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/jstat.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/jstatd.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/rmic.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/ja_JP.UTF-8/man1/serialver.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/jar.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/jarsigner.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/javac.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/javadoc.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/javap.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/jcmd.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/jdb.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/jdeps.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/jinfo.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/jmap.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/jps.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/jrunscript.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/jstack.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/jstat.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/jstatd.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/rmic.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/man/man1/serialver.1.gz
/usr/share
/usr/share/doc
/usr/lib/jvm/java-11-openjdk-amd64/lib/src.zip
/usr/share/doc/openjdk-11-jdk-headless

Event Timeline

anlambert triaged this task as Normal priority.Jun 9 2022, 1:50 PM
anlambert created this task.

Alternatively, we could use the zipfile standard Python module which seems to work in a similar way as the jar command, see below:

(swh) anlambert@carnavalet:/tmp/jar_test$ wget https://repo1.maven.org/maven2/org/pustefixframework/pustefix-archetype-basic/0.15.20/pustefix-archetype-basic-0.15.20-sources.jar
--2022-06-09 14:56:17--  https://repo1.maven.org/maven2/org/pustefixframework/pustefix-archetype-basic/0.15.20/pustefix-archetype-basic-0.15.20-sources.jar
Resolving repo1.maven.org (repo1.maven.org)... 151.101.120.209
Connecting to repo1.maven.org (repo1.maven.org)|151.101.120.209|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 45637 (45K) [application/java-archive]
Saving to: ‘pustefix-archetype-basic-0.15.20-sources.jar’

pustefix-archetype-basic-0.15.20-sources.jar                           100%[=========================================================================================================================================================================>]  44,57K  --.-KB/s    in 0,005s  

2022-06-09 14:56:17 (8,81 MB/s) - ‘pustefix-archetype-basic-0.15.20-sources.jar’ saved [45637/45637]

(swh) anlambert@carnavalet:/tmp/jar_test$ ls
hello.jar  pustefix-archetype-basic-0.15.20-sources.jar
(swh) anlambert@carnavalet:/tmp/jar_test$ python -mzipfile -e pustefix-archetype-basic-0.15.20-sources.jar .
(swh) anlambert@carnavalet:/tmp/jar_test$ echo $?
0
(swh) anlambert@carnavalet:/tmp/jar_test$ ls
hello.jar  home  META-INF  pustefix-archetype-basic-0.15.20-sources.jar
(swh) anlambert@carnavalet:/tmp/jar_test$ rm -rf home/ META-INF/
(swh) anlambert@carnavalet:/tmp/jar_test$ wget https://repo1.maven.org/maven2/org/webjars/bower/pako/1.0.3/pako-1.0.3-sources.jar
--2022-06-09 14:57:35--  https://repo1.maven.org/maven2/org/webjars/bower/pako/1.0.3/pako-1.0.3-sources.jar
Resolving repo1.maven.org (repo1.maven.org)... 151.101.120.209
Connecting to repo1.maven.org (repo1.maven.org)|151.101.120.209|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 22 [application/java-archive]
Saving to: ‘pako-1.0.3-sources.jar’

pako-1.0.3-sources.jar                                                 100%[=========================================================================================================================================================================>]      22  --.-KB/s    in 0s      

2022-06-09 14:57:35 (3,58 MB/s) - ‘pako-1.0.3-sources.jar’ saved [22/22]

(swh) anlambert@carnavalet:/tmp/jar_test$ python -mzipfile -e pako-1.0.3-sources.jar .
(swh) anlambert@carnavalet:/tmp/jar_test$ echo $?
0
(swh) anlambert@carnavalet:/tmp/jar_test$ ls
hello.jar  pako-1.0.3-sources.jar  pustefix-archetype-basic-0.15.20-sources.jar
(swh) anlambert@carnavalet:/tmp/jar_test$ wget https://repo1.maven.org/maven2/com/github/langlan/langlan-sql-weaver/1.0/langlan-sql-weaver-1.0-sources.jar
--2022-06-09 14:58:18--  https://repo1.maven.org/maven2/com/github/langlan/langlan-sql-weaver/1.0/langlan-sql-weaver-1.0-sources.jar
Resolving repo1.maven.org (repo1.maven.org)... 151.101.120.209
Connecting to repo1.maven.org (repo1.maven.org)|151.101.120.209|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27586 (27K) [application/java-archive]
Saving to: ‘langlan-sql-weaver-1.0-sources.jar’

langlan-sql-weaver-1.0-sources.jar                                     100%[=========================================================================================================================================================================>]  26,94K  --.-KB/s    in 0,002s  

2022-06-09 14:58:18 (12,6 MB/s) - ‘langlan-sql-weaver-1.0-sources.jar’ saved [27586/27586]

(swh) anlambert@carnavalet:/tmp/jar_test$ python -mzipfile -e langlan-sql-weaver-1.0-sources.jar .
(swh) anlambert@carnavalet:/tmp/jar_test$ echo $?
0
(swh) anlambert@carnavalet:/tmp/jar_test$ ls langlan
sql

This is better as we will not have to install any new runtime dependencies in workers.

This is better as we will not have to install any new runtime dependencies in workers.

even better!

anlambert claimed this task.