public abstract class AbstractProjectConfigurator extends Object implements org.eclipse.core.runtime.IExecutableExtension, IMavenProjectChangedListener
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_CLASS |
static String |
ATTR_ID |
static String |
ATTR_NAME |
protected IMavenMarkerManager |
markerManager |
protected IMaven |
maven |
protected IMavenConfiguration |
mavenConfiguration |
protected IMavenProjectRegistry |
projectManager |
Constructor and Description |
---|
AbstractProjectConfigurator() |
Modifier and Type | Method and Description |
---|---|
static void |
addNature(org.eclipse.core.resources.IProject project,
String natureId,
int updateFlags,
org.eclipse.core.runtime.IProgressMonitor monitor) |
static void |
addNature(org.eclipse.core.resources.IProject project,
String natureId,
org.eclipse.core.runtime.IProgressMonitor monitor) |
protected void |
assertHasNature(org.eclipse.core.resources.IProject project,
String natureId) |
abstract void |
configure(ProjectConfigurationRequest request,
org.eclipse.core.runtime.IProgressMonitor monitor)
Configures Eclipse project passed in ProjectConfigurationRequest, using information from Maven project and other
configuration request parameters
|
boolean |
equals(Object obj) |
AbstractBuildParticipant |
getBuildParticipant(IMavenProjectFacade projectFacade,
org.apache.maven.plugin.MojoExecution execution,
IPluginExecutionMetadata executionMetadata) |
static Map<String,Set<MojoExecutionKey>> |
getConfiguratorExecutions(IMavenProjectFacade projectFacade) |
String |
getId() |
protected List<org.apache.maven.plugin.MojoExecution> |
getMojoExecutions(ProjectConfigurationRequest request,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns list of MojoExecutions this configurator is enabled for.
|
String |
getName() |
protected <T> T |
getParameterValue(org.apache.maven.project.MavenProject project,
String parameter,
Class<T> asType,
org.apache.maven.plugin.MojoExecution mojoExecution,
org.eclipse.core.runtime.IProgressMonitor monitor) |
protected <T> T |
getParameterValue(String parameter,
Class<T> asType,
org.apache.maven.execution.MavenSession session,
org.apache.maven.plugin.MojoExecution mojoExecution)
Deprecated.
this method does not properly join
IMavenExecutionContext , use
#getMojoParameterValue(String, Class, Plugin, ConfigurationContainer, String) instead. |
boolean |
hasConfigurationChanged(IMavenProjectFacade newFacade,
ILifecycleMappingConfiguration oldProjectConfiguration,
MojoExecutionKey key,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns true if project configuration has changed and running
configure(ProjectConfigurationRequest, IProgressMonitor) is required. |
int |
hashCode() |
void |
mavenProjectChanged(MavenProjectChangedEvent[] events,
org.eclipse.core.runtime.IProgressMonitor monitor)
This method is called while holding workspace lock.
|
void |
mavenProjectChanged(MavenProjectChangedEvent event,
org.eclipse.core.runtime.IProgressMonitor monitor)
Updates project configuration according project changes.
|
void |
setInitializationData(org.eclipse.core.runtime.IConfigurationElement config,
String propertyName,
Object data) |
void |
setMarkerManager(IMavenMarkerManager markerManager) |
void |
setMavenConfiguration(IMavenConfiguration mavenConfiguration) |
void |
setProjectManager(IMavenProjectRegistry projectManager) |
String |
toString() |
void |
unconfigure(ProjectConfigurationRequest request,
org.eclipse.core.runtime.IProgressMonitor monitor)
Removes Maven specific configuration from the project passed in ProjectConfigurationRequest
|
public static final String ATTR_ID
public static final String ATTR_NAME
public static final String ATTR_CLASS
protected IMavenProjectRegistry projectManager
protected IMavenConfiguration mavenConfiguration
protected IMavenMarkerManager markerManager
protected IMaven maven
public void setProjectManager(IMavenProjectRegistry projectManager)
public void setMavenConfiguration(IMavenConfiguration mavenConfiguration)
public void setMarkerManager(IMavenMarkerManager markerManager)
public abstract void configure(ProjectConfigurationRequest request, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
Should be implemented by subclass
request
- a project configuration requestmonitor
- a progress monitororg.eclipse.core.runtime.CoreException
public void unconfigure(ProjectConfigurationRequest request, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
request
- a project un-configuration requestmonitor
- a progress monitororg.eclipse.core.runtime.CoreException
public void mavenProjectChanged(MavenProjectChangedEvent event, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
Can be overwritten by subclass
event
- a project change eventmonitor
- a progress monitororg.eclipse.core.runtime.CoreException
public final void mavenProjectChanged(MavenProjectChangedEvent[] events, org.eclipse.core.runtime.IProgressMonitor monitor)
IMavenProjectChangedListener
mavenProjectChanged
in interface IMavenProjectChangedListener
public String getId()
public String getName()
public void setInitializationData(org.eclipse.core.runtime.IConfigurationElement config, String propertyName, Object data)
setInitializationData
in interface org.eclipse.core.runtime.IExecutableExtension
public static void addNature(org.eclipse.core.resources.IProject project, String natureId, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public static void addNature(org.eclipse.core.resources.IProject project, String natureId, int updateFlags, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
protected <T> T getParameterValue(String parameter, Class<T> asType, org.apache.maven.execution.MavenSession session, org.apache.maven.plugin.MojoExecution mojoExecution) throws org.eclipse.core.runtime.CoreException
IMavenExecutionContext
, use
#getMojoParameterValue(String, Class, Plugin, ConfigurationContainer, String)
instead.org.eclipse.core.runtime.CoreException
protected <T> T getParameterValue(org.apache.maven.project.MavenProject project, String parameter, Class<T> asType, org.apache.maven.plugin.MojoExecution mojoExecution, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
protected void assertHasNature(org.eclipse.core.resources.IProject project, String natureId) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public AbstractBuildParticipant getBuildParticipant(IMavenProjectFacade projectFacade, org.apache.maven.plugin.MojoExecution execution, IPluginExecutionMetadata executionMetadata)
protected List<org.apache.maven.plugin.MojoExecution> getMojoExecutions(ProjectConfigurationRequest request, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public static Map<String,Set<MojoExecutionKey>> getConfiguratorExecutions(IMavenProjectFacade projectFacade)
public boolean hasConfigurationChanged(IMavenProjectFacade newFacade, ILifecycleMappingConfiguration oldProjectConfiguration, MojoExecutionKey key, org.eclipse.core.runtime.IProgressMonitor monitor)
configure(ProjectConfigurationRequest, IProgressMonitor)
is required. Default implementation uses
Xpp3Dom.equals(Object)
to compare before/after mojo configuration.Copyright © 2005–2015 Sonatype, Inc.. All rights reserved.