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 IMavenProjectFacade
public org.eclipse.core.runtime.IPath[] getTestResourceLocations()
getTestResourceLocations
in interface IMavenProjectFacade
public org.eclipse.core.runtime.IPath[] getCompileSourceLocations()
getCompileSourceLocations
in interface IMavenProjectFacade
public org.eclipse.core.runtime.IPath[] getTestCompileSourceLocations()
getTestCompileSourceLocations
in interface IMavenProjectFacade
public org.eclipse.core.runtime.IPath getProjectRelativePath(String resourceLocation)
getProjectRelativePath
in interface IMavenProjectFacade
resourceLocation
- absolute file system locationpublic org.eclipse.core.runtime.IPath getOutputLocation()
getOutputLocation
in interface IMavenProjectFacade
public org.eclipse.core.runtime.IPath getTestOutputLocation()
getTestOutputLocation
in interface IMavenProjectFacade
public org.eclipse.core.runtime.IPath getFullPath()
getFullPath
in interface IMavenProjectFacade
public org.apache.maven.project.MavenProject getMavenProject(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
getMavenProject
in interface IMavenProjectFacade
org.eclipse.core.runtime.CoreException
public org.apache.maven.project.MavenProject getMavenProject()
IMavenProjectFacade
null
, 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 IMavenProjectFacade
public String getPackaging()
getPackaging
in interface IMavenProjectFacade
public org.eclipse.core.resources.IProject getProject()
getProject
in interface IMavenProjectFacade
public org.eclipse.core.resources.IFile getPom()
getPom
in interface IMavenProjectFacade
public File getPomFile()
getPomFile
in interface IMavenProjectFacade
public org.eclipse.core.runtime.IPath getFullPath(File file)
getFullPath
in interface IMavenProjectFacade
public List<String> getMavenProjectModules()
getMavenProjectModules
in interface IMavenProjectFacade
public Set<ArtifactRef> getMavenProjectArtifacts()
getMavenProjectArtifacts
in interface IMavenProjectFacade
public ResolverConfiguration getResolverConfiguration()
getResolverConfiguration
in interface IMavenProjectFacade
public boolean isStale()
isStale
in interface IMavenProjectFacade
public ArtifactKey getArtifactKey()
getArtifactKey
in interface IMavenProjectFacade
public void setSessionProperty(String key, Object value)
IMavenProjectFacade
setSessionProperty
in interface IMavenProjectFacade
IMavenProjectFacade.getSessionProperty(String)
public Object getSessionProperty(String key)
getSessionProperty
in interface IMavenProjectFacade
IMavenProjectFacade.setSessionProperty(String, Object)
public Set<ArtifactRepositoryRef> getArtifactRepositoryRefs()
getArtifactRepositoryRefs
in interface IMavenProjectFacade
public Set<ArtifactRepositoryRef> getPluginArtifactRepositoryRefs()
getPluginArtifactRepositoryRefs
in interface IMavenProjectFacade
public String getLifecycleMappingId()
getLifecycleMappingId
in interface IMavenProjectFacade
public void setLifecycleMappingId(String lifecycleMappingId)
public Map<MojoExecutionKey,List<IPluginExecutionMetadata>> getMojoExecutionMapping()
getMojoExecutionMapping
in interface IMavenProjectFacade
public 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
IMavenProjectFacade
getMojoExecution
in interface IMavenProjectFacade
org.eclipse.core.runtime.CoreException
public 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
IMavenProjectFacade
getMojoExecutions
in interface IMavenProjectFacade
org.eclipse.core.runtime.CoreException
public 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.CoreException
Copyright © 2005–2015 Sonatype, Inc.. All rights reserved.