You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by HRH <hr...@yahoo.com.INVALID> on 2020/09/03 18:04:42 UTC

Maven deployment plugin for JavaFX

Hi,
Does anyone know, if Maven has a plugin deployment for JavaFX application that will render a self-contained installable package for a given (or all) platform(s) (i.e. Windows - 64 bit, Linux or Mac OS)? I rather use a plugin and have the IDE do most of the work than using the Java Jpackage tool and do all the work myself.

Thanks

Re: Maven deployment plugin for JavaFX

Posted by Ernie Rael <er...@raelity.com>.
On 9/6/2020 4:53 AM, HRH wrote:
> **
> Is jlink of any use here? The projects created with "NewProject >
> SimpleJavaFX > ..." have a jlink action
> **
> Hi Ernie,
>
> I noticed the "NewProject> FXML JavaFX...>", also have jlink action 
> defined in the nbactions.xml as follow:

The items found in nbactions.xml are not generally used as part of the 
build. They are associated with IDE action, like the run/debug buttons; 
or speicific actions not part of the maven phases. Tye 
ProjectWin>ProjNode>RunMaven And you can also take a look at 
ProjectWin>ProjNode>Properties>Actions; the stuff in bold under actions 
is usually from the nbactions.xml.

Anyway, for jlink

 1. edit pom.xml and add the property, using your main class name
    <javafx.mainClass>org.mystuff.App</javafx.mainClass>
 2. ProjWin>MyProj>RunMaven>jlink
 3. cd <projdir>/target/image/bin
 4. ./java org.mystuff.App

This should run your app. You can take a look at the docs for the 
javafx-maven-plugin for more info.

-ernie

>
> <action>
> <actionName>CUSTOM-jlink</actionName>
>             <displayName>jlink</displayName>
>             <goals>
>                 <goal>clean</goal>
>                 <!-- compile not needed with javafx-maven-plugin 
> v0.0.5 -->
>                 <goal>compile</goal>
>                 <goal>javafx:jlink</goal>
>             </goals>
>  </action>
>
>
> In addition, it has jar packaging clause:
>
>
> <action>
>             <actionName>run</actionName>
>             <packagings>
> <packaging>jar</packaging>
>             </packagings>
>             <goals>
>                 <goal>clean</goal>
>                 <goal>javafx:run</goal>
>             </goals>
>         </action>
>
> However, I am not sure, if these goals and actions are actually being 
> processed during the build since I don't see any jar file under 
> target/classes tree structure. Any idea?
>
> Thanks
>
>
>
>
> On Friday, September 4, 2020, 8:08:24 PM GMT+4:30, HRH 
> <hr...@yahoo.com.invalid> wrote:
>
>
> Thanks, Ernie, I recall someone on Stackoverflow had mentioned it 
> while back. I will look into it.
>
> On Friday, September 4, 2020, 7:45:30 PM GMT+4:30, Ernie Rael 
> <er...@raelity.com> wrote:
>
>
> On 9/3/2020 11:04 AM, HRH wrote:
> > Hi,
> >
> > Does anyone know, if Maven has a plugin deployment for JavaFX
> > application that will render a self-contained installable package
>
> Is jlink of any use here? The projects created with "NewProject >
> SimpleJavaFX > ..." have a jlink action.
>
> -ernie
>
>
> > for a given (or all) platform(s) (i.e. Windows - 64 bit, Linux or Mac
> > OS)? I rather use a plugin and have the IDE do most of the work than
> > using the Java Jpackage tool and do all the work myself.
> >
> > Thanks
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org 
> <ma...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org 
> <ma...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Maven deployment plugin for JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 **  Is jlink of any use here? The projects created with "NewProject > 
SimpleJavaFX > ..." have a jlink action**Hi Ernie,
I noticed the "NewProject> FXML JavaFX...>", also have jlink action defined in the nbactions.xml as follow:
<action>
            <actionName>CUSTOM-jlink</actionName>
            <displayName>jlink</displayName>
            <goals>
                <goal>clean</goal>
                <!-- compile not needed with javafx-maven-plugin v0.0.5 -->
                <goal>compile</goal>
                <goal>javafx:jlink</goal>
            </goals>
 </action>

