public class MavenProjectFacade extends Object implements IMavenProjectFacade, Serializable
| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_CONFIGURATORS |
static String |
PROP_LIFECYCLE_MAPPING |
| Constructor and Description |
|---|
MavenProjectFacade(MavenProjectFacade other)
Copy constructor.
|
MavenProjectFacade(ProjectRegistryManager manager,
org.eclipse.core.resources.IFile pom,
org.apache.maven.project.MavenProject mavenProject,
ResolverConfiguration resolverConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
ArtifactKey |
getArtifactKey() |
Set<ArtifactRepositoryRef> |
getArtifactRepositoryRefs() |
org.eclipse.core.runtime.IPath[] |
getCompileSourceLocations() |
List<org.apache.maven.plugin.MojoExecution> |
getExecutionPlan(String lifecycle,
org.eclipse.core.runtime.IProgressMonitor monitor) |
org.eclipse.core.runtime.IPath |
getFullPath() |
org.eclipse.core.runtime.IPath |
getFullPath(File file)
Returns the full, absolute path of the given file relative to the workspace.
|
String |
getLifecycleMappingId() |
org.apache.maven.project.MavenProject |
getMavenProject()
Returns cached MavenProject instance associated with this facade or
null, if the cache has not been
populated yet, for example right after workspace restart. |
org.apache.maven.project.MavenProject |
getMavenProject(org.eclipse.core.runtime.IProgressMonitor monitor)
Lazy load and cache MavenProject instance
|
Set<ArtifactRef> |
getMavenProjectArtifacts() |
List<String> |
getMavenProjectModules() |
org.apache.maven.plugin.MojoExecution |
getMojoExecution(MojoExecutionKey mojoExecutionKey,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns fully setup MojoExecution instance bound to project build lifecycle that matches provided mojoExecutionKey.
|
Map<MojoExecutionKey,List<IPluginExecutionMetadata>> |
getMojoExecutionMapping() |
List<org.apache.maven.plugin.MojoExecution> |
getMojoExecutions()
Returns cached list of MojoExecutions bound to project's clean, default and site lifecycles.
|
List<org.apache.maven.plugin.MojoExecution> |
getMojoExecutions(org.eclipse.core.runtime.IProgressMonitor monitor)
Returns list of MojoExecutions bound to project's clean, default and site lifecycles.
|
List<org.apache.maven.plugin.MojoExecution> |
getMojoExecutions(String groupId,
String artifactId,
org.eclipse.core.runtime.IProgressMonitor monitor,
String... goals)
Returns list of fully setup MojoExecution instances bound to project build lifecycle that matche provided groupId,
artifactId and (vararg) goals.
|
org.eclipse.core.runtime.IPath |
getOutputLocation()
Returns the full, absolute path of this project maven build output directory relative to the workspace or null if
maven build output directory cannot be determined or outside of the workspace.
|
String |
getPackaging() |
Set<ArtifactRepositoryRef> |
getPluginArtifactRepositoryRefs() |
org.eclipse.core.resources.IFile |
getPom() |
File |
getPomFile() |
org.eclipse.core.resources.IProject |
getProject() |
org.eclipse.core.runtime.IPath |
getProjectRelativePath(String resourceLocation)
Returns project resource for given file system location or null the location is outside of project.
|
ResolverConfiguration |
getResolverConfiguration() |
org.eclipse.core.runtime.IPath[] |
getResourceLocations()
Returns project relative paths of resource directories
|
Object |
getSessionProperty(String key) |
org.eclipse.core.runtime.IPath[] |
getTestCompileSourceLocations() |
org.eclipse.core.runtime.IPath |
getTestOutputLocation()
Returns the full, absolute path of this project maven build test output directory relative to the workspace or null
if maven build output directory cannot be determined or outside of the workspace.
|
org.eclipse.core.runtime.IPath[] |
getTestResourceLocations()
Returns project relative paths of test resource directories
|
boolean |
isStale() |
void |
setLifecycleMappingId(String lifecycleMappingId) |
void |
setMojoExecutionMapping(Map<MojoExecutionKey,List<IPluginExecutionMetadata>> mojoExecutionMapping) |
void |
setSessionProperty(String key,
Object value)
Associates the value with the key in session (i.e.
|
String |
toString() |
public static final String PROP_LIFECYCLE_MAPPING
public static final String PROP_CONFIGURATORS
public MavenProjectFacade(ProjectRegistryManager manager, org.eclipse.core.resources.IFile pom, org.apache.maven.project.MavenProject mavenProject, ResolverConfiguration resolverConfiguration)
public MavenProjectFacade(MavenProjectFacade other)
public org.eclipse.core.runtime.IPath[] getResourceLocations()
getResourceLocations in interface IMavenProjectFacadepublic org.eclipse.core.runtime.IPath[] getTestResourceLocations()
getTestResourceLocations in interface IMavenProjectFacadepublic org.eclipse.core.runtime.IPath[] getCompileSourceLocations()
getCompileSourceLocations in interface IMavenProjectFacadepublic org.eclipse.core.runtime.IPath[] getTestCompileSourceLocations()
getTestCompileSourceLocations in interface IMavenProjectFacadepublic org.eclipse.core.runtime.IPath getProjectRelativePath(String resourceLocation)
getProjectRelativePath in interface IMavenProjectFacaderesourceLocation - absolute file system locationpublic org.eclipse.core.runtime.IPath getOutputLocation()
getOutputLocation in interface IMavenProjectFacadepublic org.eclipse.core.runtime.IPath getTestOutputLocation()
getTestOutputLocation in interface IMavenProjectFacadepublic org.eclipse.core.runtime.IPath getFullPath()
getFullPath in interface IMavenProjectFacadepublic org.apache.maven.project.MavenProject getMavenProject(org.eclipse.core.runtime.IProgressMonitor monitor)
throws org.eclipse.core.runtime.CoreException
getMavenProject in interface IMavenProjectFacadeorg.eclipse.core.runtime.CoreExceptionpublic org.apache.maven.project.MavenProject getMavenProject()
IMavenProjectFacadenull, if the cache has not been
populated yet, for example right after workspace restart. Clients must use
IMavenProjectFacade.getMavenProject(IProgressMonitor) unless they are prepared to deal with null return value.getMavenProject in interface IMavenProjectFacadepublic String getPackaging()
getPackaging in interface IMavenProjectFacadepublic org.eclipse.core.resources.IProject getProject()
getProject in interface IMavenProjectFacadepublic org.eclipse.core.resources.IFile getPom()
getPom in interface IMavenProjectFacadepublic File getPomFile()
getPomFile in interface IMavenProjectFacadepublic org.eclipse.core.runtime.IPath getFullPath(File file)
getFullPath in interface IMavenProjectFacadepublic List<String> getMavenProjectModules()
getMavenProjectModules in interface IMavenProjectFacadepublic Set<ArtifactRef> getMavenProjectArtifacts()
getMavenProjectArtifacts in interface IMavenProjectFacadepublic ResolverConfiguration getResolverConfiguration()
getResolverConfiguration in interface IMavenProjectFacadepublic boolean isStale()
isStale in interface IMavenProjectFacadepublic ArtifactKey getArtifactKey()
getArtifactKey in interface IMavenProjectFacadepublic void setSessionProperty(String key, Object value)
IMavenProjectFacadesetSessionProperty in interface IMavenProjectFacadeIMavenProjectFacade.getSessionProperty(String)public Object getSessionProperty(String key)
getSessionProperty in interface IMavenProjectFacadeIMavenProjectFacade.setSessionProperty(String, Object)public Set<ArtifactRepositoryRef> getArtifactRepositoryRefs()
getArtifactRepositoryRefs in interface IMavenProjectFacadepublic Set<ArtifactRepositoryRef> getPluginArtifactRepositoryRefs()
getPluginArtifactRepositoryRefs in interface IMavenProjectFacadepublic String getLifecycleMappingId()
getLifecycleMappingId in interface IMavenProjectFacadepublic void setLifecycleMappingId(String lifecycleMappingId)
public Map<MojoExecutionKey,List<IPluginExecutionMetadata>> getMojoExecutionMapping()
getMojoExecutionMapping in interface IMavenProjectFacadepublic void setMojoExecutionMapping(Map<MojoExecutionKey,List<IPluginExecutionMetadata>> mojoExecutionMapping)
public org.apache.maven.plugin.MojoExecution getMojoExecution(MojoExecutionKey mojoExecutionKey, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
IMavenProjectFacadegetMojoExecution in interface IMavenProjectFacadeorg.eclipse.core.runtime.CoreExceptionpublic List<org.apache.maven.plugin.MojoExecution> getMojoExecutions(String groupId, String artifactId, org.eclipse.core.runtime.IProgressMonitor monitor, String... goals) throws org.eclipse.core.runtime.CoreException
IMavenProjectFacadegetMojoExecutions in interface IMavenProjectFacadeorg.eclipse.core.runtime.CoreExceptionpublic List<org.apache.maven.plugin.MojoExecution> getMojoExecutions()
IMaven.setupMojoExecution(MavenSession, MavenProject, MojoExecution)
is required to execute and/or query mojo parameters. Similarly to getMavenProject(), return value is null
after workspace restart.public List<org.apache.maven.plugin.MojoExecution> getMojoExecutions(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
IMaven.setupMojoExecution(MavenSession, MavenProject, MojoExecution) is required to
execute and/or query mojo parameters.org.eclipse.core.runtime.CoreExceptionCopyright © 2005–2021 Eclipse Foundation. All rights reserved.