trustin / os-maven-plugin

A Maven plugin that sets various useful properties detected from ${os.name} and ${os.arch} properties.
Apache License 2.0
296 stars 66 forks source link

add riscv64 support #61

Closed zinovya closed 1 year ago

zinovya commented 2 years ago

Similar to https://github.com/trustin/os-maven-plugin/issues/51 but also need to support riscv64. I've got fix for it already, will submit PR soon

advancedwebdeveloper commented 2 years ago

I got the bug appearing on

$ uname -a Linux unleashed-sid 5.0.0-rc1-56210-g0a657e0d72f0 #2 SMP Fri Jun 25 13:50:52 UTC 2021 riscv64 GNU/Linux

featuring

$ cat /proc/cpuinfo processor : 0 hart : 2 isa : rv64imafdc mmu : sv39 uarch : sifive,rocket0

processor : 1 hart : 1 isa : rv64imafdc mmu : sv39 uarch : sifive,rocket0

processor : 2 hart : 3 isa : rv64imafdc mmu : sv39 uarch : sifive,rocket0

processor : 3 hart : 4 isa : rv64imafdc mmu : sv39 uarch : sifive,rocket0

[DEBUG] Looking up lifecycle mappings for packaging jar from ClassRealm[project>org.apache.pulsar:pulsar:2.10.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]] [INFO] ------------------------------------------------------------------------ [INFO] Detecting the operating system and CPU architecture [INFO] ------------------------------------------------------------------------ [INFO] os.detected.name: linux [INFO] os.detected.arch: unknown [ERROR] unknown os.arch: riscv64 -> [Help 1] org.apache.maven.MavenExecutionException: unknown os.arch: riscv64 at kr.motd.maven.os.DetectExtension.afterProjectsRead (DetectExtension.java:92) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

CC @sxa @gdams CC @tspannhw , since that is on behalf of Apache Pulsar

advancedwebdeveloper commented 2 years ago

I am using

$ java -version openjdk version "11.0.12-ea" 2021-07-20 OpenJDK Runtime Environment (build 11.0.12-ea+4-post-Debian-1) OpenJDK 64-Bit Zero VM (build 11.0.12-ea+4-post-Debian-1, interpreted mode) $ javac -version javac 11.0.12-ea

xswfantasy commented 2 years ago

Has the problem been solved? I still have this problem:

root@df8743386e44:/# java -version openjdk version "17.0.3" 2022-04-19 OpenJDK Runtime Environment (build 17.0.3+7-Ubuntu-0ubuntu0.22.04.1) OpenJDK 64-Bit Zero VM (build 17.0.3+7-Ubuntu-0ubuntu0.22.04.1, interpreted mode)

root@df8743386e44:/zeebe-1.3.5# mvn dependency:get -B \ -DremoteRepositories="camunda-nexus::::https://app.camunda.com/nexus/content/repositories/public" \ -DgroupId="io.camunda" -DartifactId="camunda-cloud-zeebe" \ -Dos.detected.name=linux -Dos.detected.arch=riscv -Dos.detected.classifier=linux-riscv \ -Dversion="1.3.5" -Dpackaging="tar.gz" -Dtransitive=false [INFO] Scanning for projects... [INFO] Inspecting build with total of 40 modules... [INFO] Not installing Nexus Staging features: [INFO] * Preexisting staging related goal bindings found in 40 modules. [INFO] ------------------------------------------------------------------------ [INFO] Detecting the operating system and CPU architecture [INFO] ------------------------------------------------------------------------ [INFO] os.detected.name: linux [INFO] os.detected.arch: unknown [INFO] os.detected.bitness: 64 [INFO] os.detected.version: 5.15 [INFO] os.detected.version.major: 5 [INFO] os.detected.version.minor: 15 [ERROR] unknown os.arch: riscv64 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles