org.apache.maven.plugin.ide
public abstract class AbstractIdeSupportMojo extends AbstractMojo implements LogEnabled
setup()
and
writeConfiguration()
methods, plus the getters needed to get the various
configuration flags and required components. The lifecycle:
*** calls setup() where you can configure your specific stuff and stop the mojo from execute if appropriate *** - manually resolve project dependencies, NOT failing if a dependency is missing - compute project references (reactor projects) if the getUseProjectReferences() flag is set - download sources/javadocs if the getDownloadSources() flag is set *** calls writeConfiguration(), passing the list of resolved referenced dependencies *** - report the list of missing sources or just tell how to turn this feature on if the flag was disabled
Version: $Id: AbstractIdeSupportMojo.java 392813 2006-04-09 19:42:06Z fgiust $
Field Summary | |
---|---|
protected ArtifactCollector | artifactCollector
Artifact collector, needed to resolve dependencies.
|
protected ArtifactFactory | artifactFactory
Artifact factory, needed to download source jars for inclusion in classpath.
|
protected ArtifactMetadataSource | artifactMetadataSource |
protected ArtifactResolver | artifactResolver
Artifact resolver, needed to download source jars for inclusion in classpath.
|
protected boolean | downloadSources
Enables/disables the downloading of source attachments. |
protected MavenProject | executedProject
The currently executed project (can be a reactor project).
|
protected ArtifactRepository | localRepository
Local maven repository.
|
protected MavenProject | project
The project whose project files to create.
|
protected List | reactorProjects
If the executed project is a reactor project, this will contains the full list of projects in
the reactor.
|
protected List | remoteArtifactRepositories
Remote repositories which will be searched for source attachments.
|
Method Summary | |
---|---|
protected IdeDependency[] | doDependencyResolution()
Resolve project dependencies. |
void | enableLogging(Logger logger) |
void | execute() |
ArtifactFactory | getArtifactFactory()
Getter for artifactFactory . |
ArtifactMetadataSource | getArtifactMetadataSource()
Getter for artifactMetadataSource . |
ArtifactResolver | getArtifactResolver()
Getter for artifactResolver . |
boolean | getDownloadSources()
Getter for downloadSources . |
MavenProject | getExecutedProject()
Getter for executedProject . |
ArtifactRepository | getLocalRepository()
Getter for localRepository . |
MavenProject | getProject()
Getter for project . |
List | getReactorProjects()
Getter for reactorProjects . |
List | getRemoteArtifactRepositories()
Getter for remoteArtifactRepositories . |
protected abstract boolean | getUseProjectReferences()
return false if projects available in a reactor build should be considered normal dependencies,
true if referenced project will be linked and not need artifact resolution. |
void | setArtifactFactory(ArtifactFactory artifactFactory)
Setter for artifactFactory . |
void | setArtifactMetadataSource(ArtifactMetadataSource artifactMetadataSource)
Setter for artifactMetadataSource . |
void | setArtifactResolver(ArtifactResolver artifactResolver)
Setter for artifactResolver . |
void | setDownloadSources(boolean downloadSources)
Setter for downloadSources . |
void | setExecutedProject(MavenProject executedProject)
Setter for executedProject . |
void | setLocalRepository(ArtifactRepository localRepository)
Setter for localRepository . |
void | setProject(MavenProject project)
Setter for project . |
void | setReactorProjects(List reactorProjects)
Setter for reactorProjects . |
void | setRemoteArtifactRepositories(List remoteArtifactRepositories)
Setter for remoteArtifactRepositories . |
protected abstract boolean | setup()
Hook for preparation steps before the actual plugin execution. |
protected abstract void | writeConfiguration(IdeDependency[] deps)
Main plugin method where dependencies should be processed in order to generate IDE configuration files. |
UNKNOWN: role="org.apache.maven.artifact.resolver.ArtifactCollector"
UNKNOWN: role="org.apache.maven.artifact.factory.ArtifactFactory"
UNKNOWN: role="org.apache.maven.artifact.metadata.ArtifactMetadataSource" hint="maven"
UNKNOWN: role="org.apache.maven.artifact.resolver.ArtifactResolver"
UNKNOWN: expression="${downloadSources}"
UNKNOWN: expression="${executedProject}"
UNKNOWN: expression="${localRepository}"
UNKNOWN: expression="${project}"
UNKNOWN: expression="${reactorProjects}"
UNKNOWN: expression="${project.remoteArtifactRepositories}"
Returns: resoved IDE dependencies, with attached jars for non-reactor dependencies
Throws: MojoExecutionException if dependencies can't be resolved
See Also: org.codehaus.plexus.logging.LogEnabled#enableLogging(org.codehaus.plexus.logging.Logger)
See Also: org.apache.maven.plugin.Mojo#execute()
artifactFactory
.Returns: Returns the artifactFactory.
artifactMetadataSource
.Returns: Returns the artifactMetadataSource.
artifactResolver
.Returns: Returns the artifactResolver.
downloadSources
.Returns: Returns the downloadSources.
executedProject
.Returns: Returns the executedProject.
localRepository
.Returns: Returns the localRepository.
project
.Returns: Returns the project.
reactorProjects
.Returns: Returns the reactorProjects.
remoteArtifactRepositories
.Returns: Returns the remoteArtifactRepositories.
false
if projects available in a reactor build should be considered normal dependencies,
true
if referenced project will be linked and not need artifact resolution.Returns: true
if referenced project will be linked and not need artifact resolution
artifactFactory
.Parameters: artifactFactory The artifactFactory to set.
artifactMetadataSource
.Parameters: artifactMetadataSource The artifactMetadataSource to set.
artifactResolver
.Parameters: artifactResolver The artifactResolver to set.
downloadSources
.Parameters: downloadSources The downloadSources to set.
executedProject
.Parameters: executedProject The executedProject to set.
localRepository
.Parameters: localRepository The localRepository to set.
project
.Parameters: project The project to set.
reactorProjects
.Parameters: reactorProjects The reactorProjects to set.
remoteArtifactRepositories
.Parameters: remoteArtifactRepositories The remoteArtifactRepositories to set.
Returns: true
if execution should continue or false
if not.
Throws: MojoExecutionException generic mojo exception
Parameters: deps list of IdeDependency
objects, with artifacts, sources and javadocs already resolved
Throws: MojoExecutionException generic mojo exception