mojohaus / nbm-maven-plugin

moved to https://github.com/apache/incubator-netbeans-mavenutils/
http://www.mojohaus.org/nbm-maven-plugin/
24 stars 19 forks source link

How to include a bundled JVM? #29

Open winder opened 7 years ago

winder commented 7 years ago

There are a number of examples for bundling a JVM: http://wiki.netbeans.org/NBIBundledJVM https://dzone.com/articles/including-jre-in-nbi https://blogs.oracle.com/geertjan/installing-the-jre-via-an-applications-installer-via-windows https://platform.netbeans.org/tutorials/nbm-nbi.html#bundling-jre

But most assume the ANT build scripts are being used. Are there any examples of bundling a JVM with a mavenized project? The first link suggests that it is a matter of setting the nbi.bundled.jvm.file=<path-to-jvm.exe> property, but that doesn't seem to be exposed with nbm-maven-plugin.

I've been trying to piece things together for a while now, the example at http://www.mojohaus.org/nbm-maven-plugin/buildinstexample.html seems to allow most of the configuration required, but I don't see how I can set the nbi.bundled.jvm.file property in /harness/nbi/stub/build.xml with this method. Is that something that a custom template.xml file could accomplish?

Once I manage to get this working I'll likely create a blog post, or contribute to the nbm-maven-plugin documentation with a recipe for others to use.

jvtrudel commented 6 years ago

Have you found a solution to this problem?

winder commented 6 years ago

@jvtrudel yes, it is extremely involved but you can get it working.

I documented some of my experiences: overview of the process this github issue during implementation blog post describing the OSX build

Besides that I can highly recommend checking out Gephi and Ovation which are open source NetBeans Platform projects with some advanced maven builds. I spent a lot of time studying these projcets. You may also want to study my project. I've tried to take the best ideas from all the scattered information and improve them.

The biggest pieces to consider are:

  1. In maven custom template.xml is supported, in that template you can configure installer.build.dir in order to inject the necessary build harness modifications (ConfigurationLogic.java and build.xml, modified as described in the ANT tutorials).
  2. OSX is not supported by the built-in bundles, so that is a separate process (maybe not true for 9.0).
  3. Even with ANT the process of creating self-extracting runtimes for all platforms is a chore.
jvtrudel commented 6 years ago

ok. Thanks a lot!