You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Steven Yi <st...@gmail.com> on 2019/11/10 08:21:32 UTC

Maven Platform App: Run App when working on module

Hi All,

Having moved to Maven with my platform app, I've got a question about
workflow. Right now when I'm working on a change in one of my modules,
to test it, I have to:

1. Build the current module
2. Select the main application module
3. Run the main application module

In the past, when working with the app when it used Ant, I could just
hit run any Netbeans would rebuild the module, build and run the
application with one click.

Does anyone know of a way I could do this with a Maven-based app? I
suppose what I'm looking for is the equivalent of running 'mvn
install' in the current module's directory, then running
'nbm:cluster-app nbm:run-platform' in the nbm-applicaiton module.

Thanks,
Steven

---------------------------------------------------------------------
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 Platform App: Run App when working on module

Posted by Steven Yi <st...@gmail.com>.
Hi All,

Just to follow up on this, the solution I found was to remove
"OpenIDE-Module: x.y.z" entries from my manifest.mf files and just use
the auto-generated values from nbm-maven-plugin.  This gets the name
to match the codeNameBase generated from the Maven module when running
the application and class patching now works. This also changes the
module name but it's fine in my case as these modules are not used
outside of this application.

Thanks,
Steven

On Sun, Nov 10, 2019 at 4:50 AM Steven Yi <st...@gmail.com> wrote:
>
> Hi Thomas,
>
> Thanks for the reply. I had tried that before and tried it again just
> now with the same result that it does not work. Compile on Save is on
> for all of the modules.  If I make a change and save the file, on the
> file system I can see a new .class generated in
> myModule/target/classes in the appropriate sub-folder.  When executing
> the module set at the "main project", I see:
>
> "Running NetBeans Compile On Save execution. Phase execution is
> skipped and output directories of dependency projects (with Compile on
> Save turned on) will be used instead of their jar artifacts."
>
> and I see in the output:
>
> Executing: /bin/sh -c
> '/Users/syyigmmbp/work/nbprojects/blue/application/target/blue/bin/blue'
> '--userdir' '/Users/syyigmmbp/work/nbprojects/blue/application/target/userdir'
> '-J-Dnetbeans.logger.console=true' '-J-ea' '--branding' 'blue'
> '--jdkhome' '/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home'
> '-J-Dnetbeans.patches.com.kunstmusik.csound.manual=/Users/syyigmmbp/work/nbprojects/blue/csound-manual/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.services=/Users/syyigmmbp/work/nbprojects/blue/blue-services/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.projects=/Users/syyigmmbp/work/nbprojects/blue/blue-projects/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.settings=/Users/syyigmmbp/work/nbprojects/blue/blue-settings/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.csnd6=/Users/syyigmmbp/work/nbprojects/blue/blue-csnd6/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.score.layers.patterns.ui=/Users/syyigmmbp/work/nbprojects/blue/blue-score-layers-patterns-ui/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.ui.filemanager=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-filemanager/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.score.layers.audio.core=/Users/syyigmmbp/work/nbprojects/blue/blue-score-layers-audio-core/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.ext.exml=/Users/syyigmmbp/work/nbprojects/blue/blue-ext-exml/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.ext.openjfx=/Users/syyigmmbp/work/nbprojects/blue/blue-ext-openjfx/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.ext.commons.lang3=/Users/syyigmmbp/work/nbprojects/blue/blue-ext-commons-lang3/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.score.layers.audio.ui=/Users/syyigmmbp/work/nbprojects/blue/blue-score-layers-audio-ui/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.utilities=/Users/syyigmmbp/work/nbprojects/blue/blue-utilities/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.branding=/Users/syyigmmbp/work/nbprojects/blue/branding/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.ui.nbutilities=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-nbutilities/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.core=/Users/syyigmmbp/work/nbprojects/blue/blue-core/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.score.layers.patterns.core=/Users/syyigmmbp/work/nbprojects/blue/blue-score-layers-patterns-core/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.ui.editor=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-editor/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.plugin=/Users/syyigmmbp/work/nbprojects/blue/blue-plugin/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.ui.utilities=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-utilities/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.midi=/Users/syyigmmbp/work/nbprojects/blue/blue-midi/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.application=/Users/syyigmmbp/work/nbprojects/blue/blue-application/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.ui.core=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-core/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.jfx=/Users/syyigmmbp/work/nbprojects/blue/blue-jfx/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.clojure=/Users/syyigmmbp/work/nbprojects/blue/blue-clojure/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.ui.components=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-components/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.ext.jython=/Users/syyigmmbp/work/nbprojects/blue/blue-ext-jython/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.plaf=/Users/syyigmmbp/work/nbprojects/blue/blue-plaf/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.cecilia=/Users/syyigmmbp/work/nbprojects/blue/cecilia/target/classes'
> '-J-Dnetbeans.patches.com.kunstmusik.blue.osc=/Users/syyigmmbp/work/nbprojects/blue/blue-osc/target/classes'
>
> But the modified class is not picked up.  I have to find the module in
> the project window, right-click and choose build, then run the
> application before the modifications are seen.
>
> I took a look at JIRA and found NETBEANS-2424 which seems related
> though the reports seem to discuss hotswapping rather than this. It
> seems to me that the netbeans.patches system is not working.
>
> Actually... I think I've found the problem.  What I'm finding is that
> the commandline for netbeans.patches is appending the groupId to the
> generated flags. StandardModule in o.n.boostrap is searching for the
> patches name based just on codename base, but that seems to be the
> OpenIDE-Module value from the manifest.
>
> So instead of:
>
> -J-Dnetbeans.patches.com.kunstmusik.blue.ui.core=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-core/target/classes'
>
> it would need to be:
>
> -J-Dnetbeans.patches.blue.ui.core=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-core/target/classes'
>
> for this line:
>
>             String patchesClassPath =
> System.getProperty("netbeans.patches." + getCodeNameBase()); // NOI18N
>
> from StandardModule:findPatches() to work.  (I placed a breakpoint
> there and stepped through; for all of my modules it gets nulls for
> patchesClassPath because of the com.kunstmusik being prepended).
>
> Now, I don't know if this is an issue of something I can change in my
> project to get this to work, or if this is a legitimate bug in
> Netbeans.  (Or if this is something that would work for
> run-of-the-mill maven projects but doesn't for Platform apps.).
>
> Any suggestions appreciated!
>
> Thanks,
> Steven
>
> On Sun, Nov 10, 2019 at 3:38 AM Thomas Kellerer <sh...@gmx.net> wrote:
> >
> > Steven Yi schrieb am 10.11.2019 um 09:21:
> > > Having moved to Maven with my platform app, I've got a question about
> > > workflow. Right now when I'm working on a change in one of my modules,
> > > to test it, I have to:
> > >
> > > 1. Build the current module
> > > 2. Select the main application module
> > > 3. Run the main application module
> > >
> > > In the past, when working with the app when it used Ant, I could just
> > > hit run any Netbeans would rebuild the module, build and run the
> > > application with one click.
> > >
> > > Does anyone know of a way I could do this with a Maven-based app? I
> > > suppose what I'm looking for is the equivalent of running 'mvn
> > > install' in the current module's directory, then running
> > > 'nbm:cluster-app nbm:run-platform' in the nbm-applicaiton module.
> >
> > Not sure if this is different for NetBeans RCP apps, but typically you do that by defining the module as the main project
> >
> > You can select the main project through "Run -> Set Main Project"
> >
> >
> > Regards
> > Thomas
> >
> >
> > ---------------------------------------------------------------------
> > 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
> >

---------------------------------------------------------------------
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 Platform App: Run App when working on module

Posted by Steven Yi <st...@gmail.com>.
Hi Thomas,

Thanks for the reply. I had tried that before and tried it again just
now with the same result that it does not work. Compile on Save is on
for all of the modules.  If I make a change and save the file, on the
file system I can see a new .class generated in
myModule/target/classes in the appropriate sub-folder.  When executing
the module set at the "main project", I see:

"Running NetBeans Compile On Save execution. Phase execution is
skipped and output directories of dependency projects (with Compile on
Save turned on) will be used instead of their jar artifacts."

and I see in the output:

Executing: /bin/sh -c
'/Users/syyigmmbp/work/nbprojects/blue/application/target/blue/bin/blue'
'--userdir' '/Users/syyigmmbp/work/nbprojects/blue/application/target/userdir'
'-J-Dnetbeans.logger.console=true' '-J-ea' '--branding' 'blue'
'--jdkhome' '/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home'
'-J-Dnetbeans.patches.com.kunstmusik.csound.manual=/Users/syyigmmbp/work/nbprojects/blue/csound-manual/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.services=/Users/syyigmmbp/work/nbprojects/blue/blue-services/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.projects=/Users/syyigmmbp/work/nbprojects/blue/blue-projects/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.settings=/Users/syyigmmbp/work/nbprojects/blue/blue-settings/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.csnd6=/Users/syyigmmbp/work/nbprojects/blue/blue-csnd6/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.score.layers.patterns.ui=/Users/syyigmmbp/work/nbprojects/blue/blue-score-layers-patterns-ui/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.ui.filemanager=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-filemanager/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.score.layers.audio.core=/Users/syyigmmbp/work/nbprojects/blue/blue-score-layers-audio-core/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.ext.exml=/Users/syyigmmbp/work/nbprojects/blue/blue-ext-exml/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.ext.openjfx=/Users/syyigmmbp/work/nbprojects/blue/blue-ext-openjfx/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.ext.commons.lang3=/Users/syyigmmbp/work/nbprojects/blue/blue-ext-commons-lang3/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.score.layers.audio.ui=/Users/syyigmmbp/work/nbprojects/blue/blue-score-layers-audio-ui/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.utilities=/Users/syyigmmbp/work/nbprojects/blue/blue-utilities/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.branding=/Users/syyigmmbp/work/nbprojects/blue/branding/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.ui.nbutilities=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-nbutilities/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.core=/Users/syyigmmbp/work/nbprojects/blue/blue-core/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.score.layers.patterns.core=/Users/syyigmmbp/work/nbprojects/blue/blue-score-layers-patterns-core/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.ui.editor=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-editor/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.plugin=/Users/syyigmmbp/work/nbprojects/blue/blue-plugin/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.ui.utilities=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-utilities/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.midi=/Users/syyigmmbp/work/nbprojects/blue/blue-midi/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.application=/Users/syyigmmbp/work/nbprojects/blue/blue-application/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.ui.core=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-core/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.jfx=/Users/syyigmmbp/work/nbprojects/blue/blue-jfx/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.clojure=/Users/syyigmmbp/work/nbprojects/blue/blue-clojure/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.ui.components=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-components/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.ext.jython=/Users/syyigmmbp/work/nbprojects/blue/blue-ext-jython/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.plaf=/Users/syyigmmbp/work/nbprojects/blue/blue-plaf/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.cecilia=/Users/syyigmmbp/work/nbprojects/blue/cecilia/target/classes'
'-J-Dnetbeans.patches.com.kunstmusik.blue.osc=/Users/syyigmmbp/work/nbprojects/blue/blue-osc/target/classes'

But the modified class is not picked up.  I have to find the module in
the project window, right-click and choose build, then run the
application before the modifications are seen.

I took a look at JIRA and found NETBEANS-2424 which seems related
though the reports seem to discuss hotswapping rather than this. It
seems to me that the netbeans.patches system is not working.

Actually... I think I've found the problem.  What I'm finding is that
the commandline for netbeans.patches is appending the groupId to the
generated flags. StandardModule in o.n.boostrap is searching for the
patches name based just on codename base, but that seems to be the
OpenIDE-Module value from the manifest.

So instead of:

-J-Dnetbeans.patches.com.kunstmusik.blue.ui.core=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-core/target/classes'

it would need to be:

-J-Dnetbeans.patches.blue.ui.core=/Users/syyigmmbp/work/nbprojects/blue/blue-ui-core/target/classes'

for this line:

            String patchesClassPath =
System.getProperty("netbeans.patches." + getCodeNameBase()); // NOI18N

from StandardModule:findPatches() to work.  (I placed a breakpoint
there and stepped through; for all of my modules it gets nulls for
patchesClassPath because of the com.kunstmusik being prepended).

Now, I don't know if this is an issue of something I can change in my
project to get this to work, or if this is a legitimate bug in
Netbeans.  (Or if this is something that would work for
run-of-the-mill maven projects but doesn't for Platform apps.).

Any suggestions appreciated!

Thanks,
Steven

On Sun, Nov 10, 2019 at 3:38 AM Thomas Kellerer <sh...@gmx.net> wrote:
>
> Steven Yi schrieb am 10.11.2019 um 09:21:
> > Having moved to Maven with my platform app, I've got a question about
> > workflow. Right now when I'm working on a change in one of my modules,
> > to test it, I have to:
> >
> > 1. Build the current module
> > 2. Select the main application module
> > 3. Run the main application module
> >
> > In the past, when working with the app when it used Ant, I could just
> > hit run any Netbeans would rebuild the module, build and run the
> > application with one click.
> >
> > Does anyone know of a way I could do this with a Maven-based app? I
> > suppose what I'm looking for is the equivalent of running 'mvn
> > install' in the current module's directory, then running
> > 'nbm:cluster-app nbm:run-platform' in the nbm-applicaiton module.
>
> Not sure if this is different for NetBeans RCP apps, but typically you do that by defining the module as the main project
>
> You can select the main project through "Run -> Set Main Project"
>
>
> Regards
> Thomas
>
>
> ---------------------------------------------------------------------
> 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
>

---------------------------------------------------------------------
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 Platform App: Run App when working on module

Posted by Thomas Kellerer <sh...@gmx.net>.
Steven Yi schrieb am 10.11.2019 um 09:21:
> Having moved to Maven with my platform app, I've got a question about
> workflow. Right now when I'm working on a change in one of my modules,
> to test it, I have to:
>
> 1. Build the current module
> 2. Select the main application module
> 3. Run the main application module
>
> In the past, when working with the app when it used Ant, I could just
> hit run any Netbeans would rebuild the module, build and run the
> application with one click.
>
> Does anyone know of a way I could do this with a Maven-based app? I
> suppose what I'm looking for is the equivalent of running 'mvn
> install' in the current module's directory, then running
> 'nbm:cluster-app nbm:run-platform' in the nbm-applicaiton module.

Not sure if this is different for NetBeans RCP apps, but typically you do that by defining the module as the main project

You can select the main project through "Run -> Set Main Project"


Regards
Thomas


---------------------------------------------------------------------
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