In addition, it has jar packaging clause:

<action>
            <actionName>run</actionName>
            <packagings>
                <packaging>jar</packaging>
            </packagings>
            <goals>
                <goal>clean</goal>
                <goal>javafx:run</goal>
            </goals>
        </action>
However, I am not sure, if these goals and actions are actually being processed during the build since I don't see any jar file under target/classes tree structure. Any idea?
Thanks




    On Friday, September 4, 2020, 8:08:24 PM GMT+4:30, HRH <hr...@yahoo.com.invalid> wrote:  
 
  Thanks, Ernie, I recall someone on Stackoverflow had mentioned it while back. I will look into it.

    On Friday, September 4, 2020, 7:45:30 PM GMT+4:30, Ernie Rael <er...@raelity.com> wrote:  
 
 On 9/3/2020 11:04 AM, HRH wrote:
> Hi,
>
> Does anyone know, if Maven has a plugin deployment for JavaFX 
> application that will render a self-contained installable package

Is jlink of any use here? The projects created with "NewProject > 
SimpleJavaFX > ..." have a jlink action.

-ernie

> for a given (or all) platform(s) (i.e. Windows - 64 bit, Linux or Mac 
> OS)? I rather use a plugin and have the IDE do most of the work than 
> using the Java Jpackage tool and do all the work myself.
>
> Thanks



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

    

Re: Maven deployment plugin for JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
 Thanks, Ernie, I recall someone on Stackoverflow had mentioned it while back. I will look into it.

    On Friday, September 4, 2020, 7:45:30 PM GMT+4:30, Ernie Rael <er...@raelity.com> wrote:  
 
 On 9/3/2020 11:04 AM, HRH wrote:
> Hi,
>
> Does anyone know, if Maven has a plugin deployment for JavaFX 
> application that will render a self-contained installable package

Is jlink of any use here? The projects created with "NewProject > 
SimpleJavaFX > ..." have a jlink action.

-ernie

> for a given (or all) platform(s) (i.e. Windows - 64 bit, Linux or Mac 
> OS)? I rather use a plugin and have the IDE do most of the work than 
> using the Java Jpackage tool and do all the work myself.
>
> Thanks



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

  

Re: Maven deployment plugin for JavaFX

Posted by Ernie Rael <er...@raelity.com>.
On 9/3/2020 11:04 AM, HRH wrote:
> Hi,
>
> Does anyone know, if Maven has a plugin deployment for JavaFX 
> application that will render a self-contained installable package

Is jlink of any use here? The projects created with "NewProject > 
SimpleJavaFX > ..." have a jlink action.

-ernie

> for a given (or all) platform(s) (i.e. Windows - 64 bit, Linux or Mac 
> OS)? I rather use a plugin and have the IDE do most of the work than 
> using the Java Jpackage tool and do all the work myself.
>
> Thanks



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Maven deployment plugin for JavaFX

Posted by Bradley Willcott <op...@gmail.com>.
Hi David,

Hope this helps with the packaging. I have cut this out of one of my 
projects:

