org.apache.maven.plugin.eclipse
Class EclipsePlugin

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.ide.AbstractIdeSupportMojo
          extended by org.apache.maven.plugin.eclipse.EclipsePlugin
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.codehaus.plexus.logging.LogEnabled
Direct Known Subclasses:
M2EclipseMojo, RadPlugin

public class EclipsePlugin
extends AbstractIdeSupportMojo

Generates the following eclipse configuration files:

If this goal is run on a multiproject root, dependencies between modules will be configured as direct project dependencies in Eclipse (unless useProjectReferences is set to false).

Version:
$Id: EclipsePlugin.java 551520 2007-06-28 09:56:42Z aheritier $
Author:
Trygve Laugstøl, Fabrizio Giustina

Field Summary
protected static java.lang.String COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER
           
protected static java.lang.String REQUIRED_PLUGINS_CONTAINER
           
static java.lang.String[] WTP_SUPPORTED_VERSIONS
           
 
Fields inherited from class org.apache.maven.plugin.ide.AbstractIdeSupportMojo
artifactCollector, artifactFactory, artifactMetadataSource, artifactResolver, downloadSources, executedProject, localRepository, project, reactorProjects, remoteArtifactRepositories
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
EclipsePlugin()
           
 
Method Summary
 EclipseSourceDir[] buildDirectoryList(org.apache.maven.project.MavenProject project, java.io.File basedir, java.io.File buildOutputDirectory)
           
protected  void checkExtraDeprecations()
           
protected  void convertBuildCommandList(java.util.List commands)
           
protected  EclipseWriterConfig createEclipseWriterConfig(IdeDependency[] deps)
           
protected  void fillDefaultBuilders(java.lang.String packaging)
           
protected  void fillDefaultClasspathContainers(java.lang.String packaging)
           
protected  void fillDefaultNatures(java.lang.String packaging)
           
 java.util.List getAdditionalBuildcommands()
          Getter for additionalBuildcommands.
 java.util.List getAdditionalProjectnatures()
          Getter for additionalProjectnatures.
 java.util.List getBuildcommands()
          Getter for buildcommands.
 java.io.File getBuildOutputDirectory()
          Getter for buildOutputDirectory.
 java.util.List getClasspathContainers()
          Getter for classpathContainers.
 java.io.File getEclipseProjectDir()
          Getter for eclipseProjectDir.
 java.lang.String getProjectNameTemplate()
           
 java.util.List getProjectnatures()
          Getter for projectnatures.
 boolean getUseProjectReferences()
          Getter for useProjectReferences.
 java.lang.String getWtpversion()
          Getter for wtpversion.
 boolean isAddGroupIdToProjectName()
          Getter for addGroupIdToProjectName.
 boolean isAddVersionToProjectName()
          Getter for addVersionToProjectName.
protected  boolean isJavaProject()
           
protected  boolean isPdeProject()
           
 void setAddGroupIdToProjectName(boolean addGroupIdToProjectName)
          Setter for addGroupIdToProjectName.
 void setAdditionalBuildcommands(java.util.List additionalBuildcommands)
          Setter for additionalBuildcommands.
 void setAdditionalProjectnatures(java.util.List additionalProjectnatures)
          Setter for additionalProjectnatures.
 void setAddVersionToProjectName(boolean addVersionToProjectName)
          Setter for addVersionToProjectName.
 void setBuildcommands(java.util.List buildcommands)
          Setter for buildcommands.
 void setBuildOutputDirectory(java.io.File buildOutputDirectory)
          Setter for buildOutputDirectory.
 void setClasspathContainers(java.util.List classpathContainers)
          Setter for classpathContainers.
 void setEclipseProjectDir(java.io.File eclipseProjectDir)
          Setter for eclipseProjectDir.
 void setProjectNameTemplate(java.lang.String projectNameTemplate)
           
 void setProjectnatures(java.util.List projectnatures)
          Setter for projectnatures.
 boolean setup()
          Hook for preparation steps before the actual plugin execution.
