org.apache.maven.plugin.eclipse
Class EclipseToMavenMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.eclipse.EclipseToMavenMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Direct Known Subclasses:
MakeArtifactsMojo

public class EclipseToMavenMojo
extends org.apache.maven.plugin.AbstractMojo
implements org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable

Add eclipse artifacts from an eclipse installation to the local repo. This mojo automatically analize the eclipse directory, copy plugins jars to the local maven repo, and generates appropriate poms. This is the official central repository builder for Eclipse plugins, so it has the necessary default values. For customized repositories see MakeArtifactsMojo

Version:
$Id: EclipseToMavenMojo.java 549439 2007-06-21 10:05:13Z aheritier $
Author:
Fabrizio Giustina, Carlos Sanchez

Field Summary
protected  org.codehaus.plexus.components.interactivity.InputHandler inputHandler
          Input handler, needed for comand line handling.
protected  org.apache.maven.artifact.installer.ArtifactInstaller installer
          ArtifactInstaller component.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
EclipseToMavenMojo()
           
 
Method Summary
 void contextualize(org.codehaus.plexus.context.Context context)
          
protected  java.lang.String createArtifactId(java.lang.String bundleName)
          Get the artifact id as the tokens after last dot e.g.
protected  java.lang.String createGroupId(java.lang.String bundleName)
          Get the group id as the tokens until last dot e.g.
 void execute()
           
protected  java.lang.String fixBuildNumberSeparator(java.lang.String versionRange)
          Fix the separator for the 4th token in a versions.
protected  java.lang.String osgiVersionToMavenVersion(java.lang.String version)
           
protected  java.lang.String osgiVersionToMavenVersion(java.lang.String version, java.lang.String forcedQualifier, boolean stripQualifier)
          The 4th (build) token MUST be separed with "-" and not with "." in maven.
protected  org.apache.maven.model.Dependency[] parseDependencies(java.lang.String requireBundle)
          Parses the "Require-Bundle" and convert it to a list of dependencies.
protected  void resolveVersionRanges(org.apache.maven.model.Model model, java.util.Map models)
          Resolve version ranges in the model provided, overriding version ranges with versions from the dependency in the provided map of models.
 
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

installer

protected org.apache.maven.artifact.installer.ArtifactInstaller installer
ArtifactInstaller component.


inputHandler

protected org.codehaus.plexus.components.interactivity.InputHandler inputHandler
Input handler, needed for comand line handling.

Constructor Detail

EclipseToMavenMojo

public EclipseToMavenMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Specified by:
execute in interface org.apache.maven.plugin.Mojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
See Also:
Mojo.execute()

resolveVersionRanges

protected void resolveVersionRanges(org.apache.maven.model.Model model,
                                    java.util.Map models)
                             throws org.apache.maven.plugin.MojoFailureException
Resolve version ranges in the model provided, overriding version ranges with versions from the dependency in the provided map of models. TODO doesn't check if the version is in range, it just overwrites it

Parameters:
model -
models -
Throws:
org.apache.maven.plugin.MojoFailureException

osgiVersionToMavenVersion

protected java.lang.String osgiVersionToMavenVersion(java.lang.String version)

osgiVersionToMavenVersion

protected java.lang.String osgiVersionToMavenVersion(java.lang.String version,
                                                     java.lang.String forcedQualifier,
                                                     boolean stripQualifier)
The 4th (build) token MUST be separed with "-" and not with "." in maven. A version with 4 dots is not parsed, and the whole string is considered a qualifier. See tests in DefaultArtifactVersion for reference.

Parameters:
version - initial version
forcedQualifier - build number
stripQualifier - always remove 4th token in version
Returns:
converted version

contextualize

public void contextualize(org.codehaus.plexus.context.Context context)
                   throws org.codehaus.plexus.context.ContextException

Specified by:
contextualize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Throws:
org.codehaus.plexus.context.ContextException

createGroupId

protected java.lang.String createGroupId(java.lang.String bundleName)
Get the group id as the tokens until last dot e.g. org.eclipse.jdt -> org.eclipse

Parameters:
bundleName - bundle name
Returns:
group id

createArtifactId

protected java.lang.String createArtifactId(java.lang.String bundleName)
Get the artifact id as the tokens after last dot e.g. org.eclipse.jdt -> jdt

Parameters:
bundleName - bundle name
Returns:
artifact id

parseDependencies

protected org.apache.maven.model.Dependency[] parseDependencies(java.lang.String requireBundle)
Parses the "Require-Bundle" and convert it to a list of dependencies.

Parameters:
requireBundle - "Require-Bundle" entry
Returns:
an array of Dependency

fixBuildNumberSeparator

protected java.lang.String fixBuildNumberSeparator(java.lang.String versionRange)
Fix the separator for the 4th token in a versions. In maven this must be "-", in OSGI it's "."

Parameters:
versionRange - input range
Returns:
modified version range


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