<build>
	<plugins>
		<plugin>
		   <groupId>org.codehaus.mojo</groupId>
		   <artifactId>exec-maven-plugin</artifactId>
		   <version>1.6.0</version>
		   <executions>
     		   <execution>
         		   <id>Zip Binary Jar and libs</id>
         		   <phase>package</phase>
         		   <goals>
             		   <goal>exec</goal>
         		   </goals>
         		   <configuration>
             		   <executable>zip</executable>
             		   <workingDirectory>${project.build.directory}</workingDirectory>
             		   <includeProjectDependencies>false</includeProjectDependencies>
             		   <includePluginDependencies>true</includePluginDependencies>
             		   <arguments>
                 		   <argument>-r</argument>
                 		   <argument>${project.build.finalName}.zip</argument>
                 		   <argument>${project.build.finalName}.jar</argument>
                 		   <argument>libs</argument>
             		   </arguments>
         		   </configuration>
     		   </execution>
		   </executions>
		</plugin>
		<plugin>
     		<groupId>org.apache.maven.plugins</groupId>
     		<artifactId>maven-jar-plugin</artifactId>
     		<version>3.2.0</version>
     		<configuration>
         		<archive>
             		<manifest>
                 		<addClasspath>true</addClasspath>
                 		<classpathPrefix>libs/</classpathPrefix>
                 		<mainClass>org.myapp.Main</mainClass>
                 		<addBuildEnvironmentEntries>true</addBuildEnvironmentEntries>
                 		<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
             		</manifest>
         		</archive>
     		</configuration>
		</plugin>
		<plugin>
     		<groupId>org.apache.maven.plugins</groupId>
     		<artifactId>maven-dependency-plugin</artifactId>
     		<version>3.1.1</version>
     		<executions>
         		<execution>
             		<id>copy-dependencies</id>
             		<phase>prepare-package</phase>
             		<goals>
                 		<goal>copy-dependencies</goal>
             		</goals>
             		<configuration>
                 		<includeScope>runtime</includeScope>
                 		<excludeScope>test</excludeScope>
                 		<outputDirectory>
                     		${project.build.directory}/libs
                 		</outputDirectory>
             		</configuration>
         		</execution>
     		</executions>
		</plugin>
	</plugins>
</build>

The /maven-dependency-plugin/ is used to copy all the dependencies into
the 'libs' directory.

The /maven-jar-plugin/ is used to add the classpathPrefix: 'libs/' to
the manifest.  The forward slash at the end is required.

The /exec-maven-plugin/ is used to package everything into a 'zip'
archive for release.  Just unpack this zip file on the target system,
and set the CLASSPATH to include the jar file, and all should work.
I have as yet only tested this on my local system.

Cheers,
Brad.