protected  void setupExtras()
           
 void setUseProjectReferences(boolean useProjectReferences)
          Setter for useProjectReferences.
 void setWtpversion(java.lang.String wtpversion)
          Setter for wtpversion.
protected  void validateExtras()
           
protected  void verifyClasspathContainerListIsComplete()
           
 void writeConfiguration(IdeDependency[] deps)
          Main plugin method where dependencies should be processed in order to generate IDE configuration files.
protected  void writeExtraConfiguration(EclipseWriterConfig config)
          Write any extra configuration information for the Eclipse project.
 
Methods inherited from class org.apache.maven.plugin.ide.AbstractIdeSupportMojo
doDependencyResolution, enableLogging, execute, getArtifactFactory, getArtifactMetadataSource, getArtifactResolver, getDownloadSources, getExecutedProject, getLocalRepository, getProject, getReactorProjects, getRemoteArtifactRepositories, isResolveDependencies, setArtifactFactory, setArtifactMetadataSource, setArtifactResolver, setDownloadSources, setExecutedProject, setLocalRepository, setProject, setReactorProjects, setRemoteArtifactRepositories, setResolveDependencies
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER

protected static final java.lang.String COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER
See Also:
Constant Field Values

REQUIRED_PLUGINS_CONTAINER

protected static final java.lang.String REQUIRED_PLUGINS_CONTAINER
See Also:
Constant Field Values

WTP_SUPPORTED_VERSIONS

public static final java.lang.String[] WTP_SUPPORTED_VERSIONS
Constructor Detail

EclipsePlugin

public EclipsePlugin()
Method Detail

isJavaProject

protected boolean isJavaProject()

isPdeProject

protected boolean isPdeProject()

getBuildcommands

public java.util.List getBuildcommands()
Getter for buildcommands.

Returns:
Returns the buildcommands.

setBuildcommands

public void setBuildcommands(java.util.List buildcommands)
Setter for buildcommands.

Parameters:
buildcommands - The buildcommands to set.

getBuildOutputDirectory

public java.io.File getBuildOutputDirectory()
Getter for buildOutputDirectory.

Returns:
Returns the buildOutputDirectory.

setBuildOutputDirectory

public void setBuildOutputDirectory(java.io.File buildOutputDirectory)
Setter for buildOutputDirectory.

Parameters:
buildOutputDirectory - The buildOutputDirectory to set.

getClasspathContainers

public java.util.List getClasspathContainers()
Getter for classpathContainers.

Returns:
Returns the classpathContainers.

setClasspathContainers

public void setClasspathContainers(java.util.List classpathContainers)
Setter for classpathContainers.

Parameters:
classpathContainers - The classpathContainers to set.

getEclipseProjectDir

public java.io.File getEclipseProjectDir()
Getter for eclipseProjectDir.

Returns:
Returns the eclipseProjectDir.

setEclipseProjectDir

public void setEclipseProjectDir(java.io.File eclipseProjectDir)
Setter for eclipseProjectDir.

Parameters:
eclipseProjectDir - The eclipseProjectDir to set.

getProjectnatures

public java.util.List getProjectnatures()
Getter for projectnatures.

Returns:
Returns the projectnatures.

setProjectnatures

public void setProjectnatures(java.util.List projectnatures)
Setter for projectnatures.

Parameters:
projectnatures - The projectnatures to set.

getUseProjectReferences

public boolean getUseProjectReferences()
Getter for useProjectReferences.

Specified by:
getUseProjectReferences in class AbstractIdeSupportMojo
Returns:
Returns the useProjectReferences.

setUseProjectReferences

public void setUseProjectReferences(boolean useProjectReferences)
Setter for useProjectReferences.

Parameters:
useProjectReferences - The useProjectReferences to set.

getWtpversion

public java.lang.String getWtpversion()
Getter for wtpversion.

Returns:
Returns the wtpversion.

