Re: Bundling a JVM for a mavenized project

William Winder <[email protected]> Wed, 13 Sep 2017 10:20:15 -0400
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAJYutchK=YkuMbiBuJ4_M4OXh-cB3ApL0r3mAfZB8C+MJvF4fg@mail.gmail.com>
--001a11412b18d9ee3c055912dba9
Content-Type: text/plain; charset="UTF-8"

Thank you Peter! I missed the important step in your first email where you
have a copy of the harness in your project. I found the
"${nbi.stub.location}" setting in the template.xml, so I will try updating
that to point to a local copy of the harness.

On Wed, Sep 13, 2017 at 6:35 AM, Peter Hansson <[email protected]>
wrote:

> It is in file build.xml which is in same directory as file
> template.xml. That directory is harness/nbi/stub. Anyway, you need to
> customize build.xml file.
>
> template.xml will ultimately invoke build.xml.
>
> On Tue, Sep 12, 2017 at 3:22 PM, William Winder <[email protected]>
> wrote:
> > Thanks Peter, it's reassuring to know that it's possible.
> >
> > If you give me one more hint, how do I override the "-generate-bundles"
> > target and <create-bundle> calls? It isn't present in the template.xml
> file.
> > Once I get over that hurdle I can customize things according to my
> > requirements, and I'll likely create a document for the knowledge base
> that
> > others can use for hints in the future.
> >
> > On Mon, Sep 11, 2017 at 12:59 PM, Peter Hansson
> > <[email protected]> wrote:
> >>
> >> I use my own customized version of the recipe from the DZone article
> >> that you reference.
> >> ... and I use Maven.
> >>
> >> Yes, this is somewhat complicated. The problem is that even if you are
> >> using Maven it will still be the Ant build scripts from the harness
> >> which will be executed when installers are being build. The
> >> nbm-maven-plugin will ultimately simply call Ant script. So you need a
> >> bit of Ant knowledge.
> >>
> >> What you can do in nbm-maven-plugin is set the name of the  'template
> >> file' ( <templateFile>foo/bar/template.xml</templateFile>) which is
> >> really just the starting point of those Ant scripts. Anyway, I copy
> >> the Ant scripts and all their associated stuff (what is known as 'the
> >> harness') from an IDE distro into my installer project's src dir. Then
> >> I have a copy I can customize. Then I let my template file variable in
> >> nbm-maven-plugin point to a template.xml file I have in project's
> >> 'src' dir, rather than something in the IDE's install directory.
> >>
> >> See
> >> http://www.mojohaus.org/nbm-maven-plugin/build-installers-
> mojo.html#templateFile
> >>
> >> How exactly you choose to customize the harness (or rather your
> >> private copy of that) depends entirely on your specific requirements.
> >>
> >> /Peter
> >>
> >> PS: Bundling of a JRE for the Mac OSX platform hasn't worked in the
> >> past but has now been fixed (see
> >> https://netbeans.org/bugzilla/show_bug.cgi?id=250103), however it is
> >> not in NB 8.2. Will be in next release of if you use a dev release.
> >>
> >>
> >> On Mon, Sep 11, 2017 at 2:24 AM, William Winder <[email protected]>
> >> wrote:
> >> > I'm trying to bundle a JVM for a mavenized netbeans platform project.
> >> >
> >> > I've found lots of documentation for configuring the ant scripts, and
> >> > although there are a lot of steps it doesn't seem very complicated to
> >> > configure:
> >> > 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
> >> >
> >> > There is also a lot of detail about configuring the NBI using
> >> > nbm-maven-plugin properties here (mainly the ConfigurationLogic.java
> >> > file):
> >> > http://www.mojohaus.org/nbm-maven-plugin/buildinstexample.html
> >> >
> >> > But I don't see any option for configuring the value of
> >> > "nbi.bundled.jvm.file" which seems to be the missing piece. There is a
> >> > template.xml file which I'm hoping can somehow bridge the gap between
> >> > the
> >> > ant and maven builds, but I'm not clear about how.
> >> >
> >> > Any guidance would be appreciated.
> >
> >
>

--001a11412b18d9ee3c055912dba9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thank you Peter! I missed the important step in your first=
 email where you have a copy of the harness in your project. I found the &q=
uot;${nbi.stub.location}&quot; setting in the template.xml, so I will try u=
pdating that to point to a local copy of the harness.</div><div class=3D"gm=
ail_extra"><br><div class=3D"gmail_quote">On Wed, Sep 13, 2017 at 6:35 AM, =
Peter Hansson <span dir=3D"ltr">&lt;<a href=3D"mailto:peter.hansson.se2@gma=
il.com" target=3D"_blank">[email protected]</a>&gt;</span> wrote:=
<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-lef=
t:1px #ccc solid;padding-left:1ex">It is in file build.xml which is in same=
 directory as file<br>
template.xml. That directory is harness/nbi/stub. Anyway, you need to<br>
customize build.xml file.<br>
<br>
template.xml will ultimately invoke build.xml.<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
On Tue, Sep 12, 2017 at 3:22 PM, William Winder &lt;<a href=3D"mailto:wwind=
[email protected]">[email protected]</a>&gt; wrote:<br>
&gt; Thanks Peter, it&#39;s reassuring to know that it&#39;s possible.<br>
&gt;<br>
&gt; If you give me one more hint, how do I override the &quot;-generate-bu=
ndles&quot;<br>
&gt; target and &lt;create-bundle&gt; calls? It isn&#39;t present in the te=
mplate.xml file.<br>
&gt; Once I get over that hurdle I can customize things according to my<br>
&gt; requirements, and I&#39;ll likely create a document for the knowledge =
base that<br>
&gt; others can use for hints in the future.<br>
&gt;<br>
&gt; On Mon, Sep 11, 2017 at 12:59 PM, Peter Hansson<br>
&gt; &lt;<a href=3D"mailto:[email protected]">peter.hansson.se2@g=
mail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; I use my own customized version of the recipe from the DZone artic=
le<br>
&gt;&gt; that you reference.<br>
&gt;&gt; ... and I use Maven.<br>
&gt;&gt;<br>
&gt;&gt; Yes, this is somewhat complicated. The problem is that even if you=
 are<br>
&gt;&gt; using Maven it will still be the Ant build scripts from the harnes=
s<br>
&gt;&gt; which will be executed when installers are being build. The<br>
&gt;&gt; nbm-maven-plugin will ultimately simply call Ant script. So you ne=
ed a<br>
&gt;&gt; bit of Ant knowledge.<br>
&gt;&gt;<br>
&gt;&gt; What you can do in nbm-maven-plugin is set the name of the=C2=A0 &=
#39;template<br>
&gt;&gt; file&#39; ( &lt;templateFile&gt;foo/bar/<wbr>template.xml&lt;/temp=
lateFile&gt;) which is<br>
&gt;&gt; really just the starting point of those Ant scripts. Anyway, I cop=
y<br>
&gt;&gt; the Ant scripts and all their associated stuff (what is known as &=
#39;the<br>
&gt;&gt; harness&#39;) from an IDE distro into my installer project&#39;s s=
rc dir. Then<br>
&gt;&gt; I have a copy I can customize. Then I let my template file variabl=
e in<br>
&gt;&gt; nbm-maven-plugin point to a template.xml file I have in project&#3=
9;s<br>
&gt;&gt; &#39;src&#39; dir, rather than something in the IDE&#39;s install =
directory.<br>
&gt;&gt;<br>
&gt;&gt; See<br>
&gt;&gt; <a href=3D"http://www.mojohaus.org/nbm-maven-plugin/build-installe=
rs-mojo.html#templateFile" rel=3D"noreferrer" target=3D"_blank">http://www.=
mojohaus.org/nbm-<wbr>maven-plugin/build-installers-<wbr>mojo.html#template=
File</a><br>
&gt;&gt;<br>
&gt;&gt; How exactly you choose to customize the harness (or rather your<br=
>
&gt;&gt; private copy of that) depends entirely on your specific requiremen=
ts.<br>
&gt;&gt;<br>
&gt;&gt; /Peter<br>
&gt;&gt;<br>
&gt;&gt; PS: Bundling of a JRE for the Mac OSX platform hasn&#39;t worked i=
n the<br>
&gt;&gt; past but has now been fixed (see<br>
&gt;&gt; <a href=3D"https://netbeans.org/bugzilla/show_bug.cgi?id=3D250103"=
 rel=3D"noreferrer" target=3D"_blank">https://netbeans.org/bugzilla/<wbr>sh=
ow_bug.cgi?id=3D250103</a>), however it is<br>
&gt;&gt; not in NB 8.2. Will be in next release of if you use a dev release=
.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Sep 11, 2017 at 2:24 AM, William Winder &lt;<a href=3D"mai=
lto:[email protected]">[email protected]</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; I&#39;m trying to bundle a JVM for a mavenized netbeans platf=
orm project.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I&#39;ve found lots of documentation for configuring the ant =
scripts, and<br>
&gt;&gt; &gt; although there are a lot of steps it doesn&#39;t seem very co=
mplicated to<br>
&gt;&gt; &gt; configure:<br>
&gt;&gt; &gt; <a href=3D"http://wiki.netbeans.org/NBIBundledJVM" rel=3D"nor=
eferrer" target=3D"_blank">http://wiki.netbeans.org/<wbr>NBIBundledJVM</a><=
br>
&gt;&gt; &gt; <a href=3D"https://dzone.com/articles/including-jre-in-nbi" r=
el=3D"noreferrer" target=3D"_blank">https://dzone.com/articles/<wbr>includi=
ng-jre-in-nbi</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; <a href=3D"https://blogs.oracle.com/geertjan/installing-the-j=
re-via-an-applications-installer-via-windows" rel=3D"noreferrer" target=3D"=
_blank">https://blogs.oracle.com/<wbr>geertjan/installing-the-jre-<wbr>via-=
an-applications-installer-<wbr>via-windows</a><br>
&gt;&gt; &gt; <a href=3D"https://platform.netbeans.org/tutorials/nbm-nbi.ht=
ml#bundling-jre" rel=3D"noreferrer" target=3D"_blank">https://platform.netb=
eans.org/<wbr>tutorials/nbm-nbi.html#<wbr>bundling-jre</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; There is also a lot of detail about configuring the NBI using=
<br>
&gt;&gt; &gt; nbm-maven-plugin properties here (mainly the ConfigurationLog=
ic.java<br>
&gt;&gt; &gt; file):<br>
&gt;&gt; &gt; <a href=3D"http://www.mojohaus.org/nbm-maven-plugin/buildinst=
example.html" rel=3D"noreferrer" target=3D"_blank">http://www.mojohaus.org/=
nbm-<wbr>maven-plugin/buildinstexample.<wbr>html</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; But I don&#39;t see any option for configuring the value of<b=
r>
&gt;&gt; &gt; &quot;nbi.bundled.jvm.file&quot; which seems to be the missin=
g piece. There is a<br>
&gt;&gt; &gt; template.xml file which I&#39;m hoping can somehow bridge the=
 gap between<br>
&gt;&gt; &gt; the<br>
&gt;&gt; &gt; ant and maven builds, but I&#39;m not clear about how.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Any guidance would be appreciated.<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>

--001a11412b18d9ee3c055912dba9--