On 4/9/20 9:21 pm, David Gradwell wrote:
>
> Chris,
>
> Hopefully some of the following will help.  We too did not want to use 
> XCode (much!).  You have to install it and use certain upload/notarise 
> tools, but that works.
>
> So, my steps list is:
>
> 1.            Set up an Apple developer ID, pay fee etc.  using an 
> email – we use a@b.c <ma...@b.c> in the following.
>
> 2.            Create and download a DeveloperID signing cert  to your 
> development Mac's  login keychain from 
> https://developer.apple.com/account/resources/certificates/list
>
> 3.            Create and download a Developer ID profile to System 
> Preferences/Profiles.
>
> 4.            Build your project with Ant since Ant puts all the 
> library files in a folder called lib in dist.  If Maven is your 
> primary environment, just build the top level of the project with 
> Ant.  If you know how to make Maven put all the dependencies in one 
> place ready for jpackage please tell me !
>
> 5.            Local test the Ant project and if it behaves proceed.
>
> 6.            Make a Mac icon.
>
> 7.            Using the pre-release Java 15 (you will have to download 
> it) then run jpackage with something like the following script.  I’ve 
> hacked it a bit for confidentiality reasons.  There may be some space 
> characters that need removing!.
>
> export JAVA_HOME="/Users/myuser/Java Downloads/jdk-15.jdk/Contents/Home"
>
> export PATH=" 
> /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/myuser/Java 
> Downloads/jdk-15.jdk/Contents/Home/bin"
>
> echo $PATH
>
> rm -r /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimagetemp
>
> rm -r /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput
>
> jpackage --type app-image --app-version 0.0.1 --copyright "My company 
> 2020" --name MYAPPNAME --dest 
> /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput --temp 
> /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimagetemp --vendor 
> "My Company" --icon 
> /Users/myuser/NetBeansDev/MYAPPNAMEAnt/MYAPPNAME.icns --input 
> /Users/myuser/NetBeansDev/MYAPPNAMEAnt/dist --main-jar 
> MYAPPNAMEAnt.jar --main-class com.you MYAPPNAME.SomeClass 
> --java-options " -Xdock:name=MYAPPNAME" --mac-package-identifier 
> MYAPPNAME --mac-sign --mac-signing-keychain 
> "/Users/myuser/Library/Keychains/login.keychain-db" --verbose
>
> 8.            Check that the signing worked and that the app has 
> appeared at 
> /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput/MYAPPNAME.app 
> and that it is double clickable and passes basic testing. Make a 
> backup of what you have created.
>
> 9.            Zip the .app using Finder compress.
>
> 10.          Upload
>
>             See 
> https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow 
> section on “Upload Your App to the Notarization Service”.
>
>                 Create an application password using the Apple 
> Developer site..
>
> xcrun altool --notarize-app --primary-bundle-id 
> "MyAppNotarisation4Sept2020" --username a@b.c <ma...@b.c> 
> --password "Apple generated app password" --file 
> /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput/MYAPPNAME.app.zip 
> --verbose
>
> Look at the output carefully and hope you get an email.
>
> 11.          Check the notarization history
>
> xcrun altool --notarization-history 0 --username a@b.c <ma...@b.c> 
> --password "Apple generated app password"
>
> 12.          Staple the .app
>
> xcrun stapler staple 
> "/Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput/MYAPPNAME.app"
>
> 13.          Test:  You can now put the .app on your web site, down 
> load it, copy it /Applications on any machine and then double click it.
>
> We have also succeeded in making an installer and a .dmg.  The .dmg 
> has to be made from the stapled .app.  This process is less tested.  
> Let me know if you get the above to work and I will share.
>
> As mentioned, I’m working on a Java app to do all the above with one 
> click – not finished yet !!
>
> Regards
>
> David
>
> On 04/09/2020, 13:32, "Chris Olsen" <co...@mchsi.com> wrote:
>
>     David --
>
>       I am much interested in your statement...
>
>       > We have also mastered the issues around Apple notarization 
> needed to distribute an .app or .dmg.
>
>       Can elaborate on this?  Or better yet provide some code or 
> script to make this happen?   I do NOT want to mess with XCode!!
>
>       -- Chris
>
>     ----- Original Message -----
>
>     From: "David Gradwell" <da...@gradwell.com>
>
>     To: "HRH" <hr...@yahoo.com.INVALID>, "users" 
> <us...@netbeans.apache.org>
>
>     Sent: Friday, September 4, 2020 5:24:18 AM
>
>     Subject: Re: Maven deployment plugin for JavaFX
>
>     I have exactly the same question for any standard Java 
> application.  In previous versions of NetBeans an Ant project used to 
> provide this capability but Ant package as seems to be broken in 
> NetBeans 12.  For example, using:
>
>     Product Version: Apache NetBeans IDE 12.0
>
>     Java: 14.0.1; OpenJDK 64-Bit Server VM 14.0.1+7
>
>     Runtime: OpenJDK Runtime Environment 14.0.1+7
>
>     We get /AntProject/nbproject/build-native.xml:519: typedef class 
> com.sun.javafx.tools.ant.FXJar cannot be found
>
>     using the classloader AntClassLoader[].
>
>     In order to use Maven which as you say appears not to support we 
> now use jpackage successfully. We have also mastered the issues around 
> Apple notarization needed to distribute an .app or .dmg.
>
>     So now we are working on a Java app that will do all the steps in 
> one click for any application !
>
>     I agree it would be nice to find a NetBeans plugin for Maven to do 
> all the packaging.  If one needs writing then I am happy to contribute 
> the logic and worked examples.
>
>     David Gradwell
>

Re: Maven deployment plugin for JavaFX

Posted by Chris Olsen <co...@mchsi.com>.
David --

  Thank you!  I will try doing this.

  -- Chris

----- Original Message -----
From: "David Gradwell" <da...@gradwell.com>
To: "COlsen" <co...@mchsi.com>
Cc: "users" <us...@netbeans.apache.org>
Sent: Friday, September 4, 2020 8:21:33 AM
Subject: Re: Maven deployment plugin for JavaFX