setWtpversion

public void setWtpversion(java.lang.String wtpversion)
Setter for wtpversion.

Parameters:
wtpversion - The wtpversion to set.

getAdditionalBuildcommands

public java.util.List getAdditionalBuildcommands()
Getter for additionalBuildcommands.

Returns:
Returns the additionalBuildcommands.

setAdditionalBuildcommands

public void setAdditionalBuildcommands(java.util.List additionalBuildcommands)
Setter for additionalBuildcommands.

Parameters:
additionalBuildcommands - The additionalBuildcommands to set.

getAdditionalProjectnatures

public java.util.List getAdditionalProjectnatures()
Getter for additionalProjectnatures.

Returns:
Returns the additionalProjectnatures.

setAdditionalProjectnatures

public void setAdditionalProjectnatures(java.util.List additionalProjectnatures)
Setter for additionalProjectnatures.

Parameters:
additionalProjectnatures - The additionalProjectnatures to set.

isAddVersionToProjectName

public boolean isAddVersionToProjectName()
Getter for addVersionToProjectName.


setAddVersionToProjectName

public void setAddVersionToProjectName(boolean addVersionToProjectName)
Setter for addVersionToProjectName.


isAddGroupIdToProjectName

public boolean isAddGroupIdToProjectName()
Getter for addGroupIdToProjectName.


setAddGroupIdToProjectName

public void setAddGroupIdToProjectName(boolean addGroupIdToProjectName)
Setter for addGroupIdToProjectName.


getProjectNameTemplate

public java.lang.String getProjectNameTemplate()

setProjectNameTemplate

public void setProjectNameTemplate(java.lang.String projectNameTemplate)

setup

public boolean setup()
              throws org.apache.maven.plugin.MojoExecutionException
Description copied from class: AbstractIdeSupportMojo
Hook for preparation steps before the actual plugin execution.

Specified by:
setup in class AbstractIdeSupportMojo
Returns:
true if execution should continue or false if not.
Throws:
org.apache.maven.plugin.MojoExecutionException - generic mojo exception
See Also:
Mojo.execute()

convertBuildCommandList

protected void convertBuildCommandList(java.util.List commands)

setupExtras

protected void setupExtras()
                    throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

verifyClasspathContainerListIsComplete

protected void verifyClasspathContainerListIsComplete()

validateExtras

protected void validateExtras()

checkExtraDeprecations

protected void checkExtraDeprecations()

writeConfiguration

public void writeConfiguration(IdeDependency[] deps)
                        throws org.apache.maven.plugin.MojoExecutionException
Description copied from class: AbstractIdeSupportMojo
Main plugin method where dependencies should be processed in order to generate IDE configuration files.

Specified by:
writeConfiguration in class AbstractIdeSupportMojo
Parameters:
deps - list of IdeDependency objects, with artifacts, sources and javadocs already resolved
Throws:
org.apache.maven.plugin.MojoExecutionException - generic mojo exception

createEclipseWriterConfig

protected EclipseWriterConfig createEclipseWriterConfig(IdeDependency[] deps)
                                                 throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

writeExtraConfiguration

protected void writeExtraConfiguration(EclipseWriterConfig config)
                                throws org.apache.maven.plugin.MojoExecutionException
Write any extra configuration information for the Eclipse project. This is an extension point, called before the main configurations are written.
NOTE: This could change the config!

Parameters:
config -
Throws:
org.apache.maven.plugin.MojoExecutionException

fillDefaultNatures

protected void fillDefaultNatures(java.lang.String packaging)

fillDefaultClasspathContainers

protected void fillDefaultClasspathContainers(java.lang.String packaging)

fillDefaultBuilders

protected void fillDefaultBuilders(java.lang.String packaging)

buildDirectoryList

public EclipseSourceDir[] buildDirectoryList(org.apache.maven.project.MavenProject project,
                                             java.io.File basedir,
                                             java.io.File buildOutputDirectory)
                                      throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.