public final class MavenActions extends Object
A API allows to declaratively register actions using project's Lookup. Action descriptions
must be provided in nbactions.xml
format and referenced from the Layer XML using URL (i.e. nbres: protocol).
The nbactions.xml
may contain descriptors of actions and even profiles which will be turned into
ProjectConfiguration
s. Actions in profiles may override the default action mappings, or supply completely new
actions.
org.netbeans.modules.maven:test.plugin
plugin is used by the maven project:
<folder name="Projects"> <folder name="org-netbeans-modules-maven"> <folder name="org.ntebeans.modules.maven:test.plugin"> <folder name="Lookup"> <file name="maven-project-actions.instance"> <attr name="instanceOf" stringvalue="org.netbeans.spi.project.LookupProvider"/> <attr name="instanceCreate" methodvalue="org.netbeans.api.maven.MavenActions.forProjectLayer"/> <attr name="resource" stringvalue="nbres:/org/netbeans/api/maven/test-maven-actions.xml"/> </file> <file name="maven-project-actions2.instance"> <attr name="instanceOf" stringvalue="org.netbeans.spi.project.LookupProvider"/> <attr name="instanceCreate" methodvalue="org.netbeans.api.maven.MavenActions.forProjectLayer"/> <attr name="resource" stringvalue="nbres:/org/netbeans/api/maven/test-maven-actions2.xml"/> </file> </folder> </folder> </folder> </folder>The referenced resource may declare both default configuration actions, and actions overrides in a specific configuration:
<actions> <actions> <action> <!-- This is a completely new action available for the default configuration --> <actionName>extra</actionName> <goals> <goal>help:effective-pom</goal> </goals> <properties> </properties> </action> </actions> <profiles> <profile> <!-- Configuration ID; actions from same configurations will merge --> <id>example-conf</id> <!-- Display name for the user --> <displayName>Example Configuration</displayName> <actions> <action> <!-- run standard action is changed in this configuration --> <actionName>run</actionName> <goals> <goal>mn:run</goal> </goals> <properties> <exec.vmArgs></exec.vmArgs> <exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args> <exec.appArgs></exec.appArgs> <exec.mainClass>${packageClassName}</exec.mainClass> </properties> </action> <action> <!-- Since Maven 2.149, one can disable an action, so it is not inherited from the default configuration. Disabled actions have no goals --> <actionName>debug</actionName> </action> </actions> </profile> </profiles> </actions>