@Mojo(name="eclipse") @Execute(phase=GENERATE_RESOURCES) public class EclipsePlugin extends AbstractIdeSupportMojo
.project and .classpath files.setting/org.eclipse.jdt.core.prefs with project specific compiler settingswtpversion is set to a
valid version (WTP configuration is not generated by default)useProjectReferences is set to false).| Modifier and Type | Field and Description |
|---|---|
static String |
ASPECTJ_FILE_PATTERN |
protected static String |
ASPECTJ_RT_CONTAINER |
protected static String |
BUILDER_WST_VALIDATION |
protected boolean |
classpathContainersLast
Put classpath container entries last in eclipse classpath configuration.
|
protected static String |
COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER |
static String |
JAVA_FILE_PATTERN |
protected String |
jeeversion
The plugin is often capable in predicting the required jee version based on the dependencies of the project.
|
protected boolean |
limitProjectReferencesToWorkspace
Limit the use of project references to the current workspace.
|
protected boolean |
testSourcesLast
Whether to place test resources after main resources.
|
protected File |
workspace
This eclipse workspace is read and all artifacts detected there will be connected as eclipse projects and will
not be linked to the jars in the local repository.
|
static String[] |
WTP_SUPPORTED_VERSIONS |
artifactCollector, artifactFactory, artifactMetadataSource, artifactResolver, downloadJavadocs, downloadSources, executedProject, forceRecheck, localRepository, logger, packaging, project, reactorProjects, remoteArtifactRepositories| Constructor and Description |
|---|
EclipsePlugin() |
| Modifier and Type | Method and Description |
|---|---|
EclipseSourceDir[] |
buildDirectoryList(MavenProject project,
File basedir,
File buildOutputDirectory) |
protected void |
checkDeprecationsExtras()
Extension point for subclasses.
|
protected void |
convertBuildCommandList(List commands)
Convert any Strings in the
commands List to BuildCommands. |
protected EclipseWriterConfig |
createEclipseWriterConfig(IdeDependency[] deps)
Create the
EclipseWriterConfig for the specified dependencies. |
protected void |
fillDefaultBuilders(String packaging)
Fill getBuildcommands() with values.
|
protected void |
fillDefaultClasspathContainers(String packaging)
Fill getClasspathContainers() with values.
|
protected void |
fillDefaultNatures(String packaging)
Fill getProjectnatures() with values.
|
List |
getAdditionalBuildcommands()
Getter for
additionalBuildcommands. |
List |
getAdditionalProjectnatures()
Getter for
additionalProjectnatures. |
List |
getBuildcommands()
Getter for
buildcommands. |
File |
getBuildOutputDirectory()
Getter for
buildOutputDirectory. |
List |
getClasspathContainers()
Getter for
classpathContainers. |
File |
getEclipseProjectDir()
Getter for
eclipseProjectDir. |
List |
getExcludes() |
List |
getLinkedResources() |
String |
getProjectNameForArifact(Artifact artifact)
Find the name of the project as used in eclipse.
|
String |
getProjectNameTemplate()
Getter for
projectNameTemplate |
List |
getProjectnatures()
Getter for
projectnatures. |
boolean |
getUseProjectReferences()
Getter for
useProjectReferences. |
protected IdeDependency[] |
getWorkspaceArtefacts() |
WorkspaceConfiguration |
getWorkspaceConfiguration() |
String |
getWtpversion()
Getter for
wtpversion. |
protected boolean |
hasToResolveJar(Artifact art)
Checks if jar has to be resolved for the given artifact
|
boolean |
isAddGroupIdToProjectName()
Getter for
addGroupIdToProjectName. |
boolean |
isAddVersionToProjectName()
Getter for
addVersionToProjectName. |
protected boolean |
isAvailableAsAReactorProject(Artifact artifact)
Utility method that locates a project producing the given artifact and verifies if it's a valid Eclipse project.
|
protected boolean |
isJavaProject() |
void |
setAddGroupIdToProjectName(boolean addGroupIdToProjectName)
Setter for
addGroupIdToProjectName. |
void |
setAdditionalBuildcommands(List additionalBuildcommands)
Setter for
additionalBuildcommands. |
void |
setAdditionalProjectnatures(List additionalProjectnatures)
Setter for
additionalProjectnatures. |
void |
setAddVersionToProjectName(boolean addVersionToProjectName)
Setter for
addVersionToProjectName. |
void |
setBuildcommands(List buildcommands)
Setter for
buildcommands. |
void |
setBuildOutputDirectory(File buildOutputDirectory)
Setter for
buildOutputDirectory. |
void |
setClasspathContainers(List classpathContainers)
Setter for
classpathContainers. |
void |
setEclipseProjectDir(File eclipseProjectDir)
Setter for
eclipseProjectDir. |
void |
setLinkedResources(List linkedResources) |
void |
setProjectNameTemplate(String projectNameTemplate)
Setter for
projectNameTemplate. |
void |
setProjectnatures(List projectnatures)
Setter for
projectnatures. |
boolean |
setup()
Hook for preparation steps before the actual plugin execution.
|
protected void |
setupExtras()
Extension point for subclasses.
|
void |
setUseProjectReferences(boolean useProjectReferences)
Setter for
useProjectReferences. |
void |
setWtpversion(String wtpversion)
Setter for
wtpversion. |
protected boolean |
useProjectReference(Artifact art)
Checks if a projects reference has to be used for the given artifact
|
protected void |
validateExtras()
Extension point for subclasses.
|
void |
writeConfiguration(IdeDependency[] deps)
Main plugin method where dependencies should be processed in order to generate IDE configuration files.
|
protected void |
writeConfigurationExtras(EclipseWriterConfig config)
Write any extra configuration information for the Eclipse project.
|
doDependencyResolution, enableLogging, execute, getArtifactFactory, getArtifactMetadataSource, getArtifactResolver, getDownloadJavadocs, getDownloadSources, getExecutedProject, getLocalRepository, getProject, getReactorProject, getReactorProjects, getRemoteArtifactRepositories, isMavenVersion, isResolveDependencies, setArtifactFactory, setArtifactMetadataSource, setArtifactResolver, setDownloadJavadocs, setDownloadSources, setExecutedProject, setLocalRepository, setProject, setReactorProjects, setRemoteArtifactRepositories, setResolveDependenciesgetLog, getPluginContext, setLog, setPluginContextprotected static final String BUILDER_WST_VALIDATION
protected static final String COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER
protected static final String ASPECTJ_RT_CONTAINER
public static final String[] WTP_SUPPORTED_VERSIONS
public static final String ASPECTJ_FILE_PATTERN
public static final String JAVA_FILE_PATTERN
@Parameter(property="eclipse.workspace") protected File workspace
@Parameter(property="eclipse.limitProjectReferencesToWorkspace", defaultValue="false") protected boolean limitProjectReferencesToWorkspace
@Parameter(property="eclipse.classpathContainersLast", defaultValue="false") protected boolean classpathContainersLast
@Parameter(property="eclipse.testSourcesLast", defaultValue="false") protected boolean testSourcesLast
@Parameter(property="eclipse.jeeversion") protected String jeeversion
jeeversion options the version will be locked.
| jeeversion | EJB version | Servlet version | JSP version |
|---|---|---|---|
| 6.0 | 3.1 | 3.0 | 2.2 |
| 5.0 | 3.0 | 2.5 | 2.1 |
| 1.4 | 2.1 | 2.4 | 2.0 |
| 1.3 | 2.0 | 2.3 | 1.2 |
| 1.2 | 1.1 | 2.2 | 1.1 |
protected final boolean isJavaProject()
public final List getBuildcommands()
buildcommands.public final void setBuildcommands(List buildcommands)
buildcommands.buildcommands - The buildcommands to set.public final File getBuildOutputDirectory()
buildOutputDirectory.public final void setBuildOutputDirectory(File buildOutputDirectory)
buildOutputDirectory.buildOutputDirectory - The buildOutputDirectory to set.public final List getClasspathContainers()
classpathContainers.public final void setClasspathContainers(List classpathContainers)
classpathContainers.classpathContainers - The classpathContainers to set.public final File getEclipseProjectDir()
eclipseProjectDir.public final void setEclipseProjectDir(File eclipseProjectDir)
eclipseProjectDir.eclipseProjectDir - The eclipseProjectDir to set.public final List getProjectnatures()
projectnatures.public final void setProjectnatures(List projectnatures)
projectnatures.projectnatures - The projectnatures to set.public final boolean getUseProjectReferences()
useProjectReferences.getUseProjectReferences in class AbstractIdeSupportMojopublic final void setUseProjectReferences(boolean useProjectReferences)
useProjectReferences.useProjectReferences - The useProjectReferences to set.public final String getWtpversion()
wtpversion.public final void setWtpversion(String wtpversion)
wtpversion.wtpversion - The wtpversion to set.public final List getAdditionalBuildcommands()
additionalBuildcommands.public final void setAdditionalBuildcommands(List additionalBuildcommands)
additionalBuildcommands.additionalBuildcommands - The additionalBuildcommands to set.public final List getAdditionalProjectnatures()
additionalProjectnatures.public final void setAdditionalProjectnatures(List additionalProjectnatures)
additionalProjectnatures.additionalProjectnatures - The additionalProjectnatures to set.public final boolean isAddVersionToProjectName()
addVersionToProjectName.public final void setAddVersionToProjectName(boolean addVersionToProjectName)
addVersionToProjectName.public final boolean isAddGroupIdToProjectName()
addGroupIdToProjectName.public final void setAddGroupIdToProjectName(boolean addGroupIdToProjectName)
addGroupIdToProjectName.public final String getProjectNameTemplate()
projectNameTemplatepublic final void setProjectNameTemplate(String projectNameTemplate)
projectNameTemplate.projectNameTemplate - projectNameTemplatepublic List getLinkedResources()
public void setLinkedResources(List linkedResources)
linkedResources - the linkedResources to setpublic final boolean setup()
throws MojoExecutionException
AbstractIdeSupportMojosetup in class AbstractIdeSupportMojotrue if execution should continue or false if not.MojoExecutionException - generic mojo exceptionMojo.execute()protected final void convertBuildCommandList(List commands)
commands List to BuildCommands. The conversion happens in
situ.commands - a list of commands to convert into BuildCommandprotected void setupExtras()
throws MojoExecutionException
Called during setup.
MojoExecutionException - mojo failures.protected void validateExtras()
throws MojoExecutionException
Called during setup and used to validate that the configuration is sane.
MojoExecutionException - mojo failures.protected void checkDeprecationsExtras()
Check for any extra deprecations and log warnings. Called during setup
public final void writeConfiguration(IdeDependency[] deps) throws MojoExecutionException
AbstractIdeSupportMojowriteConfiguration in class AbstractIdeSupportMojodeps - list of IdeDependency objects, with artifacts, sources and javadocs already resolvedMojoExecutionException - generic mojo exceptionprotected final EclipseWriterConfig createEclipseWriterConfig(IdeDependency[] deps) throws MojoExecutionException
EclipseWriterConfig for the specified dependencies.deps - the project dependenciesEclipseWriterConfigMojoExecutionException - mojo failures.protected void writeConfigurationExtras(EclipseWriterConfig config) throws MojoExecutionException
config - MojoExecutionExceptionprotected void fillDefaultNatures(String packaging)
Subclasses should call super and then calculate their own additions and insert them via
getProjectnatures().addAll().
packaging - the pom's packagingprotected void fillDefaultClasspathContainers(String packaging)
Subclasses should call super and then calculate their own additions and insert them via
getClasspathContainers().addAll().
packaging - the pom's packagingprotected void fillDefaultBuilders(String packaging)
Subclasses should call super and then calculate their own additions and insert them via
getBuildcommands().addAll().
packaging - the pom's packagingpublic final EclipseSourceDir[] buildDirectoryList(MavenProject project, File basedir, File buildOutputDirectory) throws MojoExecutionException
MojoExecutionExceptionpublic String getProjectNameForArifact(Artifact artifact)
getProjectNameForArifact in class AbstractIdeSupportMojoartifact - The artifact to find the eclipse name for.protected final IdeDependency[] getWorkspaceArtefacts()
getWorkspaceArtefacts in class AbstractIdeSupportMojopublic final WorkspaceConfiguration getWorkspaceConfiguration()
public final List getExcludes()
getExcludes in class AbstractIdeSupportMojoprotected boolean isAvailableAsAReactorProject(Artifact artifact)
isAvailableAsAReactorProject in class AbstractIdeSupportMojoartifact - the artifact a project should produce.true if the artifact is produced by a reactor projectart.protected final boolean hasToResolveJar(Artifact art)
hasToResolveJar in class AbstractIdeSupportMojoart - the artifact to checkprotected final boolean useProjectReference(Artifact art)
useProjectReference in class AbstractIdeSupportMojoart - the artifact to checkCopyright © 2002–2015 The Apache Software Foundation. All rights reserved.