Chris,



Hopefully some of the following will help.  We too did not want to use XCode (much!).  You have to install it and use certain upload/notarise tools, but that works.



So, my steps list is:



1.            Set up an Apple developer ID, pay fee etc.  using an email – we use a@b.c<ma...@b.c> in the following.



2.            Create and download a DeveloperID signing cert  to your development Mac's  login keychain from https://developer.apple.com/account/resources/certificates/list



3.            Create and download a Developer ID profile to System Preferences/Profiles.



4.            Build your project with Ant since Ant puts all the library files in a folder called lib in dist.  If Maven is your primary environment, just build the top level of the project with Ant.  If you know how to make Maven put all the dependencies in one place ready for jpackage please tell me !



5.            Local test the Ant project and if it behaves proceed.



6.            Make a Mac icon.



7.            Using the pre-release Java 15 (you will have to download it) then run jpackage with something like the following script.  I’ve hacked it a bit for confidentiality reasons.  There may be some space characters that need removing!.





export JAVA_HOME="/Users/myuser/Java Downloads/jdk-15.jdk/Contents/Home"



export PATH=" /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/myuser/Java Downloads/jdk-15.jdk/Contents/Home/bin"



echo $PATH

rm -r /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimagetemp



rm -r /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput





jpackage --type app-image --app-version 0.0.1 --copyright "My company 2020" --name MYAPPNAME --dest /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput --temp /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimagetemp --vendor "My Company" --icon /Users/myuser/NetBeansDev/MYAPPNAMEAnt/MYAPPNAME.icns --input /Users/myuser/NetBeansDev/MYAPPNAMEAnt/dist --main-jar MYAPPNAMEAnt.jar --main-class com.you MYAPPNAME.SomeClass --java-options " -Xdock:name=MYAPPNAME" --mac-package-identifier MYAPPNAME --mac-sign --mac-signing-keychain "/Users/myuser/Library/Keychains/login.keychain-db" --verbose



8.            Check that the signing worked and that the app has appeared at /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput/MYAPPNAME.app and that it is double clickable and passes basic testing.  Make a backup of what you have created.



9.            Zip the .app using Finder compress.



10.          Upload


            See https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow section on “Upload Your App to the Notarization Service”.



                Create an application password using the Apple Developer site..





xcrun altool --notarize-app  --primary-bundle-id "MyAppNotarisation4Sept2020" --username a@b.c<ma...@b.c>  --password "Apple generated app password" --file /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput/MYAPPNAME.app.zip --verbose



Look at the output carefully and hope you get an email.



11.          Check the notarization history



xcrun altool --notarization-history 0 --username a@b.c<ma...@b.c>   --password "Apple generated app password"



12.          Staple the .app



xcrun stapler staple "/Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput/MYAPPNAME.app"



13.          Test:  You can now put the .app on your web site, down load it, copy it /Applications on any machine and then double click it.



We have also succeeded in making an installer and a .dmg.  The .dmg has to be made from the stapled .app.  This process is less tested.  Let me know if you get the above to work and I will share.



As mentioned, I’m working on a Java app to do all the above with one click – not finished yet !!



Regards



David





On 04/09/2020, 13:32, "Chris Olsen" <co...@mchsi.com> wrote:



    David --



      I am much interested in your statement...



      > We have also mastered the issues around Apple notarization needed to distribute an .app or .dmg.



      Can elaborate on this?  Or better yet provide some code or script to make this happen?   I do NOT want to mess with XCode!!



      -- Chris



    ----- Original Message -----

    From: "David Gradwell" <da...@gradwell.com>

    To: "HRH" <hr...@yahoo.com.INVALID>, "users" <us...@netbeans.apache.org>

    Sent: Friday, September 4, 2020 5:24:18 AM

    Subject: Re: Maven deployment plugin for JavaFX



    I have exactly the same question for any standard Java application.  In previous versions of NetBeans an Ant project used to provide this capability but Ant package as seems to be broken in NetBeans 12.  For example, using:



    Product Version: Apache NetBeans IDE 12.0



    Java: 14.0.1; OpenJDK 64-Bit Server VM 14.0.1+7



    Runtime: OpenJDK Runtime Environment 14.0.1+7

    We get  /AntProject/nbproject/build-native.xml:519: typedef class com.sun.javafx.tools.ant.FXJar cannot be found

    using the classloader AntClassLoader[].



    In order to use Maven which as you say appears not to support we now use jpackage successfully.  We have also mastered the issues around Apple notarization needed to distribute an .app or .dmg.



    So now we are working on a Java app that will do all the steps in one click for any application !



    I agree it would be nice to find a NetBeans plugin for Maven to do all the packaging.  If one needs writing then I am happy to contribute the logic and worked examples.



    David Gradwell

