public class MavenCommandLineExecutor extends AbstractMavenExecutor
LateBoundPrerequisitesChecker
registered in Maven projects for JAR packaging by default supports
ExplicitProcessParameters
API. The caller of the execute-type action can request to append or replace VM or user
application parameters. The parameters recorded in the POM.xml or NetBeans action mappings are augmented according to that
instructions:
StartupExtender
API are not affected by this feature.
Example use:
// get action provider:The example will appendActionProvider
projectActionProvider = prj.getLookup().lookup(ActionProvider
.class); // create explicit additional parameters instruction:ExplicitProcessParameters
params =ExplicitProcessParameters
.builder(). launcherArg("-DvmArg2=2"). arg("paramY"). build(); // pass explicit parameters to the Run action: projectActionProvider.invokeAction(ActionProvider
.COMMAND_RUN,Lookups
.fixed(params));
-DvmArg2=2
to VM arguments and replaces all user
program arguments with "paramY"
. Append mode can be controlled using ExplicitProcessParameters.Builder#appendArgs
or
ExplicitProcessParameters.Builder#appendPriorityArgs
.Modifier and Type | Class and Description |
---|---|
static class |
MavenCommandLineExecutor.ExecuteMaven
Hooks for tests to mock the Maven execution.
|
AbstractMavenExecutor.MavenItem, AbstractMavenExecutor.OptionsAction, AbstractMavenExecutor.ResumeFromFinder, AbstractMavenExecutor.TabContext
config, item, SEMAPHORE, task
io
Constructor and Description |
---|
MavenCommandLineExecutor(RunConfig conf,
InputOutput io,
AbstractMavenExecutor.TabContext tc) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel() |
static ExecutorTask |
executeMaven(RunConfig config,
InputOutput io,
AbstractMavenExecutor.TabContext tc)
Execute maven build in NetBeans execution engine.
|
void |
run() |
actionStatesAtFinish, actionStatesAtStart, addInitialMessage, createContext, createNewTabActions, processInitialMessage, reassignAdditionalContext, setTask, tabContextType
createInputOutput, getInputOutput, markFreeTab
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInputOutput
public MavenCommandLineExecutor(RunConfig conf, InputOutput io, AbstractMavenExecutor.TabContext tc)
public static ExecutorTask executeMaven(RunConfig config, InputOutput io, AbstractMavenExecutor.TabContext tc)
MavenCommandLineExecutor.run()
as this variant does no (non-late-bound) prerequisite checks.
It is mostly suitable for cases where you need full control by the caller over the config, or want to rerun a previous execution.config
- io
- null
or InputOutput to reuse for output of the executiontc
- tab context to use or null
public void run()
public boolean cancel()