Class RunUtils
java.lang.Object
org.netbeans.modules.maven.api.execute.RunUtils
Utility method for executing a maven build, using the RunConfig.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RunConfig
cloneRunConfig
(RunConfig original) return a new instance of runconfig by the template passed as parameterstatic RunConfig
createRunConfig
(File execDir, org.netbeans.api.project.Project prj, String displayName, List<String> goals) static RunConfig
createRunConfig
(String action, org.netbeans.api.project.Project prj, org.netbeans.spi.project.ProjectConfiguration c, org.openide.util.Lookup lookup) Creates aRunConfig
for the specified project action.static org.openide.execution.ExecutorTask
executeMaven
(RunConfig config) Execute maven build in NetBeans execution engine.static boolean
hasApplicationCompileOnSaveEnabled
(org.netbeans.api.project.Project prj) Deprecated.static boolean
Deprecated.static boolean
hasTestCompileOnSaveEnabled
(org.netbeans.api.project.Project prj) Deprecated.static boolean
hasTestCompileOnSaveEnabled
(RunConfig config) Deprecated.static boolean
isCompileOnSaveEnabled
(org.netbeans.api.project.Project prj) static boolean
isCompileOnSaveEnabled
(RunConfig config) static org.openide.execution.ExecutorTask
Runs Maven after checking prerequisites.
-
Method Details
-
run
Runs Maven after checking prerequisites.- Parameters:
config
- a run configuration (trycreateRunConfig(java.lang.String, org.netbeans.api.project.Project, org.netbeans.spi.project.ProjectConfiguration, org.openide.util.Lookup)
)- Returns:
- a task to track progress, or null if prerequisites were not satisfied
- Since:
- 2.18
- See Also:
-
executeMaven
Execute maven build in NetBeans execution engine. Most callers should rather userun(org.netbeans.modules.maven.api.execute.RunConfig)
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.- Parameters:
config
-- Returns:
-
createRunConfig
public static RunConfig createRunConfig(String action, org.netbeans.api.project.Project prj, org.netbeans.spi.project.ProjectConfiguration c, org.openide.util.Lookup lookup) Creates aRunConfig
for the specified project action. Project configuration to be used can be also specified, which affects potentially the action's mapping and/or properties. Ifnull
is passed, the current/active configuration is used. If applied on non-Maven project, the method returnsnull
, as well as if the requested action does not exist in the project or its requested (or active) configuration.- Parameters:
action
- project action nameprj
- the projectc
- the configuration to use, usenull
for the active one.lookup
- lookup that becomes available to the action provider for possible further data / options- Returns:
- configured
RunConfig
suitable for execution ornull
if the project is not maven, or action is unavailable. - Since:
- 2.157
-
createRunConfig
-
cloneRunConfig
-
isCompileOnSaveEnabled
public static boolean isCompileOnSaveEnabled(org.netbeans.api.project.Project prj) -
isCompileOnSaveEnabled
-
hasApplicationCompileOnSaveEnabled
@Deprecated public static boolean hasApplicationCompileOnSaveEnabled(org.netbeans.api.project.Project prj) Deprecated.- Parameters:
prj
-- Returns:
- true if compile on save is allowed for running the application.
-
hasApplicationCompileOnSaveEnabled
Deprecated.- Parameters:
config
-- Returns:
- true if compile on save is allowed for running the application.
-
hasTestCompileOnSaveEnabled
Deprecated.- Parameters:
prj
-- Returns:
- true if compile on save is allowed for running tests.
-
hasTestCompileOnSaveEnabled
Deprecated.- Parameters:
config
-- Returns:
- true if compile on save is allowed for running tests.
-