Re: Maven deployment plugin for JavaFX

Posted by David Gradwell <da...@gradwell.com>.
Chris,



Hopefully some of the following will help.  We too did not want to use XCode (much!).  You have to install it and use certain upload/notarise tools, but that works.



So, my steps list is:



1.            Set up an Apple developer ID, pay fee etc.  using an email – we use a@b.c<ma...@b.c> in the following.



2.            Create and download a DeveloperID signing cert  to your development Mac's  login keychain from https://developer.apple.com/account/resources/certificates/list



3.            Create and download a Developer ID profile to System Preferences/Profiles.



4.            Build your project with Ant since Ant puts all the library files in a folder called lib in dist.  If Maven is your primary environment, just build the top level of the project with Ant.  If you know how to make Maven put all the dependencies in one place ready for jpackage please tell me !



5.            Local test the Ant project and if it behaves proceed.



6.            Make a Mac icon.



7.            Using the pre-release Java 15 (you will have to download it) then run jpackage with something like the following script.  I’ve hacked it a bit for confidentiality reasons.  There may be some space characters that need removing!.





export JAVA_HOME="/Users/myuser/Java Downloads/jdk-15.jdk/Contents/Home"



export PATH=" /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/myuser/Java Downloads/jdk-15.jdk/Contents/Home/bin"



echo $PATH

rm -r /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimagetemp



rm -r /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput





jpackage --type app-image --app-version 0.0.1 --copyright "My company 2020" --name MYAPPNAME --dest /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput --temp /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimagetemp --vendor "My Company" --icon /Users/myuser/NetBeansDev/MYAPPNAMEAnt/MYAPPNAME.icns --input /Users/myuser/NetBeansDev/MYAPPNAMEAnt/dist --main-jar MYAPPNAMEAnt.jar --main-class com.you MYAPPNAME.SomeClass --java-options " -Xdock:name=MYAPPNAME" --mac-package-identifier MYAPPNAME --mac-sign --mac-signing-keychain "/Users/myuser/Library/Keychains/login.keychain-db" --verbose



8.            Check that the signing worked and that the app has appeared at /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput/MYAPPNAME.app and that it is double clickable and passes basic testing.  Make a backup of what you have created.



9.            Zip the .app using Finder compress.



10.          Upload


            See https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow section on “Upload Your App to the Notarization Service”.



                Create an application password using the Apple Developer site..





xcrun altool --notarize-app  --primary-bundle-id "MyAppNotarisation4Sept2020" --username a@b.c<ma...@b.c>  --password "Apple generated app password" --file /Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput/MYAPPNAME.app.zip --verbose



Look at the output carefully and hope you get an email.



11.          Check the notarization history



xcrun altool --notarization-history 0 --username a@b.c<ma...@b.c>   --password "Apple generated app password"



12.          Staple the .app



xcrun stapler staple "/Users/myuser/NetBeansDev/MYAPPNAMEAnt/jpackageappimageoutput/MYAPPNAME.app"



13.          Test:  You can now put the .app on your web site, down load it, copy it /Applications on any machine and then double click it.



We have also succeeded in making an installer and a .dmg.  The .dmg has to be made from the stapled .app.  This process is less tested.  Let me know if you get the above to work and I will share.



As mentioned, I’m working on a Java app to do all the above with one click – not finished yet !!



Regards



David





On 04/09/2020, 13:32, "Chris Olsen" <co...@mchsi.com> wrote:



    David --



      I am much interested in your statement...



      > We have also mastered the issues around Apple notarization needed to distribute an .app or .dmg.



      Can elaborate on this?  Or better yet provide some code or script to make this happen?   I do NOT want to mess with XCode!!



      -- Chris



    ----- Original Message -----

    From: "David Gradwell" <da...@gradwell.com>

    To: "HRH" <hr...@yahoo.com.INVALID>, "users" <us...@netbeans.apache.org>

    Sent: Friday, September 4, 2020 5:24:18 AM

    Subject: Re: Maven deployment plugin for JavaFX



    I have exactly the same question for any standard Java application.  In previous versions of NetBeans an Ant project used to provide this capability but Ant package as seems to be broken in NetBeans 12.  For example, using:



    Product Version: Apache NetBeans IDE 12.0



    Java: 14.0.1; OpenJDK 64-Bit Server VM 14.0.1+7



    Runtime: OpenJDK Runtime Environment 14.0.1+7

    We get  /AntProject/nbproject/build-native.xml:519: typedef class com.sun.javafx.tools.ant.FXJar cannot be found

    using the classloader AntClassLoader[].



    In order to use Maven which as you say appears not to support we now use jpackage successfully.  We have also mastered the issues around Apple notarization needed to distribute an .app or .dmg.



    So now we are working on a Java app that will do all the steps in one click for any application !



    I agree it would be nice to find a NetBeans plugin for Maven to do all the packaging.  If one needs writing then I am happy to contribute the logic and worked examples.



    David Gradwell



Re: Maven deployment plugin for JavaFX

Posted by Chris Olsen <co...@mchsi.com>.
David --

  I am much interested in your statement...

  > We have also mastered the issues around Apple notarization needed to distribute an .app or .dmg.

  Can elaborate on this?  Or better yet provide some code or script to make this happen?   I do NOT want to mess with XCode!!

  -- Chris

----- Original Message -----
From: "David Gradwell" <da...@gradwell.com>
To: "HRH" <hr...@yahoo.com.INVALID>, "users" <us...@netbeans.apache.org>
Sent: Friday, September 4, 2020 5:24:18 AM
Subject: Re: Maven deployment plugin for JavaFX

I have exactly the same question for any standard Java application.  In previous versions of NetBeans an Ant project used to provide this capability but Ant package as seems to be broken in NetBeans 12.  For example, using:

Product Version: Apache NetBeans IDE 12.0

Java: 14.0.1; OpenJDK 64-Bit Server VM 14.0.1+7

Runtime: OpenJDK Runtime Environment 14.0.1+7
We get  /AntProject/nbproject/build-native.xml:519: typedef class com.sun.javafx.tools.ant.FXJar cannot be found
using the classloader AntClassLoader[].

In order to use Maven which as you say appears not to support we now use jpackage successfully.  We have also mastered the issues around Apple notarization needed to distribute an .app or .dmg.

So now we are working on a Java app that will do all the steps in one click for any application !

I agree it would be nice to find a NetBeans plugin for Maven to do all the packaging.  If one needs writing then I am happy to contribute the logic and worked examples.

David Gradwell


Re: Maven deployment plugin for JavaFX

Posted by HRH <hr...@yahoo.com.INVALID>.
David,
Thanks for outlining your thoughts,it seems like a novel solution. The coveted solution would be (dreaming or ideallyspeaking) a feature integrated into the Project->Properties (or perhapselsewhere in the IDE), which can create a self_contained_installable package ofthe user’s project for a specific platform (or all). This certainly would obviatethe deployment overhead that developers have to grapple with at each softwarerelease. Currently, I cogitate about implementing my own simple JavaFX solutionto output a “.exe” installable on Windows 10.

 

