This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
In NetBeans 7.3 I tried to create a pom.xml with multiple profiles and then associate "Run Project" action with set of goals (same in all profiles). Looks like having nbactions.xml with: + <action> + <actionName>run</actionName> + <goals> + <goal>process-classes</goal> + <goal>bck2brwsr:brwsr</goal> + </goals> + </action> is not enough. The "Run Project" then works on default configuration, but not on any other.
I managed to work around the problem by tripplicating the configuration: https://java.net/projects/html/sources/87451/diff//?rev1=1&rev2=2 Thus lowering priority. Still, it would be more effective if nbactions.xml was inherited into all configurations. Possibly, following enhancement would be even better. Just a single nbactions.xml with "activeProfile(s)" element(s): <action> <actionName>run</actionName> <goals> <goal>process-classes</goal> <goal>bck2brwsr:brwsr</goal> </goals> <activeProfile>*</activeProfile> </action> <action> <actionName>debug</actionName> <goals> <goal>process-classes</goal> <goal>bck2brwsr:brwsr</goal> </goals> <properties>...</properties> <activeProfile>fxbrwsr</activeProfile> <activeProfile>default</activeProfile> </action> Just an thought...
I need this to address https://java.net/bugzilla/show_bug.cgi?id=6150 Probably better it would be to mimic the profile syntax from settings.xml and pom.xml. Here is an example: <?xml version="1.0" encoding="UTF-8"?> <actions> <action> <actionName>run</actionName> <goals> <goal>process-classes</goal> <goal>exec:java</goal> </goals> </action> <profiles> <profile> <id>bck2brwsr</id> <actions> <action> <actionName>run</actionName> <displayName>Run in a Browser</displayName> <goals> <goal>clean</goal> <goal>package</goal> <goal>bck2brwsr:show</goal> </goals> <activatedProfiles> <activatedProfile>bck2brwsr</activatedProfile> </activatedProfiles> <properties> <skipTests>true</skipTests> </properties> </action> </actions> </profile> </profiles> </actions> I'll attach a patch. Can we integrate the change for NetBeans 8.0.1?
Created attachment 148060 [details] Support for <profiles> section in nbactions.xml I tried as much as I could to not change the API in the *.api.* packages.
(In reply to Jaroslav Tulach from comment #3) > Created attachment 148060 [details] > Support for <profiles> section in nbactions.xml > > I tried as much as I could to not change the API in the *.api.* packages. ok
changeset: 5323d799eef3 tag: tip user: Jaroslav Tulach <jtulach@netbeans.org> date: Tue Jul 15 19:21:12 2014 +0200 summary: #229192: Documenting the introduction of profiles changeset: 39761cbe2787 user: Jaroslav Tulach <jtulach@netbeans.org> date: Tue Jul 15 17:13:49 2014 +0200 summary: #229192: Supporting different profiles in a single nbactions.xml
just a few comments: I lived under impression that nbactions.xml mapping is used if nbactions-profileX.xml doesn't exist. Maybe that got broken lately (or I'm hallucinating, both is possible). how will the added code changes interact with the UI customizer panel edits? This appears to be a backend only change for projects which edit the nbactions.xml file manually? In general I don't follow how introducing <profiles> from Comment 2 improves the situation in anything but number of files. You still appear to require 1 definition per profile without any inheritance or delegation. Additionally there is a terminology confusion here, actions don't work per "profile" id, but per "configuration" id. For maven profiles we dynamically create configuration instance with profile.id == configuration.id, but users can define custom persisted configurations typically to enable multiple profiles at the same time and to add properties next to profiles. Additionally the single action mapping already contains <<activatedProfiles> element (that enables profiles for that given configuration-action combo only. a rewrite for action mapping subsystem is long overdue (my fault) but I'm not sure if this is a correct long term approach to tackle the problem.
Integrated into 'main-silver', will be available in build *201407180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/39761cbe2787 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #229192: Supporting different profiles in a single nbactions.xml
Integrated into 'main-silver', will be available in build *201407230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/89ce8aec1248 User: Jaroslav Tulach <jtulach@netbeans.org> Log: Refinement to #229192: fallback to main list of actions