@Reference(name="feature",
strategy=EVENT,
policy=DYNAMIC,
referenceInterface=Feature.class,
cardinality=OPTIONAL_MULTIPLE)
public abstract class AbstractProjectOperations
extends Object
implements ProjectOperations
| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.roo.process.manager.FileManager |
fileManager |
protected org.springframework.roo.metadata.MetadataService |
metadataService |
protected PathResolver |
pathResolver |
protected org.springframework.roo.project.PomManagementService |
pomManagementService |
protected org.springframework.roo.shell.Shell |
shell |
| Constructor and Description |
|---|
AbstractProjectOperations() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBuildPlugin(String moduleName,
Plugin plugin)
Attempts to add the specified build plugin.
|
void |
addBuildPlugin(String moduleName,
Plugin plugin,
boolean addToPluginManagement)
Attempts to add the specified build plugin.
|
void |
addBuildPlugins(String moduleName,
Collection<? extends Plugin> newPlugins)
Attempts to add the specified plugins.
|
void |
addBuildPlugins(String moduleName,
Collection<? extends Plugin> newPlugins,
boolean addToPluginManagement)
Attempts to add the specified plugins.
|
List<Dependency> |
addDependencies(String moduleName,
Collection<? extends Dependency> newDependencies)
Attempts to add the specified dependencies.
|
List<Dependency> |
addDependencies(String moduleName,
Collection<? extends Dependency> newDependencies,
boolean addToDependencyManagement,
boolean checkFullDependency)
Attempts to add the specified dependencies.
|
Dependency |
addDependency(String moduleName,
Dependency dependency)
Attempts to add the specified dependency.
|
Dependency |
addDependency(String moduleName,
Dependency dependency,
boolean addToDependencyManagement)
Attempts to add the specified dependency.
|
Dependency |
addDependency(String moduleName,
Dependency dependency,
boolean addToDependencyManagement,
boolean checkFullDependency)
Attempts to add the specified dependency.
|
Dependency |
addDependency(String moduleName,
String groupId,
String artifactId,
String version)
Allows addition of a JAR dependency to the POM.
|
Dependency |
addDependency(String moduleName,
String groupId,
String artifactId,
String version,
boolean addToDependencyManagement)
Allows addition of a JAR dependency to the POM.
|
Dependency |
addDependency(String moduleName,
String groupId,
String artifactId,
String version,
DependencyScope scope)
Allows addition of a JAR dependency to the POM.
|
Dependency |
addDependency(String moduleName,
String groupId,
String artifactId,
String version,
DependencyScope scope,
boolean addToDependencyManagement)
Allows addition of a JAR dependency to the POM.
|
Dependency |
addDependency(String moduleName,
String groupId,
String artifactId,
String version,
DependencyScope scope,
String classifier)
Allows addition of a JAR dependency to the POM.
|
Dependency |
addDependency(String moduleName,
String groupId,
String artifactId,
String version,
DependencyScope scope,
String classifier,
boolean addToDependencyManagement)
Allows addition of a JAR dependency to the POM.
|
void |
addElementToPluginExecution(String moduleName,
Plugin plugin,
String executionId,
String parentElementName,
String elementName,
Map<String,String> elementValues)
Attempts to add the specified element into the specified plugin execution.
|
void |
addElementToPluginExecution(String moduleName,
Plugin plugin,
String executionId,
String parentElementName,
String elementName,
Map<String,String> elementValues,
boolean addToPluginManagement)
Attempts to add the specified element into the specified plugin execution.
|
void |
addElementToPluginExecution(String moduleName,
Plugin plugin,
String executionId,
String parentElementName,
String elementName,
String elementValue)
Attempts to add the specified element into the specified plugin execution.
|
void |
addElementToPluginExecution(String moduleName,
Plugin plugin,
String executionId,
String parentElementName,
String elementName,
String elementValue,
boolean addToPluginManagement)
Attempts to add the specified element into the specified plugin execution.
|
void |
addFilter(String moduleName,
Filter filter)
Attempts to add the specified filter.
|
void |
addModuleDependency(String moduleToDependUpon)
Adds the given module as a dependency of the currently focused module.
|
void |
addModuleDependency(String moduleName,
String moduleToDependUpon)
Adds to the given module the dependency with a module.
|
void |
addModuleDependency(String moduleName,
String moduleToDependUpon,
boolean testDependency)
Adds to the given module the dependency with a module and with the
possibility of adding it only with test scope and type.
|
void |
addPackageToPluginExecution(String moduleName,
Plugin plugin,
String executionId,
String packageName)
Attempts to add the specified package into the specified plugin execution.
|
void |
addPackageToPluginExecution(String moduleName,
Plugin plugin,
String executionId,
String packageName,
boolean addToPluginManagement)
Attempts to add the specified package into the specified plugin execution.
|
void |
addPluginRepositories(String moduleName,
Collection<? extends Repository> repositories)
Attempts to add the specified plugin repositories.
|
void |
addPluginRepository(String moduleName,
Repository repository)
Attempts to add the specified plugin repository.
|
void |
addProperty(String moduleName,
Property property)
Attempts to add the specified property.
|
void |
addRepositories(String moduleName,
Collection<? extends Repository> repositories)
Attempts to add the specified repositories.
|
void |
addRepository(String moduleName,
Repository repository)
Attempts to add the specified repository.
|
void |
addResource(String moduleName,
Resource resource)
Attempts to add the specified resource.
|
protected void |
bindFeature(Feature feature) |
Pom |
getFocusedModule()
|
String |
getFocusedModuleName()
Returns the name of the currently focussed module.
|
ProjectMetadata |
getFocusedProjectMetadata()
Returns the metadata for the currently focussed module.
|
String |
getFocusedProjectName() |
org.springframework.roo.model.JavaPackage |
getFocusedTopLevelPackage() |
Pom |
getModuleForFileIdentifier(String fileIdentifier)
Returns the module to which the given file belongs
|
Collection<String> |
getModuleNames()
Returns the names of each module in the user's project
|
PathResolver |
getPathResolver()
Convenience method to return the
PathResolver from the project's
ProjectMetadata. |
Pom |
getPomFromModuleName(String moduleName)
Returns the given module's
Pom |
Collection<Pom> |
getPoms()
Returns the
Poms for all modules of the user's project |
ProjectMetadata |
getProjectMetadata(String moduleName)
Returns the
ProjectMetadata for the given module. |
String |
getProjectName(String moduleName) |
org.springframework.roo.model.JavaPackage |
getTopLevelPackage(String moduleName) |
boolean |
isFeatureInstalled(Pom module,
String featureName)
Indicates whether any of the supplied features are installed in the
provided module.
|
boolean |
isFeatureInstalled(String... featureNames)
Indicates whether any of the supplied features are installed in any module of a
project.
|
boolean |
isFeatureInstalled(String featureName)
Indicates whether the supplied feature is installed in any module of a
project.
|
boolean |
isFocusedProjectAvailable()
Indicates whether the module whose name has the focus, if any, is
available.
|
boolean |
isModuleCreationAllowed()
Indicates whether the user can create a new project module
|
boolean |
isModuleFocusAllowed()
Indicates whether the user can change the focused module
|
boolean |
isMultimoduleProject()
Indicates whether the project is multimodule
|
boolean |
isProjectAvailable(String moduleName)
Indicates whether a module with the given name is available.
|
void |
removeBuildPlugin(String moduleName,
Plugin plugin)
Removes any plugins with the same groupId and artifactId as the given
plugin.
|
void |
removeBuildPluginImmediately(String moduleName,
Plugin plugin)
Removes any plugins with the same groupId and artifactId as the given
plugin and immediately writes the pom to the file system.
|
void |
removeBuildPlugins(String moduleName,
Collection<? extends Plugin> plugins)
Removes any plugins with the same groupId and artifactId as any of the
given plugins.
|
void |
removeDependencies(String moduleName,
Collection<? extends Dependency> dependenciesToRemove)
Attempts to remove the specified dependencies.
|
void |
removeDependency(String moduleName,
Dependency dependency)
Attempts to remove the specified dependency.
|
void |
removeDependency(String moduleName,
String groupId,
String artifactId,
String version)
Allows remove of an existing JAR dependency from the POM.
|
void |
removeDependency(String moduleName,
String groupId,
String artifactId,
String version,
String classifier)
Allows remove of an existing JAR dependency from the POM.
|
void |
removeFilter(String moduleName,
Filter filter)
Attempts to remove the specified filter.
|
void |
removePluginRepository(String moduleName,
Repository repository)
Attempts to remove the specified plugin repository.
|
void |
removeProperty(String moduleName,
Property property)
Attempts to remove the specified property dependency.
|
void |
removeRepository(String moduleName,
Repository repository)
Attempts to remove the specified repository.
|
void |
removeResource(String moduleName,
Resource resource)
Attempts to remove the specified resource.
|
void |
setModule(Pom module)
Sets the currently focused module
|
protected void |
unbindFeature(Feature feature) |
void |
updateBuildPlugin(String moduleName,
Plugin plugin)
Verifies if the specified build plugin is present.
|
void |
updateDependencyScope(String moduleName,
Dependency dependency,
DependencyScope dependencyScope)
Attempts to update the scope of the specified dependency.
|
void |
updateProjectType(String moduleName,
ProjectType projectType)
Attempts to update the project packaging type as defined via
ProjectType. |
@Reference(policy=DYNAMIC) protected org.springframework.roo.process.manager.FileManager fileManager
@Reference(policy=DYNAMIC) protected org.springframework.roo.metadata.MetadataService metadataService
@Reference(policy=DYNAMIC) protected PathResolver pathResolver
@Reference(policy=DYNAMIC) protected org.springframework.roo.project.PomManagementService pomManagementService
@Reference(policy=DYNAMIC) protected org.springframework.roo.shell.Shell shell
public void addBuildPlugin(String moduleName, Plugin plugin)
ProjectOperationsProjectMetadata#isBuildPluginRegistered(org.springframework.roo.project.Plugin)
, the method silently returns. Otherwise the plugin is added.
By default, includes the provided plugin into pluginManagement element.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addBuildPlugin in interface ProjectOperationsmoduleName - the name of the module to act upon (required)plugin - the plugin to add (required)public void addBuildPlugin(String moduleName, Plugin plugin, boolean addToPluginManagement)
ProjectOperationsProjectMetadata#isBuildPluginRegistered(org.springframework.roo.project.Plugin)
, the method silently returns. Otherwise the plugin is added.
If addToPluginManagement parameter has true value, the new plugin will be included into pluginManagement element. If false, the provided plugin will be included only as plugin.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addBuildPlugin in interface ProjectOperationsmoduleName - the name of the module to act upon (required)plugin - the plugin to add (required)addToPluginManagement - boolean that indicates if the new Plugin
should be included into pluginManagement element or not.public void addBuildPlugins(String moduleName, Collection<? extends Plugin> newPlugins)
ProjectOperationsProjectMetadata#isAllPluginRegistered(Plugin), the
method silently returns. Otherwise each new dependency is added.
By default, includes the provided plugin into pluginManagement element.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addBuildPlugins in interface ProjectOperationsmoduleName - the name of the module to act upon (required)newPlugins - the plugins to add (required)public void addBuildPlugins(String moduleName, Collection<? extends Plugin> newPlugins, boolean addToPluginManagement)
ProjectOperationsProjectMetadata#isAllPluginRegistered(Plugin), the
method silently returns. Otherwise each new dependency is added.
If addToPluginManagement parameter has true value, the new plugin will be included into pluginManagement element. If false, the provided plugin will be included only as plugin.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addBuildPlugins in interface ProjectOperationsmoduleName - the name of the module to act upon (required)newPlugins - the plugins to add (required)addToPluginManagement - boolean that indicates if the new Plugin
should be included into pluginManagement element or not.public List<Dependency> addDependencies(String moduleName, Collection<? extends Dependency> newDependencies)
ProjectOperationsProjectMetadata#isAllDependencyRegistered(Dependency), the method
silently returns. Otherwise each new dependency is added.
By default, includes the provided dependencies into dependencyManagement element.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addDependencies in interface ProjectOperationsmoduleName - the name of the module to act upon (required)newDependencies - the dependencies to add (required)public List<Dependency> addDependencies(String moduleName, Collection<? extends Dependency> newDependencies, boolean addToDependencyManagement, boolean checkFullDependency)
ProjectOperationsProjectMetadata#isAllDependencyRegistered(Dependency), the method
silently returns. Otherwise each new dependency is added.
If addToDependencyManagement parameter has true value, the new dependency will be included into dependencyManagement element. If false, the provided dependency will be included only as dependency.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addDependencies in interface ProjectOperationsmoduleName - the name of the module to act upon (required)newDependencies - the dependencies to add (required)addToDependencyManagement - boolean that indicates if the new Dependency
should be included into dependencyManagement element or not.checkFullDependency - whether should check the existence with full
dependency element or only compare 'artifactId' and 'groupId'.public Dependency addDependency(String moduleName, Dependency dependency)
ProjectOperationsProjectMetadata#isDependencyRegistered(org.springframework.roo.project.Dependency)
, the method silently returns. Otherwise the dependency is added.
By default, includes the provided dependency into dependencyManagement element.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addDependency in interface ProjectOperationsmoduleName - the name of the module to act upon (required)dependency - the dependency to add (required)public Dependency addDependency(String moduleName, Dependency dependency, boolean addToDependencyManagement)
ProjectOperationsProjectMetadata#isDependencyRegistered(org.springframework.roo.project.Dependency)
, the method silently returns. Otherwise the dependency is added.
If addToDependencyManagement parameter has true value, the new dependency will be included into dependencyManagement element. If false, the provided dependency will be included only as dependency.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addDependency in interface ProjectOperationsmoduleName - the name of the module to act upon (required)dependency - the dependency to add (required)addToDependencyManagement - boolean that indicates if the new Dependency
should be included into dependencyManagement element or not.public Dependency addDependency(String moduleName, Dependency dependency, boolean addToDependencyManagement, boolean checkFullDependency)
ProjectOperationsProjectMetadata#isDependencyRegistered(org.springframework.roo.project.Dependency)
, the method silently returns. Otherwise the dependency is added.
If addToDependencyManagement parameter has true value, the new dependency will be included into dependencyManagement element. If false, the provided dependency will be included only as dependency.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addDependency in interface ProjectOperationsmoduleName - the name of the module to act upon (required)dependency - the dependency to add (required)addToDependencyManagement - boolean that indicates if the new Dependency
should be included into dependencyManagement element or not.checkFullDependency - whether should check the existence with full
dependency element or only compare 'artifactId' and 'groupId'.public final Dependency addDependency(String moduleName, String groupId, String artifactId, String version)
ProjectOperationsProvides a convenient way for third parties to instruct end users how to use the CLI to add support for their projects without requiring the user to manually edit a pom.xml or write an add-on.
By default, includes the provided dependency into dependencyManagement element.
addDependency in interface ProjectOperationsmoduleName - the name of the module to act upon (required)groupId - the group id of the dependency (required)artifactId - the artifact id of the dependency (required)version - the version of the dependency (required)public final Dependency addDependency(String moduleName, String groupId, String artifactId, String version, boolean addToDependencyManagement)
ProjectOperationsProvides a convenient way for third parties to instruct end users how to use the CLI to add support for their projects without requiring the user to manually edit a pom.xml or write an add-on.
If addToDependencyManagement parameter has true value, the new dependency will be included into dependencyManagement element. If false, the provided dependency will be included only as dependency.
addDependency in interface ProjectOperationsmoduleName - the name of the module to act upon (required)groupId - the group id of the dependency (required)artifactId - the artifact id of the dependency (required)version - the version of the dependency (required)addToDependencyManagement - boolean that indicates if the new Dependency
should be included into dependencyManagement element or not.public final Dependency addDependency(String moduleName, String groupId, String artifactId, String version, DependencyScope scope)
ProjectOperationsProvides a convenient way for third parties to instruct end users how to use the CLI to add support for their projects without requiring the user to manually edit a pom.xml or write an add-on.
By default, includes the provided dependency into dependencyManagement element.
addDependency in interface ProjectOperationsmoduleName - the name of the module to act upon (required)groupId - the group id of the dependency (required)artifactId - the artifact id of the dependency (required)version - the version of the dependency (required)scope - the scope of the dependencypublic final Dependency addDependency(String moduleName, String groupId, String artifactId, String version, DependencyScope scope, boolean addToDependencyManagement)
ProjectOperationsProvides a convenient way for third parties to instruct end users how to use the CLI to add support for their projects without requiring the user to manually edit a pom.xml or write an add-on.
If addToDependencyManagement parameter has true value, the new dependency will be included into dependencyManagement element. If false, the provided dependency will be included only as dependency.
addDependency in interface ProjectOperationsmoduleName - the name of the module to act upon (required)groupId - the group id of the dependency (required)artifactId - the artifact id of the dependency (required)version - the version of the dependency (required)scope - the scope of the dependencyaddToDependencyManagement - boolean that indicates if the new Dependency
should be included into dependencyManagement element or not.public final Dependency addDependency(String moduleName, String groupId, String artifactId, String version, DependencyScope scope, String classifier)
ProjectOperationsProvides a convenient way for third parties to instruct end users how to use the CLI to add support for their projects without requiring the user to manually edit a pom.xml or write an add-on.
By default, includes the provided dependency into dependencyManagement element.
addDependency in interface ProjectOperationsmoduleName - the name of the module to act upon (required)groupId - the group id of the dependency (required)artifactId - the artifact id of the dependency (required)version - the version of the dependency (required)scope - the scope of the dependencyclassifier - the classifier of the dependencypublic final Dependency addDependency(String moduleName, String groupId, String artifactId, String version, DependencyScope scope, String classifier, boolean addToDependencyManagement)
ProjectOperationsProvides a convenient way for third parties to instruct end users how to use the CLI to add support for their projects without requiring the user to manually edit a pom.xml or write an add-on.
If addToDependencyManagement parameter has true value, the new dependency will be included into dependencyManagement element. If false, the provided dependency will be included only as dependency.
addDependency in interface ProjectOperationsmoduleName - the name of the module to act upon (required)groupId - the group id of the dependency (required)artifactId - the artifact id of the dependency (required)version - the version of the dependency (required)scope - the scope of the dependencyclassifier - the classifier of the dependencyaddToDependencyManagement - boolean that indicates if the new Dependency
should be included into dependencyManagement element or not.public void addFilter(String moduleName, Filter filter)
ProjectOperationsProjectMetadata#isFilterRegistered(org.springframework.roo.project.Filter)
, the method silently returns. Otherwise the filter is added.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addFilter in interface ProjectOperationsmoduleName - the name of the module to act upon (required)filter - the filter to add (required)public void addPackageToPluginExecution(String moduleName, Plugin plugin, String executionId, String packageName)
ProjectOperationsBy default, includes the provided package into pluginManagement element.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addPackageToPluginExecution in interface ProjectOperationsmoduleName - the name of the module to act upon (required)plugin - the plugin where add the package (required)executionId - the id of the plugin execution where add the package (required)packageName - the package to add (required)public void addPackageToPluginExecution(String moduleName, Plugin plugin, String executionId, String packageName, boolean addToPluginManagement)
ProjectOperationsIf addToPluginManagement parameter has true value, the new plugin will be included into pluginManagement element. If false, the provided plugin will be included only as plugin.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addPackageToPluginExecution in interface ProjectOperationsmoduleName - the name of the module to act upon (required)plugin - the plugin where add the package (required)executionId - the id of the plugin execution where add the package (required)packageName - the package to add (required)addToPluginManagement - boolean that indicates if the new Plugin
should be included into pluginManagement element or not.public void addElementToPluginExecution(String moduleName, Plugin plugin, String executionId, String parentElementName, String elementName, String elementValue)
ProjectOperationsBy default, includes the provided element into pluginManagement element.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addElementToPluginExecution in interface ProjectOperationsmoduleName - the name of the module to act upon (required)plugin - the plugin where add the package (required)executionId - the id of the plugin execution where add the package (required)parentElementName - the parentElement name that should be included inside configuration elementelementName - the element name that should be included inside the parentElementName provided beforeelementValue - the value to add (required)public void addElementToPluginExecution(String moduleName, Plugin plugin, String executionId, String parentElementName, String elementName, String elementValue, boolean addToPluginManagement)
ProjectOperationsBy default, includes the provided element into pluginManagement element.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addElementToPluginExecution in interface ProjectOperationsmoduleName - the name of the module to act upon (required)plugin - the plugin where add the package (required)executionId - the id of the plugin execution where add the package (required)parentElementName - the parentElement name that should be included inside configuration elementelementName - the element name that should be included inside the parentElementName provided beforeelementValue - the value to add (required)addToPluginManagement - boolean that indicates if the new element
should be included into pluginManagement element or not.public void addElementToPluginExecution(String moduleName, Plugin plugin, String executionId, String parentElementName, String elementName, Map<String,String> elementValues)
ProjectOperationsBy default, includes the provided element into pluginManagement element.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addElementToPluginExecution in interface ProjectOperationsmoduleName - the name of the module to act upon (required)plugin - the plugin where add the package (required)executionId - the id of the plugin execution where add the package (required)parentElementName - the parentElement name that should be included inside configuration elementelementName - the element name that should be included inside the parentElementName provided beforeelementValues - the values to add (required)public void addElementToPluginExecution(String moduleName, Plugin plugin, String executionId, String parentElementName, String elementName, Map<String,String> elementValues, boolean addToPluginManagement)
ProjectOperationsBy default, includes the provided element into pluginManagement element.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addElementToPluginExecution in interface ProjectOperationsmoduleName - the name of the module to act upon (required)plugin - the plugin where add the package (required)executionId - the id of the plugin execution where add the package (required)parentElementName - the parentElement name that should be included inside configuration elementelementName - the element name that should be included inside the parentElementName provided beforeelementValues - the values to add (required)addToPluginManagement - boolean that indicates if the new element
should be included into pluginManagement element or not.public void addModuleDependency(String moduleToDependUpon)
ProjectOperationsaddModuleDependency in interface ProjectOperationsmoduleToDependUpon - the name of the module to act upon (required)public void addModuleDependency(String moduleName, String moduleToDependUpon)
ProjectOperationsaddModuleDependency in interface ProjectOperationsmoduleName - the name of the module where to install the dependency (required)moduleToDependUpon - the name of the module to act upon (required)public void addModuleDependency(String moduleName, String moduleToDependUpon, boolean testDependency)
ProjectOperationsaddModuleDependency in interface ProjectOperationsmoduleName - the name of the module where to install the dependency (required)moduleToDependUpon - the name of the module to act upon (required)testDependency - whether the module dependency should be added with test
scope and as test type dependency.public void addPluginRepositories(String moduleName, Collection<? extends Repository> repositories)
ProjectOperationsProjectMetadata#isPluginRepositoryRegistered(Repository), the
method silently returns. Otherwise each new repository is added.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addPluginRepositories in interface ProjectOperationsmoduleName - the name of the module to act upon (required)repositories - a list of plugin repositories to add (required)public void addPluginRepository(String moduleName, Repository repository)
ProjectOperationsProjectMetadata#isPluginRepositoryRegistered(Repository), the
method silently returns. Otherwise the repository is added.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addPluginRepository in interface ProjectOperationsmoduleName - the name of the module to act upon (required)repository - the plugin repository to add (required)public void addProperty(String moduleName, Property property)
ProjectOperationsProjectMetadata#isPropertyRegistered(org.springframework.roo.project.Property)
, the method silently returns. Otherwise the property is added.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addProperty in interface ProjectOperationsmoduleName - the name of the module to act upon (required)property - the property to add (required)public void addRepositories(String moduleName, Collection<? extends Repository> repositories)
ProjectOperationsProjectMetadata#isRepositoryRegistered(Repository), the method
silently returns. Otherwise each new repository is added.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addRepositories in interface ProjectOperationsmoduleName - the name of the module to act upon (required)repositories - a list of repositories to add (required)public void addRepository(String moduleName, Repository repository)
ProjectOperationsProjectMetadata#isRepositoryRegistered(Repository), the method
silently returns. Otherwise the repository is added.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addRepository in interface ProjectOperationsmoduleName - the name of the module to act upon (required)repository - the repository to add (required)public void addResource(String moduleName, Resource resource)
ProjectOperationsProjectMetadata#isResourceRegistered(Resource), the
method silently returns. Otherwise the resource is added.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
addResource in interface ProjectOperationsmoduleName - the name of the module to act upon (required)resource - the resource to add (required)protected void bindFeature(Feature feature)
public Pom getFocusedModule()
ProjectOperationsgetFocusedModule in interface ProjectOperationsnull if none of the above descriptors existpublic String getFocusedModuleName()
ProjectOperationsgetFocusedModuleName in interface ProjectOperationsFile.separatorpublic ProjectMetadata getFocusedProjectMetadata()
ProjectOperationsgetFocusedProjectMetadata in interface ProjectOperationsnull if no project metadata is availablepublic String getFocusedProjectName()
getFocusedProjectName in interface ProjectOperationspublic org.springframework.roo.model.JavaPackage getFocusedTopLevelPackage()
getFocusedTopLevelPackage in interface ProjectOperationspublic Pom getModuleForFileIdentifier(String fileIdentifier)
ProjectOperationsgetModuleForFileIdentifier in interface ProjectOperationsfileIdentifier - the canonical path to look uppublic Collection<String> getModuleNames()
ProjectOperationsgetModuleNames in interface ProjectOperationsnull listpublic PathResolver getPathResolver()
ProjectOperationsPathResolver from the project's
ProjectMetadata.getPathResolver in interface ProjectOperationsPathResolver, or null if the project is unavailablepublic final Pom getPomFromModuleName(String moduleName)
ProjectOperationsPomgetPomFromModuleName in interface ProjectOperationsmoduleName - the fully-qualified name of the module (required)public Collection<Pom> getPoms()
ProjectOperationsPoms for all modules of the user's projectgetPoms in interface ProjectOperationsnull collectionpublic final ProjectMetadata getProjectMetadata(String moduleName)
ProjectOperationsProjectMetadata for the given module.getProjectMetadata in interface ProjectOperationsmoduleName - the module whose metadata is being requested (can be
empty to signify the root or only module)null if the metadata is not availablepublic String getProjectName(String moduleName)
getProjectName in interface ProjectOperationsmoduleName - the name of the module to act upon (required)public org.springframework.roo.model.JavaPackage getTopLevelPackage(String moduleName)
getTopLevelPackage in interface ProjectOperationsmoduleName - the name of the module to act upon (required)public boolean isFeatureInstalled(String featureName)
ProjectOperationsisFeatureInstalled in interface ProjectOperationsfeatureName - the name of the feature (see FeatureNames for
available features)public boolean isFeatureInstalled(String... featureNames)
ProjectOperationsisFeatureInstalled in interface ProjectOperationsfeatureNames - the names of the features (see FeatureNames
for available features)public boolean isFeatureInstalled(Pom module, String featureName)
ProjectOperationsisFeatureInstalled in interface ProjectOperationsmodule - the Pom where to search the feature.featureName - the names of the feature (see FeatureNames
for available features)public boolean isFocusedProjectAvailable()
ProjectOperationsisFocusedProjectAvailable in interface ProjectOperationspublic boolean isModuleCreationAllowed()
ProjectOperationsisModuleCreationAllowed in interface ProjectOperationspublic boolean isModuleFocusAllowed()
ProjectOperationsisModuleFocusAllowed in interface ProjectOperationspublic boolean isMultimoduleProject()
ProjectOperationsisMultimoduleProject in interface ProjectOperationspublic final boolean isProjectAvailable(String moduleName)
ProjectOperationsisProjectAvailable in interface ProjectOperationsmoduleName - the name of the module to act upon (can be blank)public void removeBuildPlugin(String moduleName, Plugin plugin)
ProjectOperationsremoveBuildPlugin in interface ProjectOperationsmoduleName - the name of the module to act upon (required)plugin - the plugin to remove (can be null)public void removeBuildPluginImmediately(String moduleName, Plugin plugin)
ProjectOperationsremoveBuildPluginImmediately in interface ProjectOperationsmoduleName - the name of the module to act upon (required)plugin - the plugin to remove (can be null)public void removeBuildPlugins(String moduleName, Collection<? extends Plugin> plugins)
ProjectOperationsremoveBuildPlugins in interface ProjectOperationsmoduleName - the name of the module to act upon (required)plugins - the plugins to remove; can be null, any
null elements will be quietly ignoredpublic void removeDependencies(String moduleName, Collection<? extends Dependency> dependenciesToRemove)
ProjectOperationsProjectMetadata#isDependencyRegistered(Dependency), the method
silently returns. Otherwise each located dependency is removed.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
removeDependencies in interface ProjectOperationsmoduleName - the name of the module to act upon (required)dependenciesToRemove - the dependencies to remove (required)public void removeDependency(String moduleName, Dependency dependency)
ProjectOperationsProjectMetadata#isDependencyRegistered(Dependency), the method
silently returns. Otherwise the located dependency is removed.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
removeDependency in interface ProjectOperationsmoduleName - the name of the module to act upon (required)dependency - the dependency to remove (required)public final void removeDependency(String moduleName, String groupId, String artifactId, String version)
ProjectOperationsProvides a convenient way for third parties to instruct end users how to use the CLI to remove an unwanted dependency from their projects without requiring the user to manually edit a pom.xml or write an add-on.
removeDependency in interface ProjectOperationsmoduleName - the name of the module to act upon (required)groupId - the group id of the dependency (required)artifactId - the artifact id of the dependency (required)version - the version of the dependency (required)public final void removeDependency(String moduleName, String groupId, String artifactId, String version, String classifier)
ProjectOperationsProvides a convenient way for third parties to instruct end users how to use the CLI to remove an unwanted dependency from their projects without requiring the user to manually edit a pom.xml or write an add-on.
removeDependency in interface ProjectOperationsmoduleName - the name of the module to act upon (required)groupId - the group id of the dependency (required)artifactId - the artifact id of the dependency (required)version - the version of the dependency (required)classifier - the classifier of the dependencypublic void removeFilter(String moduleName, Filter filter)
ProjectOperationsProjectMetadata#isFilterRegistered(org.springframework.roo.project.Filter)
, the method silently returns. Otherwise the located filter is removed.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
removeFilter in interface ProjectOperationsmoduleName - the name of the module to act upon (required)filter - the filter to remove (required)public void removePluginRepository(String moduleName, Repository repository)
ProjectOperationsProjectMetadata#isPluginRepositoryRegistered(Repository), the
method silently returns. Otherwise the located plugin repository is
removed.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
removePluginRepository in interface ProjectOperationsmoduleName - the name of the module to act upon (required)repository - the plugin repository to remove (required)public void removeProperty(String moduleName, Property property)
ProjectOperationsProjectMetadata#isPropertyRegistered(Property), the method
silently returns. Otherwise the located dependency is removed.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
removeProperty in interface ProjectOperationsmoduleName - the name of the module to act upon (required)property - the property to remove (required)public void removeRepository(String moduleName, Repository repository)
ProjectOperationsProjectMetadata#isRepositoryRegistered(Repository), the method
silently returns. Otherwise the located repository is removed.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
removeRepository in interface ProjectOperationsmoduleName - the name of the module to act upon (required)repository - the repository to remove (required)public void removeResource(String moduleName, Resource resource)
ProjectOperationsProjectMetadata#isResourceRegistered(Resource), the
method silently returns. Otherwise the located resource is removed.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
removeResource in interface ProjectOperationsmoduleName - the name of the module to act upon (required)resource - the resource to remove (required)public void setModule(Pom module)
ProjectOperationssetModule in interface ProjectOperationsmodule - the module to focus upon (required)protected void unbindFeature(Feature feature)
public void updateBuildPlugin(String moduleName, Plugin plugin)
ProjectOperationsProjectMetadata#getBuildPluginsExcludingVersion(Plugin).
Always adds the presented plugin.updateBuildPlugin in interface ProjectOperationsmoduleName - the name of the module to act upon (required)plugin - the build plugin to update (required)public void updateDependencyScope(String moduleName, Dependency dependency, DependencyScope dependencyScope)
ProjectOperationsProjectMetadata#isDependencyRegistered(Dependency), the method
silently returns. Otherwise the located dependency is updated.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
updateDependencyScope in interface ProjectOperationsmoduleName - the name of the module to act upon (required)dependency - the dependency to update (required)dependencyScope - the dependency scope. May be null, in which case
the public void updateProjectType(String moduleName, ProjectType projectType)
ProjectOperationsProjectType. If the project packaging is not defined it will
create a new definition.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
updateProjectType in interface ProjectOperationsmoduleName - the name of the module to act upon (required)projectType - the project type to update (required)Copyright © 2009–2017 Pivotal Software, Inc.. All rights reserved.