Thanks

 

 
   On Friday, September 4, 2020, 2:54:30 PM GMT+4:30, David Gradwell <da...@gradwell.com> wrote:  
 
 #yiv1672829086 #yiv1672829086 -- _filtered {} _filtered {} _filtered {}#yiv1672829086 #yiv1672829086 p.yiv1672829086MsoNormal, #yiv1672829086 li.yiv1672829086MsoNormal, #yiv1672829086 div.yiv1672829086MsoNormal {margin:0cm;font-size:11.0pt;font-family:sans-serif;}#yiv1672829086 span.yiv1672829086EmailStyle18 {font-family:sans-serif;color:windowtext;}#yiv1672829086 .yiv1672829086MsoChpDefault {font-size:10.0pt;} _filtered {}#yiv1672829086 div.yiv1672829086WordSection1 {}#yiv1672829086 
I have exactly the same question for any standard Java application.  In previous versions of NetBeans an Ant project used to provide this capability but Ant package as seems to be broken in NetBeans 12.  For example, using:
 
Product Version: Apache NetBeans IDE 12.0 
 
Java: 14.0.1; OpenJDK 64-Bit Server VM 14.0.1+7 
 
Runtime: OpenJDK Runtime Environment 14.0.1+7 
 
We get  /AntProject/nbproject/build-native.xml:519: typedef class com.sun.javafx.tools.ant.FXJar cannot be found
 
using the classloader AntClassLoader[].
 
  
 
In order to use Maven which as you say appears not to support we now use jpackage successfully.  We have also mastered the issues around Apple notarization needed to distribute an .app or .dmg.
 
  
 
So now we are working on a Java app that will do all the steps in one click for any application !
 
  
 
I agree it would be nice to find a NetBeans plugin for Maven to do all the packaging.  If one needs writing then I am happy to contribute the logic and worked examples.
 
  
 
David Gradwell
 
  
 
From: HRH <hr...@yahoo.com.INVALID>
Date: Thursday, 3 September 2020 at 19:04
To: NetBeans Mailing List <us...@netbeans.apache.org>
Subject: Maven deployment plugin for JavaFX
 
  
 
Hi,
 
  
 
Does anyone know, if Maven has a plugin deployment for JavaFX application that will render a self-contained installable package for a given (or all) platform(s) (i.e. Windows - 64 bit, Linux or Mac OS)? I rather use a plugin and have the IDE do most of the work than using the Java Jpackage tool and do all the work myself.
 
  
 
Thanks
   

Re: Maven deployment plugin for JavaFX

Posted by David Gradwell <da...@gradwell.com>.
I have exactly the same question for any standard Java application.  In previous versions of NetBeans an Ant project used to provide this capability but Ant package as seems to be broken in NetBeans 12.  For example, using:

Product Version: Apache NetBeans IDE 12.0

Java: 14.0.1; OpenJDK 64-Bit Server VM 14.0.1+7

Runtime: OpenJDK Runtime Environment 14.0.1+7
We get  /AntProject/nbproject/build-native.xml:519: typedef class com.sun.javafx.tools.ant.FXJar cannot be found
using the classloader AntClassLoader[].

In order to use Maven which as you say appears not to support we now use jpackage successfully.  We have also mastered the issues around Apple notarization needed to distribute an .app or .dmg.

So now we are working on a Java app that will do all the steps in one click for any application !

I agree it would be nice to find a NetBeans plugin for Maven to do all the packaging.  If one needs writing then I am happy to contribute the logic and worked examples.

David Gradwell

From: HRH <hr...@yahoo.com.INVALID>
Date: Thursday, 3 September 2020 at 19:04
To: NetBeans Mailing List <us...@netbeans.apache.org>
Subject: Maven deployment plugin for JavaFX

Hi,

Does anyone know, if Maven has a plugin deployment for JavaFX application that will render a self-contained installable package for a given (or all) platform(s) (i.e. Windows - 64 bit, Linux or Mac OS)? I rather use a plugin and have the IDE do most of the work than using the Java Jpackage tool and do all the work myself.

Thanks