public abstract class StudioAbstractIdeSupportMojo
extends org.apache.maven.plugin.AbstractMojo
implements org.codehaus.plexus.logging.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
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.maven.artifact.resolver.ArtifactCollector |
artifactCollector
Artifact collector, needed to resolve dependencies.
|
protected org.apache.maven.artifact.factory.ArtifactFactory |
artifactFactory
Artifact factory, needed to download source jars for inclusion in classpath.
|
protected org.apache.maven.artifact.metadata.ArtifactMetadataSource |
artifactMetadataSource |
protected org.apache.maven.artifact.resolver.ArtifactResolver |
artifactResolver
Artifact resolver, needed to download source jars for inclusion in classpath.
|
protected boolean |
downloadJavadocs
Enables/disables the downloading of javadoc attachments.
|
protected boolean |
downloadSources
Enables/disables the downloading of source attachments.
|
protected org.apache.maven.project.MavenProject |
executedProject
The currently executed project (can be a reactor project).
|
protected org.apache.maven.artifact.repository.ArtifactRepository |
localRepository
Local maven repository.
|
protected org.codehaus.plexus.logging.Logger |
logger
Plexus logger needed for debugging manual artifact resolution.
|
protected String |
packaging
The project packaging.
|
protected org.apache.maven.project.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.
|
| Constructor and Description |
|---|
StudioAbstractIdeSupportMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.maven.plugin.ide.IdeDependency[] |
doDependencyResolution()
Resolve project dependencies.
|
void |
enableLogging(org.codehaus.plexus.logging.Logger logger) |
void |
execute() |
org.apache.maven.artifact.factory.ArtifactFactory |
getArtifactFactory()
Getter for
artifactFactory. |
org.apache.maven.artifact.metadata.ArtifactMetadataSource |
getArtifactMetadataSource()
Getter for
artifactMetadataSource. |
org.apache.maven.artifact.resolver.ArtifactResolver |
getArtifactResolver()
Getter for
artifactResolver. |
abstract MuleDistributionDataProvider |
getDistributionDataProvider() |
boolean |
getDownloadJavadocs()
Getter for
downloadJavadocs. |
boolean |
getDownloadSources()
Getter for
downloadSources. |
abstract List |
getExcludes() |
org.apache.maven.project.MavenProject |
getExecutedProject()
Getter for
executedProject. |
org.apache.maven.artifact.repository.ArtifactRepository |
getLocalRepository()
Getter for
localRepository. |
org.apache.maven.project.MavenProject |
getProject()
Getter for
project. |
protected Set |
getProjectArtifacts()
Returns the list of project artifacts.
|
abstract String |
getProjectNameForArifact(org.apache.maven.artifact.Artifact artifact)
Find the name of the project as used in eclipse.
|
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. |
protected org.apache.maven.plugin.ide.IdeDependency[] |
getWorkspaceArtefacts() |
protected boolean |
hasToResolveJar(org.apache.maven.artifact.Artifact art)
Checks if jar has to be resolved for the given artifact
|
protected boolean |
isAvailableAsAReactorProject(org.apache.maven.artifact.Artifact artifact)
Utility method that locates a project producing the given artifact.
|
protected boolean |
isResolveDependencies() |
void |
setArtifactFactory(org.apache.maven.artifact.factory.ArtifactFactory artifactFactory)
Setter for
artifactFactory. |
void |
setArtifactMetadataSource(org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource)
Setter for
artifactMetadataSource. |
void |
setArtifactResolver(org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver)
Setter for
artifactResolver. |
void |
setDownloadJavadocs(boolean downloadJavadoc)
Setter for
downloadJavadocs. |
void |
setDownloadSources(boolean downloadSources)
Setter for
downloadSources. |
void |
setExecutedProject(org.apache.maven.project.MavenProject executedProject)
Setter for
executedProject. |
void |
setLocalRepository(org.apache.maven.artifact.repository.ArtifactRepository localRepository)
Setter for
localRepository. |
void |
setProject(org.apache.maven.project.MavenProject project)
Setter for
project. |
void |
setReactorProjects(List reactorProjects)
Setter for
reactorProjects. |
void |
setRemoteArtifactRepositories(List remoteArtifactRepositories)
Setter for
remoteArtifactRepositories. |
protected void |
setResolveDependencies(boolean resolveDependencies) |
protected abstract boolean |
setup()
Hook for preparation steps before the actual plugin execution.
|
protected boolean |
useProjectReference(org.apache.maven.artifact.Artifact art)
Checks if a projects reference has to be used for the given artifact
|
protected abstract void |
writeConfiguration(org.apache.maven.plugin.ide.IdeDependency[] deps)
Main plugin method where dependencies should be processed in order to generate IDE configuration files.
|
protected org.apache.maven.project.MavenProject project
protected org.apache.maven.project.MavenProject executedProject
protected String packaging
protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
protected org.apache.maven.artifact.resolver.ArtifactCollector artifactCollector
protected org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
protected List remoteArtifactRepositories
protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
protected List reactorProjects
protected boolean downloadSources
true
remote repositories are checked for sources: in order to avoid repeated check for unavailable source archives, a
status cache is mantained into the target dir of the root project. Run mvn:clean or delete the
file mvn-eclipse-cache.properties in order to reset this cache.protected boolean downloadJavadocs
true
remote repositories are checked for javadocs: in order to avoid repeated check for unavailable javadoc archives,
a status cache is mantained into the target dir of the root project. Run mvn:clean or delete the
file mvn-eclipse-cache.properties in order to reset this cache.protected org.codehaus.plexus.logging.Logger logger
public org.apache.maven.artifact.metadata.ArtifactMetadataSource getArtifactMetadataSource()
artifactMetadataSource.public void setArtifactMetadataSource(org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource)
artifactMetadataSource.artifactMetadataSource - The artifactMetadataSource to set.public org.apache.maven.project.MavenProject getProject()
project.public void setProject(org.apache.maven.project.MavenProject project)
project.project - The project to set.public List getReactorProjects()
reactorProjects.public void setReactorProjects(List reactorProjects)
reactorProjects.reactorProjects - The reactorProjects to set.public List getRemoteArtifactRepositories()
remoteArtifactRepositories.public void setRemoteArtifactRepositories(List remoteArtifactRepositories)
remoteArtifactRepositories.remoteArtifactRepositories - The remoteArtifactRepositories to set.public org.apache.maven.artifact.factory.ArtifactFactory getArtifactFactory()
artifactFactory.public void setArtifactFactory(org.apache.maven.artifact.factory.ArtifactFactory artifactFactory)
artifactFactory.artifactFactory - The artifactFactory to set.public org.apache.maven.artifact.resolver.ArtifactResolver getArtifactResolver()
artifactResolver.public void setArtifactResolver(org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver)
artifactResolver.artifactResolver - The artifactResolver to set.public org.apache.maven.project.MavenProject getExecutedProject()
executedProject.public void setExecutedProject(org.apache.maven.project.MavenProject executedProject)
executedProject.executedProject - The executedProject to set.public org.apache.maven.artifact.repository.ArtifactRepository getLocalRepository()
localRepository.public void setLocalRepository(org.apache.maven.artifact.repository.ArtifactRepository localRepository)
localRepository.localRepository - The localRepository to set.public boolean getDownloadJavadocs()
downloadJavadocs.public void setDownloadJavadocs(boolean downloadJavadoc)
downloadJavadocs.downloadJavadocs - The downloadJavadocs to set.public boolean getDownloadSources()
downloadSources.public void setDownloadSources(boolean downloadSources)
downloadSources.downloadSources - The downloadSources to set.protected void setResolveDependencies(boolean resolveDependencies)
protected boolean isResolveDependencies()
protected abstract boolean getUseProjectReferences()
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.true if referenced project will be linked and not need artifact resolutionprotected abstract boolean setup()
throws org.apache.maven.plugin.MojoExecutionException
true if execution should continue or false if not.org.apache.maven.plugin.MojoExecutionException - generic mojo exceptionprotected abstract void writeConfiguration(org.apache.maven.plugin.ide.IdeDependency[] deps)
throws org.apache.maven.plugin.MojoExecutionException
deps - list of IdeDependency objects, with artifacts, sources and javadocs already resolvedorg.apache.maven.plugin.MojoExecutionException - generic mojo exceptionpublic void enableLogging(org.codehaus.plexus.logging.Logger logger)
enableLogging in interface org.codehaus.plexus.logging.LogEnabledLogEnabled.enableLogging(org.codehaus.plexus.logging.Logger)public final void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
execute in interface org.apache.maven.plugin.Mojoorg.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionMojo.execute()protected org.apache.maven.plugin.ide.IdeDependency[] doDependencyResolution()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException - if dependencies can't be resolvedpublic abstract String getProjectNameForArifact(org.apache.maven.artifact.Artifact artifact)
artifact - The artifact to find the eclipse name for.protected Set getProjectArtifacts() throws org.apache.maven.plugin.MojoExecutionException
resolved property set to true.org.apache.maven.plugin.MojoExecutionException - if unable to parse dependency versionsprotected boolean isAvailableAsAReactorProject(org.apache.maven.artifact.Artifact artifact)
artifact - the artifact a project should produce.true if the artifact is produced by a reactor projectart.protected org.apache.maven.plugin.ide.IdeDependency[] getWorkspaceArtefacts()
public abstract List getExcludes()
protected boolean hasToResolveJar(org.apache.maven.artifact.Artifact art)
art - the artifact to checkprotected boolean useProjectReference(org.apache.maven.artifact.Artifact art)
art - the artifact to checkpublic abstract MuleDistributionDataProvider getDistributionDataProvider()
Copyright © 2016. All Rights Reserved.