Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8096559

Ant task <fx:deploy> creates shortcut element incorrectly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 7u9, 7u10, 7u13
    • Fix Version/s: 9
    • Component/s: deploy
    • Labels:

      Description

      I have a JavaFX application being deployed via webstart. I'm using the javafx ant tasks from maven to generate the JNLP file. I've specified that the desktop shortcut hint should be created in the JNLP file. This occurs successfully, but the shortcut is not created/user is not asked. The resulting JNLP file has a the shortcut element in it (<shortcut><desktop/></shortcut>), but it appears to be in the incorrect place. I've tried this with both using Java7 update 9 and 10 and the JavaFX SDK and Ant tasks that come with them.

      According to the JNLP documentation the desktop element is supposed to be a child of the <information> element: http://docs.oracle.com/javase/7/docs/technotes/guides/javaws/developersguide/syntax.html#information

      According to the JavaFX Ant task documentation the <fx:preferences shortcut="true" /> element is not a child of the <fx:info> element: http://docs.oracle.com/javafx/2/deployment/javafx_ant_task_reference002.htm#CIAIEJHG

      Is there some other way to get the <shortcut> element to be placed in the correct location while still using the Ant tasks?

      Thanks


      In the meantime, I'm moving the element to the appropriate location using some Groovy:

      {noformat}
      String jnlpFileName = "$pom.build.directory/web-dist/clarity-client-javafx.jnlp"
      def jnlp = new XmlParser().parse( new File( jnlpFileName ) )
      def shortcut = jnlp.shortcut[0]
      if ( shortcut )
      {
      // move the shortcut element to the appropriate location
      jnlp.remove( shortcut )
      jnlp.information[0].append( shortcut )

      new File( jnlpFileName ).withWriter { out ->
      printer = new XmlNodePrinter( new PrintWriter( out ) )
      printer.preserveWhitespace = true
      printer.print( jnlp )
      }
      }
      {noformat}

        Attachments

          Activity

            People

            • Assignee:
              dcherepanov Dmitry Cherepanov
              Reporter:
              zheismannjfx Zac Heismann (Inactive)
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: