Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-13079

Make OpenNMS compile on Apple Silicon



    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • 27.0.0, 27.0.3
    • 27.1.0
    • None
    • Security Level: Default (Default Security Scheme)
    • Horizon 2020 - Jan 6 - Jan 20


      I received a MacBook Air M1 yesterday and of course I was pretty curious if it is possible to compile OpenNMS on it. I installed all my common development stuff on it, compiled and installed jicmp and jicmp6 and installed an OpenJDK 8 build for M1. This is what I used so far:

      • IntelliJ IDEA -> native M1 binaries available
      • JDK -> native M1 builds available (Azul Zulu Builds of OpenJDK)
      • Homebrew -> seems to work fine
      • jicmp -> compiles and installs
      • jicmp6 -> compiles and installs
      • Postgres -> works fine using Rosetta 2

      When I now compile OpenNMS, all seems to work fine but unfortunately the build fails with the package org.opennms.core.web-assets:

      [INFO] --- frontend-maven-plugin:1.9.0:install-node-and-npm (install node) @ org.opennms.core.web-assets ---
      [INFO] Installing node version v10.19.0
      [INFO] Downloading https://nodejs.org/dist/v10.19.0/node-v10.19.0-darwin-arm64.tar.gz to /Users/chris/.m2/repository/com/github/eirslett/node/10.19.0/node-10.19.0-darwin-arm64.tar.gz
      [INFO] No proxies configured
      [INFO] No proxy was configured, downloading directly
      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Summary:
      [INFO] OpenNMS :: Checkstyle 28.0.0-SNAPSHOT .............. SUCCESS [  0.317 s]
      [INFO] OpenNMS 28.0.0-SNAPSHOT ............................ SUCCESS [ 13.474 s]
      [INFO] OpenNMS :: Dependencies 28.0.0-SNAPSHOT ............ SUCCESS [  0.052 s]
      [INFO] OpenNMS :: Dependencies :: Hibernate 28.0.0-SNAPSHOT SUCCESS [  0.044 s]
      [INFO] OpenNMS :: Dependencies :: Spring 28.0.0-SNAPSHOT .. SUCCESS [  0.092 s]
      [INFO] OpenNMS :: Dependencies :: ActiveMQ 28.0.0-SNAPSHOT  SUCCESS [  0.203 s]
      [INFO] OpenNMS :: Features :: Topology POMs compiled - bundle instructions 28.0.0-SNAPSHOT SUCCESS [  0.289 s]
      [INFO] org.opennms.osgi.core 28.0.0-SNAPSHOT .............. SUCCESS [  0.297 s]
      [INFO] OpenNMS Web UI Assets (JavaScript & CSS) 28.0.0-SNAPSHOT FAILURE [  0.563 s]
      [INFO] OpenNMS :: Features :: Vaadin :: Themes 28.0.0-SNAPSHOT SKIPPED
      [INFO] org.opennms.config-dao.poll-outages.itests 28.0.0-SNAPSHOT SKIPPED
      [INFO] ------------------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  01:35 min
      [INFO] Finished at: 2021-01-08T11:50:54+01:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.9.0:install-node-and-npm (install node) on project org.opennms.core.web-assets: Could not download Node.js: Got error code 404 from the server. -> [Help 1]
      [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] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
      [ERROR] After correcting the problems, you can resume the build with the command
      [ERROR]   mvn <goals> -rf :org.opennms.core.web-assets
      [ERROR] child exited with value 1

      The problem is, that the plugin uses the darwin-arm64 architecture for the download which does not exist yet. This is already reported to the plugin developer and it is fixed in v1.11.0. So, I changed the version in the root pom.xml and finally OpenNMS compiles and also runs fine.




            cpape Christian Pape
            cpape Christian Pape
            0 Vote for this issue
            1 Start watching this issue