Uploaded image for project: 'Apache NetBeans Infra'
  1. Apache NetBeans Infra
  2. NETBEANSINFRA-6

nbm:build-installers fails with JDK 11

    XMLWordPrintableJSON

Details

    Description

      Issue

      nbm-maven-plugin fails with nbm:build-installers when running with JDK 11.  Running build-installers from an Ant-based platform application works when built from Netbeans 11.2. Default platform application projects for Ant and Maven were used for testing (see STR below). For Ant-version, I used the default application generated from "Java with Ant" -> "Netbeans Modules" -> "Netbeans Platform Application" then used the right-click menu option to build the installers without error.

      Steps to Reproduce

      1. Using JDK 11 and Netbeans 11.2, create a new Project. Choose "Java with Maven", then "Netbeans Application".  Go through wizard using default settings.
      2. Build the project.
      3. From commandline, cd into application folder of project. Execute "mvn nbm:build-installers".

       

      Error Results

      When running nbm:build-installers, I get:

       

      [INFO] Created dir: /Users/syyigmmbp/NetBeansProjects/mavenproject4/application/target/installerbuild/nbi_all/ext/infr$
      {{/build/engine/build/ext/engine/build/empty }}
      [INFO] Compiling 6 source files to /Users/syyigmmbp/NetBeansProjects/mavenproject4/application/target/installerbuild/n$
      {{i_all/ext/infra/build/engine/build/ext/engine/build/classes }}
      {{error: Source option 5 is no longer supported. Use 6 or later. }}
      {{error: Target option 1.5 is no longer supported. Use 1.6 or later. }}
      {{[INFO] ------------------------------------------------------------------------ }}
      {{[INFO] BUILD FAILURE }}
      {{[INFO] ------------------------------------------------------------------------ }}
      {{[INFO] Total time: 1.982 s }}
      {{[INFO] Finished at: 2019-11-03T09:51:17-05:00 }}
      {{[INFO] ------------------------------------------------------------------------ }}
      [ERROR] Failed to execute goal org.apache.netbeans.utilities:nbm-maven-plugin:4.3:build-installers (default-cli) on pr$
      ject mavenproject4-app: Installers creation failed: /Users/syyigmmbp/NetBeansProjects/mavenproject4/application/target$
      {{installer/nbi/stub/template.xml:66: The following error occurred while executing this line: }}
      {{[ERROR] /Users/syyigmmbp/NetBeansProjects/mavenproject4/application/target/installerbuild/build.xml:121: The following }}
      {{error occurred while executing this line: }}
      [ERROR] /Users/syyigmmbp/NetBeansProjects/mavenproject4/application/target/installerbuild/nbi_all/.common/common.xml:5$
      8: The following error occurred while executing this line:
      [ERROR] /Users/syyigmmbp/NetBeansProjects/mavenproject4/application/target/installerbuild/nbi_all/.common/common.xml:7$
      7: The following error occurred while executing this line:
      [ERROR] /Users/syyigmmbp/NetBeansProjects/mavenproject4/application/target/installerbuild/nbi_all/ext/infra/build/engi$
      e/build/ext/engine/nbproject/build-impl.xml:922: The following error occurred while executing this line:
      [ERROR] /Users/syyigmmbp/NetBeansProjects/mavenproject4/application/target/installerbuild/nbi_all/ext/infra/build/engi$
      e/build/ext/engine/nbproject/build-impl.xml:295: Compile failed; see the compiler error output for details.

       

      Diagnosis

      From what I understand, the issue is that nbm-maven-plugin depends upon org.apache.netbeans.utilities:nbm-maven-harness:11.1 which uses a harness from Netbeans 8.2. If I open up the jar and grep for 1.5, I see:

       

      syyigmmbps-MacBook-Pro:harness syyigmmbp$ grep 1.5 * -n -r
      Binary file etc/applicationIcon.icns matches
      Binary file launchers/app64.exe matches
      Binary file launchers/app.exe matches
      Binary file modules/ext/nbi-engine.jar matches
      nbi/stub/tmpl.properties:29:generator-jdk-location-forward-slashes=C:/Program Files/Java/jdk1.5.0_16
      nbi/stub/ext/components/products/helloworld/nbproject/project.properties:45:javac.source=1.5
      nbi/stub/ext/components/products/helloworld/nbproject/project.properties:46:javac.target=1.5
      nbi/stub/ext/components/products/helloworld/nbproject/genfiles.properties:8:nbproject/build-impl.xml.stylesheet.CRC32=f
      cddb364@1.50.1.46
      nbi/stub/ext/engine/nbproject/project.properties:46:javac.source=1.5
      nbi/stub/ext/engine/nbproject/project.properties:47:javac.target=1.5
      nbi/.common/common.properties:90:# * ${nb.platform.home} - location of the jdk codenamed "JDK 1.5", this jdk
      nbi/.common/common.properties:103:nb.platform.home=-Dplatforms.JDK_1.5.home=${java.home}/..
      nbi/.common/common.properties:104:nb.platform.home.macos=-Dplatforms.JDK_1.5.home=${java.home}
      nbi/.common/common.xml:710: <property name="platforms.JDK_1.5.home" value="${nb.jdk.home.value}" />

      In Netbeans 11.2, the harness that comes with it has an nbi stub project.properties that usees javac.source and javac.target = 1.8. I think the solution is to create an updated nbm-maven-harness, update nbm-maven-plugin to depend on that, then publish a new nbm-maven-plugin.

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            kunstmusik Steven Yi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 4h 10m
                4h 10m