You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kr...@apache.org on 2013/08/27 16:16:57 UTC
svn commit: r1517827 [11/24] - in /maven/plugins/trunk:
maven-acr-plugin/src/main/java/org/apache/maven/plugin/acr/
maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/
maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/
maven-antr...
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java?rev=1517827&r1=1517826&r2=1517827&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java Tue Aug 27 14:16:42 2013
@@ -85,7 +85,7 @@ import org.codehaus.plexus.util.xml.pull
* </ul>
* If this goal is run on a multiproject root, dependencies between modules will be configured as direct project
* dependencies in Eclipse (unless <code>useProjectReferences</code> is set to <code>false</code>).
- *
+ *
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @author <a href="mailto:fgiust@apache.org">Fabrizio Giustina</a>
* @version $Id$
@@ -115,7 +115,8 @@ public class EclipsePlugin
private static final String DEFAULT_ASPECT_DIRECTORY = "src/main/aspect";
- private static final String NATURE_WST_FACET_CORE_NATURE = "org.eclipse.wst.common.project.facet.core.nature"; //$NON-NLS-1$
+ private static final String NATURE_WST_FACET_CORE_NATURE = "org.eclipse.wst.common.project.facet.core.nature";
+ //$NON-NLS-1$
private static final String BUILDER_WST_COMPONENT_STRUCTURAL_DEPENDENCY_RESOLVER =
"org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver"; //$NON-NLS-1$
@@ -135,7 +136,8 @@ public class EclipsePlugin
private static final String BUILDER_AJDT_CORE_JAVA = "org.eclipse.ajdt.core.ajbuilder"; //$NON-NLS-1$
- private static final String NATURE_WST_MODULE_CORE_NATURE = "org.eclipse.wst.common.modulecore.ModuleCoreNature"; //$NON-NLS-1$
+ private static final String NATURE_WST_MODULE_CORE_NATURE = "org.eclipse.wst.common.modulecore.ModuleCoreNature";
+ //$NON-NLS-1$
private static final String NATURE_JDT_CORE_JAVA = "org.eclipse.jdt.core.javanature"; //$NON-NLS-1$
@@ -145,14 +147,16 @@ public class EclipsePlugin
private static final String NATURE_AJDT_CORE_JAVA = "org.eclipse.ajdt.ui.ajnature"; //$NON-NLS-1$
- protected static final String COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER = "org.eclipse.jdt.launching.JRE_CONTAINER"; //$NON-NLS-1$
+ protected static final String COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER = "org.eclipse.jdt.launching.JRE_CONTAINER";
+ //$NON-NLS-1$
protected static final String ASPECTJ_RT_CONTAINER = "org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"; //$NON-NLS-1$
protected static final String REQUIRED_PLUGINS_CONTAINER = "org.eclipse.pde.core.requiredPlugins"; //$NON-NLS-1$
// warning, order is important for binary search
- public static final String[] WTP_SUPPORTED_VERSIONS = new String[] { "1.0", "1.5", "2.0", "R7", "none" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ public static final String[] WTP_SUPPORTED_VERSIONS = new String[]{ "1.0", "1.5", "2.0", "R7", "none" };
+ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
public static final String ASPECTJ_FILE_PATTERN = "**/*.aj";
@@ -171,50 +175,50 @@ public class EclipsePlugin
/**
* List of eclipse project natures. By default the <code>org.eclipse.jdt.core.javanature</code> nature plus the
* needed WTP natures are added. Natures added using this property <strong>replace</strong> the default list.
- *
+ * <p/>
* <pre>
* <projectnatures>
* <projectnature>org.eclipse.jdt.core.javanature</projectnature>
* <projectnature>org.eclipse.wst.common.modulecore.ModuleCoreNature</projectnature>
* </projectnatures>
* </pre>
- *
+ *
* @parameter
*/
private List projectnatures;
/**
- * List of artifacts, represented as <code>groupId:artifactId</code>, to exclude from the eclipse classpath,
+ * List of artifacts, represented as <code>groupId:artifactId</code>, to exclude from the eclipse classpath,
* being provided by some eclipse classPathContainer.
*
+ * @parameter
* @see http://jira.codehaus.org/browse/MECLIPSE-79
* @since 2.5
- * @parameter
*/
private List excludes;
/**
* List of eclipse project natures to be added to the default ones.
- *
+ * <p/>
* <pre>
* <additionalProjectnatures>
* <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
* </additionalProjectnatures>
* </pre>
- *
+ *
* @parameter
*/
private List additionalProjectnatures;
/**
* List of eclipse project facets to be added to the default ones.
- *
+ * <p/>
* <pre>
* <additionalProjectFacets>
* <jst.jsf>1.1<jst.jsf/>
* </additionalProjectFacets>
* </pre>
- *
+ *
* @parameter
*/
private Map additionalProjectFacets;
@@ -224,7 +228,7 @@ public class EclipsePlugin
* needed WTP builders are added. If you specify any configuration for this parameter, only those buildcommands
* specified will be used; the defaults won't be added. Use the <code>additionalBuildCommands</code> parameter for
* that. Configuration example: Old style:
- *
+ * <p/>
* <pre>
* <buildcommands>
* <buildcommand>org.eclipse.wst.common.modulecore.ComponentStructuralBuilder</buildcommand>
@@ -232,24 +236,24 @@ public class EclipsePlugin
* <buildcommand>org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver</buildcommand>
* </buildcommands>
* </pre>
- *
+ * <p/>
* For new style, see <code>additionalBuildCommands</code>.
- *
+ *
* @parameter
*/
private List buildcommands;
/**
* List of eclipse build commands to be added to the default ones. Old style:
- *
+ * <p/>
* <pre>
* <additionalBuildcommands>
* <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
* </additionalBuildcommands>
* </pre>
- *
+ * <p/>
* New style:
- *
+ * <p/>
* <pre>
* <additionalBuildcommands>
* <buildCommand>
@@ -261,10 +265,10 @@ public class EclipsePlugin
* </buildCommand>
* </additionalBuildcommands>
* </pre>
- *
+ * <p/>
* Note the difference between <code>build<strong>c</strong>ommand</code> and
* <code>build<strong>C</strong>ommand</code>. You can mix and match old and new-style configuration entries.
- *
+ *
* @parameter
*/
private List additionalBuildcommands;
@@ -272,7 +276,7 @@ public class EclipsePlugin
/**
* List of container classpath entries. By default the <code>org.eclipse.jdt.launching.JRE_CONTAINER</code>
* classpath container is added. Configuration example:
- *
+ * <p/>
* <pre>
* <classpathContainers>
* <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
@@ -280,14 +284,14 @@ public class EclipsePlugin
* <classpathContainer>org.eclipse.jst.j2ee.internal.web.container/artifact</classpathContainer>
* </classpathContainers>
* </pre>
- *
+ *
* @parameter
*/
private List classpathContainers;
/**
* Enables/disables the downloading of source attachments. Defaults to false. DEPRECATED - use downloadSources
- *
+ *
* @parameter expression="${eclipse.downloadSources}"
* @deprecated use downloadSources
*/
@@ -295,7 +299,7 @@ public class EclipsePlugin
/**
* Eclipse workspace directory.
- *
+ *
* @parameter expression="${eclipse.projectDir}" alias="outputDir"
*/
private File eclipseProjectDir;
@@ -303,7 +307,7 @@ public class EclipsePlugin
/**
* When set to false, the plugin will not create sub-projects and instead reference those sub-projects using the
* installed package in the local repository
- *
+ *
* @parameter expression="${eclipse.useProjectReferences}" default-value="true"
* @required
*/
@@ -311,9 +315,9 @@ public class EclipsePlugin
/**
* The default output directory
- *
+ *
* @parameter expression="${outputDirectory}" alias="outputDirectory"
- * default-value="${project.build.outputDirectory}"
+ * default-value="${project.build.outputDirectory}"
* @required
*/
private File buildOutputDirectory;
@@ -321,7 +325,7 @@ public class EclipsePlugin
/**
* The version of WTP for which configuration files will be generated. The default value is "none" (don't generate
* WTP configuration), supported versions are "R7", "1.0", "1.5" and "2.0"
- *
+ *
* @parameter expression="${wtpversion}" default-value="none"
*/
private String wtpversion;
@@ -329,7 +333,7 @@ public class EclipsePlugin
/**
* JEE context name of the WTP module. ( ex. WEB context name ). You can use "ROOT" if you want to map the webapp
* to the root context.
- *
+ *
* @parameter expression="${wtpContextName}"
*/
private String wtpContextName;
@@ -339,7 +343,7 @@ public class EclipsePlugin
* Additionally it copies all libraries to a project local directory and references them instead of referencing the
* files in the local Maven repository. It also ensured that the "Bundle-Classpath" in META-INF/MANIFEST.MF is
* synchronized.
- *
+ *
* @parameter expression="${eclipse.pde}" default-value="false"
*/
private boolean pde;
@@ -351,7 +355,7 @@ public class EclipsePlugin
/**
* The relative path of the manifest file
- *
+ *
* @parameter expression="${eclipse.manifest}" default-value="${basedir}/META-INF/MANIFEST.MF"
*/
private File manifest;
@@ -359,7 +363,7 @@ public class EclipsePlugin
/**
* Allow to configure additional generic configuration files for eclipse that will be written out to disk when
* running eclipse:eclipse. FOr each file you can specify the name and the text content.
- *
+ * <p/>
* <pre>
* <plugin>
* <groupId>org.apache.maven.plugins</groupId>
@@ -381,9 +385,9 @@ public class EclipsePlugin
* </configuration>
* </plugin>
* </pre>
- *
+ * <p/>
* Instead of the content you can also define (from version 2.5) an url to download the file :
- *
+ * <p/>
* <pre>
* <plugin>
* <groupId>org.apache.maven.plugins</groupId>
@@ -397,9 +401,9 @@ public class EclipsePlugin
* </additionalConfig>
* </configuration>
* </pre>
- *
+ * <p/>
* or a location :
- *
+ * <p/>
* <pre>
* <plugin>
* <groupId>org.apache.maven.plugins</groupId>
@@ -422,7 +426,7 @@ public class EclipsePlugin
* </dependencies>
* </plugin>
* </pre>
- *
+ *
* @parameter
*/
private EclipseConfigFile[] additionalConfig;
@@ -430,7 +434,7 @@ public class EclipsePlugin
/**
* If set to <code>true</code>, the version number of the artifact is appended to the name of the generated Eclipse
* project. See projectNameTemplate for other options.
- *
+ *
* @parameter expression="${eclipse.addVersionToProjectName}" default-value="false"
*/
private boolean addVersionToProjectName;
@@ -438,7 +442,7 @@ public class EclipsePlugin
/**
* If set to <code>true</code>, the groupId of the artifact is appended to the name of the generated Eclipse
* project. See projectNameTemplate for other options.
- *
+ *
* @parameter expression="${eclipse.addGroupIdToProjectName}" default-value="false"
*/
private boolean addGroupIdToProjectName;
@@ -447,7 +451,7 @@ public class EclipsePlugin
* Allows configuring the name of the eclipse projects. This property if set wins over addVersionToProjectName and
* addGroupIdToProjectName You can use <code>[groupId]</code>, <code>[artifactId]</code> and <code>[version]</code>
* variables. eg. <code>[groupId].[artifactId]-[version]</code>
- *
+ *
* @parameter expression="${eclipse.projectNameTemplate}"
*/
private String projectNameTemplate;
@@ -464,21 +468,21 @@ public class EclipsePlugin
/**
* Must the manifest files be written for java projects so that that the jee classpath for wtp is correct.
- *
+ *
* @parameter expression="${eclipse.wtpmanifest}" default-value="false"
*/
private boolean wtpmanifest;
/**
* Must the application files be written for ear projects in a separate directory.
- *
+ *
* @parameter expression="${eclipse.wtpapplicationxml}" default-value="false"
*/
private boolean wtpapplicationxml;
/**
* What WTP defined server to use for deployment informations.
- *
+ *
* @parameter expression="${eclipse.wtpdefaultserver}"
*/
private String wtpdefaultserver;
@@ -487,7 +491,7 @@ public class EclipsePlugin
/**
* ResourceManager for getting additonalConfig files from resources
- *
+ *
* @component
* @required
* @readonly
@@ -496,16 +500,16 @@ public class EclipsePlugin
/**
* WagonManager for accessing internet resources.
- *
+ *
* @component
* @required
* @readonly
*/
private WagonManager wagonManager;
-
+
/**
* MavenSettingsBuilder for accessing settings.xml.
- *
+ *
* @component
* @required
* @readonly
@@ -518,16 +522,16 @@ public class EclipsePlugin
* settings as the reactor projects, but the project name template my differ. The pom's in the workspace projects
* may not contain variables in the artefactId, groupId and version tags. If workspace is not defined, then an
* attempt to locate it by checking up the directory hierarchy will be made.
- *
- * @since 2.5
+ *
* @parameter expression="${eclipse.workspace}"
+ * @since 2.5
*/
protected File workspace;
/**
* Limit the use of project references to the current workspace. No project references will be created to projects
* in the reactor when they are not available in the workspace.
- *
+ *
* @parameter expression="${eclipse.limitProjectReferencesToWorkspace}" default-value="false"
*/
protected boolean limitProjectReferencesToWorkspace;
@@ -535,7 +539,7 @@ public class EclipsePlugin
/**
* The version of AJDT for which configuration files will be generated. The default value is "1.5", supported
* versions are "none" (AJDT support disabled), "1.4", and "1.5".
- *
+ *
* @parameter expression="${eclipse.ajdtVersion}" default-value="none"
*/
private String ajdtVersion;
@@ -543,42 +547,42 @@ public class EclipsePlugin
/**
* List of exclusions to add to the source directories on the classpath. Adds excluding="" to the classpathentry of
* the eclipse .classpath file. [MECLIPSE-104]
- *
- * @since 2.6.1
+ *
* @parameter
+ * @since 2.6.1
*/
private List sourceExcludes;
/**
* List of inclusions to add to the source directories on the classpath. Adds including="" to the classpathentry of
* the eclipse .classpath file.
- * <p>
+ * <p/>
* Java projects will always include "**/*.java"
- * <p>
+ * <p/>
* Ajdt projects will always include "**/*.aj"
- * <p>
+ * <p/>
* [MECLIPSE-104]
- *
- * @since 2.6.1
+ *
* @parameter
+ * @since 2.6.1
*/
private List sourceIncludes;
/**
- * A list of links to local files in the system. A configuration like this one in the pom :
+ * A list of links to local files in the system. A configuration like this one in the pom :
* <pre>
* <plugin>
* <groupId>org.apache.maven.plugins</groupId>
* <artifactId>maven-eclipse-plugin</artifactId>
- * <configuration>
- * <linkedResources>
+ * <configuration>
+ * <linkedResources>
* <linkedResource>
* <name>src/test/resources/oracle-ds.xml</name>
* <type>1</type>
- * <location>C://jboss/server/default/deploy/oracle-ds.xml</location>
+ * <location>C://jboss/server/default/deploy/oracle-ds.xml</location>
* </linkedResource>
- * </linkedResources>
- * </configuration>
+ * </linkedResources>
+ * </configuration>
* </plugin>
* </pre>
* will produce in the .project :
@@ -586,59 +590,59 @@ public class EclipsePlugin
* <linkedResources>
* <link>
* <name>src/test/resources/oracle-ds.xml</name>
- * <type>1</type>
+ * <type>1</type>
* <location>C://jboss/server/default/deploy/oracle-ds.xml</location>
* </link>
* </linkedResources>
* </pre>
- *
- * @since 2.8
+ *
* @parameter
+ * @since 2.8
*/
private List linkedResources;
-
+
/**
* Put classpath container entries last in eclipse classpath configuration. Note that this behaviour, although
* useful in situations were you want to override resources found in classpath containers, will made JRE classes
* loaded after 3rd party jars, so enabling it is not suggested.
- *
- * @since 2.9
+ *
* @parameter expression="${eclipse.classpathContainersLast}" default-value="false"
+ * @since 2.9
*/
protected boolean classpathContainersLast;
-
+
/**
- * Whether to place test resources after main resources. Note that the default behavior of Maven version 2.0.8 or
+ * Whether to place test resources after main resources. Note that the default behavior of Maven version 2.0.8 or
* later is to have test dirs before main dirs in classpath so this is discouraged if you need to reproduce the
* maven behavior during tests. The default behavior is also changed in eclipse plugin version 2.6 in order to
* better match the maven one.
* Switching to "test source last" can anyway be useful if you need to run your application in eclipse, since there
* is no concept in eclipse of "phases" with different set of source dirs and dependencies like we have in maven.
- *
- * @since 2.9
+ *
* @parameter expression="${eclipse.testSourcesLast}" default-value="false"
+ * @since 2.9
*/
protected boolean testSourcesLast;
-
+
/**
* The plugin is often capable in predicting the required jee version based on the dependencies of the project.
- * By setting this parameter to one of the {@code jeeversion} options the version will be locked.
- *
+ * By setting this parameter to one of the {@code jeeversion} options the version will be locked.
+ * <p/>
* <table>
- * <thead>
- * <tr><th>jeeversion</th><th>EJB version</th><th>Servlet version</th><th>JSP version</th></tr>
- * </thead>
- * <tbody>
- * <tr><td>6.0</td><td>3.1</td><td>3.0</td><td>2.2</td></tr>
- * <tr><td>5.0</td><td>3.0</td><td>2.5</td><td>2.1</td></tr>
- * <tr><td>1.4</td><td>2.1</td><td>2.4</td><td>2.0</td></tr>
- * <tr><td>1.3</td><td>2.0</td><td>2.3</td><td>1.2</td></tr>
- * <tr><td>1.2</td><td>1.1</td><td>2.2</td><td>1.1</td></tr>
- * </tbody>
+ * <thead>
+ * <tr><th>jeeversion</th><th>EJB version</th><th>Servlet version</th><th>JSP version</th></tr>
+ * </thead>
+ * <tbody>
+ * <tr><td>6.0</td><td>3.1</td><td>3.0</td><td>2.2</td></tr>
+ * <tr><td>5.0</td><td>3.0</td><td>2.5</td><td>2.1</td></tr>
+ * <tr><td>1.4</td><td>2.1</td><td>2.4</td><td>2.0</td></tr>
+ * <tr><td>1.3</td><td>2.0</td><td>2.3</td><td>1.2</td></tr>
+ * <tr><td>1.2</td><td>1.1</td><td>2.2</td><td>1.1</td></tr>
+ * </tbody>
* </table>
- *
- * @since 2.9
+ *
* @parameter expression="${eclipse.jeeversion}"
+ * @since 2.9
*/
protected String jeeversion;
@@ -654,7 +658,7 @@ public class EclipsePlugin
/**
* Getter for <code>buildcommands</code>.
- *
+ *
* @return Returns the buildcommands.
*/
public final List getBuildcommands()
@@ -664,7 +668,7 @@ public class EclipsePlugin
/**
* Setter for <code>buildcommands</code>.
- *
+ *
* @param buildcommands The buildcommands to set.
*/
public final void setBuildcommands( List buildcommands )
@@ -674,7 +678,7 @@ public class EclipsePlugin
/**
* Getter for <code>buildOutputDirectory</code>.
- *
+ *
* @return Returns the buildOutputDirectory.
*/
public final File getBuildOutputDirectory()
@@ -684,7 +688,7 @@ public class EclipsePlugin
/**
* Setter for <code>buildOutputDirectory</code>.
- *
+ *
* @param buildOutputDirectory The buildOutputDirectory to set.
*/
public final void setBuildOutputDirectory( File buildOutputDirectory )
@@ -694,7 +698,7 @@ public class EclipsePlugin
/**
* Getter for <code>classpathContainers</code>.
- *
+ *
* @return Returns the classpathContainers.
*/
public final List getClasspathContainers()
@@ -704,7 +708,7 @@ public class EclipsePlugin
/**
* Setter for <code>classpathContainers</code>.
- *
+ *
* @param classpathContainers The classpathContainers to set.
*/
public final void setClasspathContainers( List classpathContainers )
@@ -714,7 +718,7 @@ public class EclipsePlugin
/**
* Getter for <code>eclipseProjectDir</code>.
- *
+ *
* @return Returns the eclipseProjectDir.
*/
public final File getEclipseProjectDir()
@@ -724,7 +728,7 @@ public class EclipsePlugin
/**
* Setter for <code>eclipseProjectDir</code>.
- *
+ *
* @param eclipseProjectDir The eclipseProjectDir to set.
*/
public final void setEclipseProjectDir( File eclipseProjectDir )
@@ -734,7 +738,7 @@ public class EclipsePlugin
/**
* Getter for <code>projectnatures</code>.
- *
+ *
* @return Returns the projectnatures.
*/
public final List getProjectnatures()
@@ -744,7 +748,7 @@ public class EclipsePlugin
/**
* Setter for <code>projectnatures</code>.
- *
+ *
* @param projectnatures The projectnatures to set.
*/
public final void setProjectnatures( List projectnatures )
@@ -754,7 +758,7 @@ public class EclipsePlugin
/**
* Getter for <code>useProjectReferences</code>.
- *
+ *
* @return Returns the useProjectReferences.
*/
public final boolean getUseProjectReferences()
@@ -764,7 +768,7 @@ public class EclipsePlugin
/**
* Setter for <code>useProjectReferences</code>.
- *
+ *
* @param useProjectReferences The useProjectReferences to set.
*/
public final void setUseProjectReferences( boolean useProjectReferences )
@@ -774,7 +778,7 @@ public class EclipsePlugin
/**
* Getter for <code>wtpversion</code>.
- *
+ *
* @return Returns the wtpversion.
*/
public final String getWtpversion()
@@ -784,7 +788,7 @@ public class EclipsePlugin
/**
* Setter for <code>wtpversion</code>.
- *
+ *
* @param wtpversion The wtpversion to set.
*/
public final void setWtpversion( String wtpversion )
@@ -794,7 +798,7 @@ public class EclipsePlugin
/**
* Getter for <code>additionalBuildcommands</code>.
- *
+ *
* @return Returns the additionalBuildcommands.
*/
public final List getAdditionalBuildcommands()
@@ -804,7 +808,7 @@ public class EclipsePlugin
/**
* Setter for <code>additionalBuildcommands</code>.
- *
+ *
* @param additionalBuildcommands The additionalBuildcommands to set.
*/
public final void setAdditionalBuildcommands( List additionalBuildcommands )
@@ -814,7 +818,7 @@ public class EclipsePlugin
/**
* Getter for <code>additionalProjectnatures</code>.
- *
+ *
* @return Returns the additionalProjectnatures.
*/
public final List getAdditionalProjectnatures()
@@ -824,7 +828,7 @@ public class EclipsePlugin
/**
* Setter for <code>additionalProjectnatures</code>.
- *
+ *
* @param additionalProjectnatures The additionalProjectnatures to set.
*/
public final void setAdditionalProjectnatures( List additionalProjectnatures )
@@ -866,7 +870,7 @@ public class EclipsePlugin
/**
* Getter for <code>projectNameTemplate</code>
- *
+ *
* @return projectNameTemplate
*/
public final String getProjectNameTemplate()
@@ -876,7 +880,7 @@ public class EclipsePlugin
/**
* Setter for <code>projectNameTemplate</code>.
- *
+ *
* @param projectNameTemplate projectNameTemplate
*/
public final void setProjectNameTemplate( String projectNameTemplate )
@@ -909,9 +913,9 @@ public class EclipsePlugin
boolean ready;
checkDeprecations();
- setProjectNameTemplate( IdeUtils.calculateProjectNameTemplate( getProjectNameTemplate(),
- isAddVersionToProjectName(),
- isAddGroupIdToProjectName(), getLog() ) );
+ setProjectNameTemplate(
+ IdeUtils.calculateProjectNameTemplate( getProjectNameTemplate(), isAddVersionToProjectName(),
+ isAddGroupIdToProjectName(), getLog() ) );
ajdt = enableAjdt( executedProject ) && !ajdtVersion.equals( "none" );
ready = validate();
@@ -920,9 +924,8 @@ public class EclipsePlugin
// ear projects don't contain java sources
// pde projects are always java projects
- isJavaProject =
- pde
- || ( Constants.LANGUAGE_JAVA.equals( artifactHandler.getLanguage() ) && !Constants.PROJECT_PACKAGING_EAR.equals( packaging ) );
+ isJavaProject = pde || ( Constants.LANGUAGE_JAVA.equals( artifactHandler.getLanguage() )
+ && !Constants.PROJECT_PACKAGING_EAR.equals( packaging ) );
if ( sourceIncludes == null )
{
@@ -996,7 +999,7 @@ public class EclipsePlugin
/**
* Convert any Strings in the <code>commands</code> List to <code>BuildCommand</code>s. The conversion happens in
* situ.
- *
+ *
* @param commands a list of commands to convert into <code>BuildCommand</code>
*/
protected final void convertBuildCommandList( List commands )
@@ -1042,9 +1045,9 @@ public class EclipsePlugin
/**
* Extension point for subclasses.
- * <p>
+ * <p/>
* Called during <code>setup</code>.
- *
+ *
* @throws MojoExecutionException mojo failures.
*/
protected void setupExtras()
@@ -1058,9 +1061,11 @@ public class EclipsePlugin
boolean containsJREContainer = false;
// Check if classpathContainer contains a JRE (default, alternate or
// Execution Environment)
- for (Object classPathContainer : classpathContainers) {
- if (classPathContainer != null
- && classPathContainer.toString().startsWith(COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER)) {
+ for ( Object classPathContainer : classpathContainers )
+ {
+ if ( classPathContainer != null && classPathContainer.toString().startsWith(
+ COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER ) )
+ {
containsJREContainer = true;
break;
}
@@ -1079,9 +1084,8 @@ public class EclipsePlugin
if ( Arrays.binarySearch( WTP_SUPPORTED_VERSIONS, wtpversion ) < 0 )
{
throw new MojoExecutionException(
- Messages.getString( "EclipsePlugin.unsupportedwtp", new Object[] { //$NON-NLS-1$
- wtpversion,
- StringUtils.join( WTP_SUPPORTED_VERSIONS, " " ) } ) ); //$NON-NLS-1$
+ Messages.getString( "EclipsePlugin.unsupportedwtp", new Object[]{ //$NON-NLS-1$
+ wtpversion, StringUtils.join( WTP_SUPPORTED_VERSIONS, " " ) } ) ); //$NON-NLS-1$
}
assertNotEmpty( executedProject.getGroupId(), POM_ELT_GROUP_ID );
@@ -1110,19 +1114,22 @@ public class EclipsePlugin
if ( !eclipseProjectDir.exists() && !eclipseProjectDir.mkdirs() )
{
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.cantcreatedir", eclipseProjectDir ) ); //$NON-NLS-1$
+ throw new MojoExecutionException(
+ Messages.getString( "EclipsePlugin.cantcreatedir", eclipseProjectDir ) ); //$NON-NLS-1$
}
if ( !eclipseProjectDir.equals( executedProject.getFile().getParentFile() ) )
{
if ( !eclipseProjectDir.isDirectory() )
{
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.notadir", eclipseProjectDir ) ); //$NON-NLS-1$
+ throw new MojoExecutionException(
+ Messages.getString( "EclipsePlugin.notadir", eclipseProjectDir ) ); //$NON-NLS-1$
}
eclipseProjectDir = new File( eclipseProjectDir, executedProject.getArtifactId() );
if ( !eclipseProjectDir.isDirectory() && !eclipseProjectDir.mkdirs() )
{
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.cantcreatedir", eclipseProjectDir ) ); //$NON-NLS-1$
+ throw new MojoExecutionException(
+ Messages.getString( "EclipsePlugin.cantcreatedir", eclipseProjectDir ) ); //$NON-NLS-1$
}
}
@@ -1133,9 +1140,9 @@ public class EclipsePlugin
/**
* Extension point for subclasses.
- * <p>
+ * <p/>
* Called during <code>setup</code> and used to validate that the configuration is sane.
- *
+ *
* @throws MojoExecutionException mojo failures.
*/
protected void validateExtras()
@@ -1149,9 +1156,9 @@ public class EclipsePlugin
if ( eclipseDownloadSources )
{
// deprecated warning
- getLog().warn( Messages.getString( "EclipsePlugin.deprecatedpar", new Object[] { //$NON-NLS-1$
- "eclipse.downloadSources", //$NON-NLS-1$
- "downloadSources" } ) ); //$NON-NLS-1$
+ getLog().warn( Messages.getString( "EclipsePlugin.deprecatedpar", new Object[]{ //$NON-NLS-1$
+ "eclipse.downloadSources", //$NON-NLS-1$
+ "downloadSources" } ) ); //$NON-NLS-1$
downloadSources = true;
}
@@ -1160,7 +1167,7 @@ public class EclipsePlugin
/**
* Extension point for subclasses.
- * <p>
+ * <p/>
* Check for any extra deprecations and log warnings. Called during <code>setup</code>
*/
protected void checkDeprecationsExtras()
@@ -1229,8 +1236,8 @@ public class EclipsePlugin
writeAdditionalConfig();
- getLog().info( Messages.getString( "EclipsePlugin.wrote", new Object[] { //$NON-NLS-1$
- config.getEclipseProjectName(), eclipseProjectDir.getAbsolutePath() } ) );
+ getLog().info( Messages.getString( "EclipsePlugin.wrote", new Object[]{ //$NON-NLS-1$
+ config.getEclipseProjectName(), eclipseProjectDir.getAbsolutePath() } ) );
}
private void writeAdditionalConfig()
@@ -1238,76 +1245,104 @@ public class EclipsePlugin
{
if ( additionalConfig != null )
{
- for (EclipseConfigFile file : additionalConfig) {
- File projectRelativeFile = new File(eclipseProjectDir, file.getName());
- if (projectRelativeFile.isDirectory()) {
+ for ( EclipseConfigFile file : additionalConfig )
+ {
+ File projectRelativeFile = new File( eclipseProjectDir, file.getName() );
+ if ( projectRelativeFile.isDirectory() )
+ {
// just ignore?
- getLog().warn(Messages.getString("EclipsePlugin.foundadir", //$NON-NLS-1$
- projectRelativeFile.getAbsolutePath()));
+ getLog().warn( Messages.getString( "EclipsePlugin.foundadir", //$NON-NLS-1$
+ projectRelativeFile.getAbsolutePath() ) );
}
- try {
+ try
+ {
projectRelativeFile.getParentFile().mkdirs();
- if (file.getContent() == null) {
- if (file.getLocation() != null) {
- InputStream inStream = locator.getResourceAsInputStream(file.getLocation());
- OutputStream outStream = new FileOutputStream(projectRelativeFile);
- try {
- IOUtil.copy(inStream, outStream);
- } finally {
- IOUtil.close(inStream);
- IOUtil.close(outStream);
+ if ( file.getContent() == null )
+ {
+ if ( file.getLocation() != null )
+ {
+ InputStream inStream = locator.getResourceAsInputStream( file.getLocation() );
+ OutputStream outStream = new FileOutputStream( projectRelativeFile );
+ try
+ {
+ IOUtil.copy( inStream, outStream );
+ }
+ finally
+ {
+ IOUtil.close( inStream );
+ IOUtil.close( outStream );
}
- } else {
+ }
+ else
+ {
URL url = file.getURL();
String endPointUrl = url.getProtocol() + "://" + url.getAuthority();
// Repository Id should be ignored by Wagon ...
- Repository repository = new Repository("additonal-configs", endPointUrl);
- Wagon wagon = wagonManager.getWagon(repository);
- if (logger.isDebugEnabled()) {
+ Repository repository = new Repository( "additonal-configs", endPointUrl );
+ Wagon wagon = wagonManager.getWagon( repository );
+ if ( logger.isDebugEnabled() )
+ {
Debug debug = new Debug();
- wagon.addSessionListener(debug);
- wagon.addTransferListener(debug);
+ wagon.addSessionListener( debug );
+ wagon.addTransferListener( debug );
}
- wagon.setTimeout(1000);
+ wagon.setTimeout( 1000 );
Settings settings = mavenSettingsBuilder.buildSettings();
ProxyInfo proxyInfo = null;
- if (settings != null && settings.getActiveProxy() != null) {
+ if ( settings != null && settings.getActiveProxy() != null )
+ {
Proxy settingsProxy = settings.getActiveProxy();
proxyInfo = new ProxyInfo();
- proxyInfo.setHost(settingsProxy.getHost());
- proxyInfo.setType(settingsProxy.getProtocol());
- proxyInfo.setPort(settingsProxy.getPort());
- proxyInfo.setNonProxyHosts(settingsProxy.getNonProxyHosts());
- proxyInfo.setUserName(settingsProxy.getUsername());
- proxyInfo.setPassword(settingsProxy.getPassword());
+ proxyInfo.setHost( settingsProxy.getHost() );
+ proxyInfo.setType( settingsProxy.getProtocol() );
+ proxyInfo.setPort( settingsProxy.getPort() );
+ proxyInfo.setNonProxyHosts( settingsProxy.getNonProxyHosts() );
+ proxyInfo.setUserName( settingsProxy.getUsername() );
+ proxyInfo.setPassword( settingsProxy.getPassword() );
}
- if (proxyInfo != null) {
- wagon.connect(repository, wagonManager.getAuthenticationInfo(repository.getId()), proxyInfo);
- } else {
- wagon.connect(repository, wagonManager.getAuthenticationInfo(repository.getId()));
+ if ( proxyInfo != null )
+ {
+ wagon.connect( repository, wagonManager.getAuthenticationInfo( repository.getId() ),
+ proxyInfo );
+ }
+ else
+ {
+ wagon.connect( repository, wagonManager.getAuthenticationInfo( repository.getId() ) );
}
- wagon.get(url.getPath(), projectRelativeFile);
+ wagon.get( url.getPath(), projectRelativeFile );
}
- } else {
- FileUtils.fileWrite(projectRelativeFile.getAbsolutePath(), file.getContent());
}
- } catch (WagonException e) {
- throw new MojoExecutionException(Messages.getString("EclipsePlugin.remoteexception", //$NON-NLS-1$
- new Object[]{file.getURL(),
- e.getMessage()}));
- } catch (IOException e) {
- throw new MojoExecutionException(Messages.getString("EclipsePlugin.cantwritetofile", //$NON-NLS-1$
- projectRelativeFile.getAbsolutePath()));
- } catch (ResourceNotFoundException e) {
- throw new MojoExecutionException(Messages.getString("EclipsePlugin.cantfindresource", //$NON-NLS-1$
- file.getLocation()));
- } catch (XmlPullParserException e) {
- throw new MojoExecutionException(Messages.getString("EclipsePlugin.settingsxmlfailure", //$NON-NLS-1$
- e.getMessage()));
+ else
+ {
+ FileUtils.fileWrite( projectRelativeFile.getAbsolutePath(), file.getContent() );
+ }
+ }
+ catch ( WagonException e )
+ {
+ throw new MojoExecutionException( Messages.getString( "EclipsePlugin.remoteexception", //$NON-NLS-1$
+ new Object[]{ file.getURL(),
+ e.getMessage() } ) );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( Messages.getString( "EclipsePlugin.cantwritetofile", //$NON-NLS-1$
+ projectRelativeFile.getAbsolutePath() ) );
+ }
+ catch ( ResourceNotFoundException e )
+ {
+ throw new MojoExecutionException(
+ Messages.getString( "EclipsePlugin.cantfindresource", //$NON-NLS-1$
+ file.getLocation() ) );
+ }
+ catch ( XmlPullParserException e )
+ {
+ throw new MojoExecutionException(
+ Messages.getString( "EclipsePlugin.settingsxmlfailure", //$NON-NLS-1$
+ e.getMessage() ) );
}
}
}
@@ -1315,7 +1350,7 @@ public class EclipsePlugin
/**
* Create the <code>EclipseWriterConfig</code> for the specified dependencies.
- *
+ *
* @param deps the project dependencies
* @return a configured <code>EclipseWriterConfig</code>
* @throws MojoExecutionException mojo failures.
@@ -1359,11 +1394,15 @@ public class EclipsePlugin
if ( buildcommands != null )
{
- for (Object cmd : buildcommands) {
- if (cmd instanceof BuildCommand) {
- convertedBuildCommands.add(cmd);
- } else {
- convertedBuildCommands.add(new BuildCommand((String) cmd));
+ for ( Object cmd : buildcommands )
+ {
+ if ( cmd instanceof BuildCommand )
+ {
+ convertedBuildCommands.add( cmd );
+ }
+ else
+ {
+ convertedBuildCommands.add( new BuildCommand( (String) cmd ) );
}
}
}
@@ -1401,39 +1440,44 @@ public class EclipsePlugin
/**
* If this is a war module peek into the reactor an search for an ear module that defines the context root of this
* module.
- *
+ *
* @param config config to save the context root.
*/
private void collectWarContextRootsFromReactorEarConfiguration( EclipseWriterConfig config )
{
- if ( reactorProjects != null && wtpContextName == null
- && Constants.PROJECT_PACKAGING_WAR.equals( project.getPackaging() ) )
+ if ( reactorProjects != null && wtpContextName == null && Constants.PROJECT_PACKAGING_WAR.equals(
+ project.getPackaging() ) )
{
- for (Object reactorProject1 : reactorProjects) {
+ for ( Object reactorProject1 : reactorProjects )
+ {
MavenProject reactorProject = (MavenProject) reactorProject1;
- if (Constants.PROJECT_PACKAGING_EAR.equals(reactorProject.getPackaging())) {
+ if ( Constants.PROJECT_PACKAGING_EAR.equals( reactorProject.getPackaging() ) )
+ {
Xpp3Dom[] warDefinitions =
- IdeUtils.getPluginConfigurationDom(reactorProject, JeeUtils.ARTIFACT_MAVEN_EAR_PLUGIN,
- new String[]{"modules", "webModule"});
- for (Xpp3Dom warDefinition : warDefinitions) {
- Xpp3Dom groupId = warDefinition.getChild("groupId");
- Xpp3Dom artifactId = warDefinition.getChild("artifactId");
- Xpp3Dom contextRoot = warDefinition.getChild("contextRoot");
- if (groupId != null && artifactId != null && contextRoot != null && groupId.getValue() != null
- && artifactId.getValue() != null && contextRoot.getValue() != null) {
+ IdeUtils.getPluginConfigurationDom( reactorProject, JeeUtils.ARTIFACT_MAVEN_EAR_PLUGIN,
+ new String[]{ "modules", "webModule" } );
+ for ( Xpp3Dom warDefinition : warDefinitions )
+ {
+ Xpp3Dom groupId = warDefinition.getChild( "groupId" );
+ Xpp3Dom artifactId = warDefinition.getChild( "artifactId" );
+ Xpp3Dom contextRoot = warDefinition.getChild( "contextRoot" );
+ if ( groupId != null && artifactId != null && contextRoot != null && groupId.getValue() != null
+ && artifactId.getValue() != null && contextRoot.getValue() != null )
+ {
getLog().info(
- "Found context root definition for " + groupId.getValue() + ":"
- + artifactId.getValue() + " " + contextRoot.getValue());
- if (project.getArtifactId().equals(artifactId.getValue())
- && project.getGroupId().equals(groupId.getValue())) {
- config.setContextName(contextRoot.getValue());
+ "Found context root definition for " + groupId.getValue() + ":" + artifactId.getValue()
+ + " " + contextRoot.getValue() );
+ if ( project.getArtifactId().equals( artifactId.getValue() ) && project.getGroupId().equals(
+ groupId.getValue() ) )
+ {
+ config.setContextName( contextRoot.getValue() );
}
- } else {
- getLog().info(
- "Found incomplete ear configuration in " + reactorProject.getGroupId() + ":"
- + reactorProject.getGroupId() + " found "
- + warDefinition.toString());
+ }
+ else
+ {
+ getLog().info( "Found incomplete ear configuration in " + reactorProject.getGroupId() + ":"
+ + reactorProject.getGroupId() + " found " + warDefinition.toString() );
}
}
}
@@ -1445,7 +1489,7 @@ public class EclipsePlugin
{
config.setContextName( project.getArtifactId() );
}
- else if ( "ROOT".equals(wtpContextName) )
+ else if ( "ROOT".equals( wtpContextName ) )
{
config.setContextName( "" );
}
@@ -1460,7 +1504,7 @@ public class EclipsePlugin
* Write any extra configuration information for the Eclipse project. This is an extension point, called before the
* main configurations are written. <br/>
* <b> NOTE: This could change the config! </b>
- *
+ *
* @param config
* @throws MojoExecutionException
*/
@@ -1475,16 +1519,17 @@ public class EclipsePlugin
{
if ( string == null )
{
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.missingelement", elementName ) ); //$NON-NLS-1$
+ throw new MojoExecutionException(
+ Messages.getString( "EclipsePlugin.missingelement", elementName ) ); //$NON-NLS-1$
}
}
/**
* Fill getProjectnatures() with values.
- * <p>
+ * <p/>
* Subclasses should call super and then calculate their own additions and insert them via
* <code>getProjectnatures().addAll()</code>.
- *
+ *
* @param packaging the pom's packaging
*/
protected void fillDefaultNatures( String packaging )
@@ -1525,10 +1570,10 @@ public class EclipsePlugin
/**
* Fill getClasspathContainers() with values.
- * <p>
+ * <p/>
* Subclasses should call super and then calculate their own additions and insert them via
* <code>getClasspathContainers().addAll()</code>.
- *
+ *
* @param packaging the pom's packaging
*/
protected void fillDefaultClasspathContainers( String packaging )
@@ -1538,8 +1583,7 @@ public class EclipsePlugin
if ( getWorkspaceConfiguration().getDefaultClasspathContainer() != null )
{
getLog().info(
- "Adding default classpath container: "
- + getWorkspaceConfiguration().getDefaultClasspathContainer() );
+ "Adding default classpath container: " + getWorkspaceConfiguration().getDefaultClasspathContainer() );
classpathContainers.add( getWorkspaceConfiguration().getDefaultClasspathContainer() );
}
if ( pde )
@@ -1555,10 +1599,10 @@ public class EclipsePlugin
/**
* Fill getBuildcommands() with values.
- * <p>
+ * <p/>
* Subclasses should call super and then calculate their own additions and insert them via
* <code>getBuildcommands().addAll()</code>.
- *
+ *
* @param packaging the pom's packaging
*/
protected void fillDefaultBuilders( String packaging )
@@ -1618,12 +1662,11 @@ public class EclipsePlugin
buildOutputDirectory.equals( new File( project.getBuild().getOutputDirectory() ) );
if ( useStandardOutputDir )
{
- getLog().debug(
- "testOutput toRelativeAndFixSeparator " + projectBaseDir + " , "
+ getLog().debug( "testOutput toRelativeAndFixSeparator " + projectBaseDir + " , "
+ project.getBuild().getTestOutputDirectory() );
- testOutput =
- IdeUtils.toRelativeAndFixSeparator( projectBaseDir,
- new File( project.getBuild().getTestOutputDirectory() ), false );
+ testOutput = IdeUtils.toRelativeAndFixSeparator( projectBaseDir,
+ new File( project.getBuild().getTestOutputDirectory() ),
+ false );
getLog().debug( "testOutput after toRelative : " + testOutput );
}
@@ -1647,9 +1690,9 @@ public class EclipsePlugin
// NOTE: Since MNG-3118, test classes come before main classes
boolean testBeforeMain = isMavenVersion( "[2.0.8,)" );
-
+
// let users override this if needed, they need to simulate more than the test phase in eclipse
- if (testSourcesLast)
+ if ( testSourcesLast )
{
testBeforeMain = false;
}
@@ -1666,7 +1709,9 @@ public class EclipsePlugin
directories.addAll( testDirectories );
}
if ( ajdt )
+ {
extractAspectDirs( directories, project, basedir, projectBaseDir, testOutput );
+ }
return (EclipseSourceDir[]) directories.toArray( new EclipseSourceDir[directories.size()] );
}
@@ -1674,17 +1719,18 @@ public class EclipsePlugin
String output )
throws MojoExecutionException
{
- for (Object sourceRoot1 : sourceRoots) {
+ for ( Object sourceRoot1 : sourceRoots )
+ {
- File sourceRootFile = new File((String) sourceRoot1);
+ File sourceRootFile = new File( (String) sourceRoot1 );
- if (sourceRootFile.isDirectory()) {
- String sourceRoot =
- IdeUtils.toRelativeAndFixSeparator(projectBaseDir, sourceRootFile,
- !projectBaseDir.equals(basedir));
+ if ( sourceRootFile.isDirectory() )
+ {
+ String sourceRoot = IdeUtils.toRelativeAndFixSeparator( projectBaseDir, sourceRootFile,
+ !projectBaseDir.equals( basedir ) );
- directories.add(new EclipseSourceDir(sourceRoot, output, false, test, sourceIncludes, sourceExcludes,
- false));
+ directories.add(
+ new EclipseSourceDir( sourceRoot, output, false, test, sourceIncludes, sourceExcludes, false ) );
}
}
}
@@ -1693,69 +1739,75 @@ public class EclipsePlugin
boolean test, final String output )
throws MojoExecutionException
{
- for (Object resource1 : resources) {
+ for ( Object resource1 : resources )
+ {
Resource resource = (Resource) resource1;
- getLog().debug("Processing resource dir: " + resource.getDirectory());
+ getLog().debug( "Processing resource dir: " + resource.getDirectory() );
- List excludes = new ArrayList(resource.getExcludes());
+ List excludes = new ArrayList( resource.getExcludes() );
// automatically exclude java files: eclipse doesn't have the concept of resource directory so it will
// try to compile any java file found in maven resource dirs
- excludes.add(JAVA_FILE_PATTERN);
+ excludes.add( JAVA_FILE_PATTERN );
// TODO: figure out how to merge if the same dir is specified twice
// with different in/exclude patterns.
- File resourceDirectory = new File( /* basedir, */resource.getDirectory());
+ File resourceDirectory = new File( /* basedir, */resource.getDirectory() );
- if (!resourceDirectory.exists() || !resourceDirectory.isDirectory()) {
- getLog().debug("Resource dir: " + resourceDirectory + " either missing or not a directory.");
+ if ( !resourceDirectory.exists() || !resourceDirectory.isDirectory() )
+ {
+ getLog().debug( "Resource dir: " + resourceDirectory + " either missing or not a directory." );
continue;
}
- String resourcePath =
- IdeUtils.toRelativeAndFixSeparator(workspaceProjectBaseDir, resourceDirectory,
- !workspaceProjectBaseDir.equals(basedir));
+ String resourcePath = IdeUtils.toRelativeAndFixSeparator( workspaceProjectBaseDir, resourceDirectory,
+ !workspaceProjectBaseDir.equals( basedir ) );
String thisOutput = output;
- if (thisOutput != null) {
+ if ( thisOutput != null )
+ {
// sometimes thisOutput is already an absolute path
- File outputFile = new File(thisOutput);
- if (!outputFile.isAbsolute()) {
- outputFile = new File(workspaceProjectBaseDir, thisOutput);
+ File outputFile = new File( thisOutput );
+ if ( !outputFile.isAbsolute() )
+ {
+ outputFile = new File( workspaceProjectBaseDir, thisOutput );
}
// create output dir if it doesn't exist
outputFile.mkdirs();
- if (!StringUtils.isEmpty(resource.getTargetPath())) {
- outputFile = new File(outputFile, resource.getTargetPath());
+ if ( !StringUtils.isEmpty( resource.getTargetPath() ) )
+ {
+ outputFile = new File( outputFile, resource.getTargetPath() );
// create output dir if it doesn't exist
outputFile.mkdirs();
}
- getLog().debug(
- "Making relative and fixing separator: { " + workspaceProjectBaseDir + ", "
- + outputFile + ", false }.");
- thisOutput = IdeUtils.toRelativeAndFixSeparator(workspaceProjectBaseDir, outputFile, false);
+ getLog().debug( "Making relative and fixing separator: { " + workspaceProjectBaseDir + ", " + outputFile
+ + ", false }." );
+ thisOutput = IdeUtils.toRelativeAndFixSeparator( workspaceProjectBaseDir, outputFile, false );
}
EclipseSourceDir resourceDir =
- new EclipseSourceDir(resourcePath, thisOutput, true, test, resource.getIncludes(), excludes,
- resource.isFiltering());
+ new EclipseSourceDir( resourcePath, thisOutput, true, test, resource.getIncludes(), excludes,
+ resource.isFiltering() );
- if (!directories.add(resourceDir)) {
- EclipseSourceDir originalDir = (EclipseSourceDir) get(directories, resourceDir);
+ if ( !directories.add( resourceDir ) )
+ {
+ EclipseSourceDir originalDir = (EclipseSourceDir) get( directories, resourceDir );
- boolean merged = originalDir.merge(resourceDir);
- if (merged) {
+ boolean merged = originalDir.merge( resourceDir );
+ if ( merged )
+ {
+ getLog().info(
+ "Resource directory's path matches an existing source directory. Resources have been merged with the source directory "
+ + originalDir.getPath() );
+ }
+ else
+ {
getLog().info(
- "Resource directory's path matches an existing source directory. Resources have been merged with the source directory "
- + originalDir.getPath());
- } else {
- getLog()
- .info(
- "Resource directory's path matches an existing source directory but \"test\", \"filtering\" or \"output\" were different."
- + "The resulting eclipse configuration may not accurately reflect the project configuration for "
- + originalDir.getPath());
+ "Resource directory's path matches an existing source directory but \"test\", \"filtering\" or \"output\" were different."
+ + "The resulting eclipse configuration may not accurately reflect the project configuration for "
+ + originalDir.getPath() );
}
}
@@ -1765,15 +1817,17 @@ public class EclipsePlugin
/**
* java.util.Set doesn't have a get() method that returns the matching object. Since we use objects that are
* different by conceptually "equal" based on the path we need to locate the original object out of the Set.
- *
+ *
* @param set the set to iterate over looking for the specified object
- * @param o the object to locate in the set
+ * @param o the object to locate in the set
* @return the object from the set, or null if not found in the set
*/
private Object get( Set set, Object o )
{
- for (Object item : set) {
- if (o.equals(item)) {
+ for ( Object item : set )
+ {
+ if ( o.equals( item ) )
+ {
return item;
}
}
@@ -1797,12 +1851,11 @@ public class EclipsePlugin
File aspectDirectoryFile = new File( basedir, aspectDirectory );
if ( aspectDirectoryFile.exists() && aspectDirectoryFile.isDirectory() )
{
- String sourceRoot =
- IdeUtils.toRelativeAndFixSeparator( projectBaseDir, aspectDirectoryFile,
- !projectBaseDir.equals( basedir ) );
+ String sourceRoot = IdeUtils.toRelativeAndFixSeparator( projectBaseDir, aspectDirectoryFile,
+ !projectBaseDir.equals( basedir ) );
- directories.add( new EclipseSourceDir( sourceRoot, null, false, false, sourceIncludes, sourceExcludes,
- false ) );
+ directories.add(
+ new EclipseSourceDir( sourceRoot, null, false, false, sourceIncludes, sourceExcludes, false ) );
}
String testAspectDirectory = DEFAULT_TEST_ASPECT_DIRECTORY;
@@ -1815,12 +1868,12 @@ public class EclipsePlugin
File testAspectDirectoryFile = new File( basedir, testAspectDirectory );
if ( testAspectDirectoryFile.exists() && testAspectDirectoryFile.isDirectory() )
{
- String sourceRoot =
- IdeUtils.toRelativeAndFixSeparator( projectBaseDir, testAspectDirectoryFile,
- !projectBaseDir.equals( basedir ) );
+ String sourceRoot = IdeUtils.toRelativeAndFixSeparator( projectBaseDir, testAspectDirectoryFile,
+ !projectBaseDir.equals( basedir ) );
- directories.add( new EclipseSourceDir( sourceRoot, testOutput, false, true, sourceIncludes,
- sourceExcludes, false ) );
+ directories.add(
+ new EclipseSourceDir( sourceRoot, testOutput, false, true, sourceIncludes, sourceExcludes,
+ false ) );
}
}
}
@@ -1829,10 +1882,12 @@ public class EclipsePlugin
{
boolean enable = false;
List buildPlugins = project.getBuildPlugins();
- for (Object buildPlugin : buildPlugins) {
+ for ( Object buildPlugin : buildPlugins )
+ {
Plugin plugin = (Plugin) buildPlugin;
- if (plugin.getGroupId().equals(ORG_CODEHAUS_MOJO)
- && plugin.getArtifactId().equals(ASPECTJ_MAVEN_PLUGIN)) {
+ if ( plugin.getGroupId().equals( ORG_CODEHAUS_MOJO ) && plugin.getArtifactId().equals(
+ ASPECTJ_MAVEN_PLUGIN ) )
+ {
enable = true;
break;
}
@@ -1845,10 +1900,12 @@ public class EclipsePlugin
{
Xpp3Dom configuration = null;
List buildPlugins = project.getBuildPlugins();
- for (Object buildPlugin : buildPlugins) {
+ for ( Object buildPlugin : buildPlugins )
+ {
Plugin plugin = (Plugin) buildPlugin;
- if (plugin.getGroupId().equals(ORG_CODEHAUS_MOJO)
- && plugin.getArtifactId().equals(ASPECTJ_MAVEN_PLUGIN)) {
+ if ( plugin.getGroupId().equals( ORG_CODEHAUS_MOJO ) && plugin.getArtifactId().equals(
+ ASPECTJ_MAVEN_PLUGIN ) )
+ {
configuration = (Xpp3Dom) plugin.getConfiguration();
break;
}
@@ -1868,17 +1925,20 @@ public class EclipsePlugin
{
Xpp3Dom[] aspectLibraries = aspectLibrariesParent.getChildren( ASPECT_LIBRARY );
outerLoop:
- for (Xpp3Dom aspectLibrary : aspectLibraries) {
- String artifactId = aspectLibrary.getChild(POM_ELT_ARTIFACT_ID).getValue();
- String groupId = aspectLibrary.getChild(POM_ELT_GROUP_ID).getValue();
- for (IdeDependency dep : deps) {
- if (dep.getArtifactId().equals(artifactId) && dep.getGroupId().equals(groupId)) {
- dep.setAjdtDependency(true);
+ for ( Xpp3Dom aspectLibrary : aspectLibraries )
+ {
+ String artifactId = aspectLibrary.getChild( POM_ELT_ARTIFACT_ID ).getValue();
+ String groupId = aspectLibrary.getChild( POM_ELT_GROUP_ID ).getValue();
+ for ( IdeDependency dep : deps )
+ {
+ if ( dep.getArtifactId().equals( artifactId ) && dep.getGroupId().equals( groupId ) )
+ {
+ dep.setAjdtDependency( true );
continue outerLoop;
}
}
- throw new MojoExecutionException("AspectLibrary is not a dependency of project");
+ throw new MojoExecutionException( "AspectLibrary is not a dependency of project" );
}
}
}
@@ -1895,17 +1955,20 @@ public class EclipsePlugin
{
Xpp3Dom[] weaveDependencies = weaveDependenciesParent.getChildren( WEAVE_DEPENDENCY );
outerLoop:
- for (Xpp3Dom weaveDependency : weaveDependencies) {
- String artifactId = weaveDependency.getChild(POM_ELT_ARTIFACT_ID).getValue();
- String groupId = weaveDependency.getChild(POM_ELT_GROUP_ID).getValue();
- for (IdeDependency dep : deps) {
- if (dep.getArtifactId().equals(artifactId) && dep.getGroupId().equals(groupId)) {
- dep.setAjdtWeaveDependency(true);
+ for ( Xpp3Dom weaveDependency : weaveDependencies )
+ {
+ String artifactId = weaveDependency.getChild( POM_ELT_ARTIFACT_ID ).getValue();
+ String groupId = weaveDependency.getChild( POM_ELT_GROUP_ID ).getValue();
+ for ( IdeDependency dep : deps )
+ {
+ if ( dep.getArtifactId().equals( artifactId ) && dep.getGroupId().equals( groupId ) )
+ {
+ dep.setAjdtWeaveDependency( true );
continue outerLoop;
}
}
- throw new MojoExecutionException("WeaveDependency is not a dependency of project");
+ throw new MojoExecutionException( "WeaveDependency is not a dependency of project" );
}
}
}
@@ -1920,9 +1983,8 @@ public class EclipsePlugin
for ( int index = 0; workspaceArtefacts != null && index < workspaceArtefacts.length; index++ )
{
IdeDependency workspaceArtefact = workspaceArtefacts[index];
- if ( workspaceArtefact.isAddedToClasspath()
- && workspaceArtefact.getGroupId().equals( artifact.getGroupId() )
- && workspaceArtefact.getArtifactId().equals( artifact.getArtifactId() ) )
+ if ( workspaceArtefact.isAddedToClasspath() && workspaceArtefact.getGroupId().equals(
+ artifact.getGroupId() ) && workspaceArtefact.getArtifactId().equals( artifact.getArtifactId() ) )
{
if ( workspaceArtefact.getVersion().equals( artifact.getBaseVersion() ) )
{
@@ -2029,21 +2091,21 @@ public class EclipsePlugin
}
/**
- * Utility method that locates a project producing the given artifact
+ * Utility method that locates a project producing the given artifact
* and verifies if it's a valid Eclipse project.
- *
+ *
* @param artifact the artifact a project should produce.
* @return <code>true</code> if the artifact is produced by a reactor projectart.
*/
protected boolean isAvailableAsAReactorProject( Artifact artifact )
{
MavenProject project = getReactorProject( artifact );
- return ( project != null && new File( project.getBasedir(), ".project" ).exists() ) ;
+ return ( project != null && new File( project.getBasedir(), ".project" ).exists() );
}
-
+
/**
* Utility method that locates a project in the workspace for the given artifact.
- *
+ *
* @param artifact the artifact a project should produce.
* @return <code>true</code> if the artifact is produced by a reactor projectart.
*/
@@ -2064,9 +2126,7 @@ public class EclipsePlugin
}
else
{
- getLog().info(
- "Artifact "
- + artifact.getId()
+ getLog().info( "Artifact " + artifact.getId()
+ " already available as a workspace project, but with different version. Expected: "
+ artifact.getBaseVersion() + ", found: " + workspaceArtefact.getVersion() );
}
@@ -2077,19 +2137,20 @@ public class EclipsePlugin
/**
* Checks if jar has to be resolved for the given artifact
- *
+ *
* @param art the artifact to check
* @return true if resolution should happen
*/
protected final boolean hasToResolveJar( Artifact art )
{
- return !( getUseProjectReferences() && isAvailableAsAReactorProject( art ) )
- || ( limitProjectReferencesToWorkspace && !( getUseProjectReferences() && isAvailableAsAWorkspaceProject( art ) ) );
+ return !( getUseProjectReferences() && isAvailableAsAReactorProject( art ) ) || (
+ limitProjectReferencesToWorkspace && !( getUseProjectReferences() && isAvailableAsAWorkspaceProject(
+ art ) ) );
}
/**
* Checks if a projects reference has to be used for the given artifact
- *
+ *
* @param art the artifact to check
* @return true if a project reference has to be used.
*/
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseSourceDir.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseSourceDir.java?rev=1517827&r1=1517826&r2=1517827&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseSourceDir.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseSourceDir.java Tue Aug 27 14:16:42 2013
@@ -29,9 +29,9 @@ import org.codehaus.plexus.util.StringUt
/**
* Represent an eclipse source dir. Eclipse has no "main", "test" or "resource" concepts, so two source dirs with the
* same path are equal.
- * <p>
+ * <p/>
* source directories should always have a null output value.
- *
+ *
* @author <a href="mailto:fgiust@users.sourceforge.net">Fabrizio Giustina</a>
* @version $Id$
*/
@@ -64,14 +64,14 @@ public class EclipseSourceDir
private boolean filtering;
/**
- * @param path the eclipse source directory
- * @param output path output directory
+ * @param path the eclipse source directory
+ * @param output path output directory
* @param isResource true if the directory only contains resources, false if a compilation directory
- * @param test true if is a test directory, false otherwise
- * @param include a string in the eclipse pattern format for the include filter
- * @param exclude a string in the eclipse pattern format for the exclude filter
- * @param filtering true if filtering should be applied, false otherwise. Note: Filtering will only be applied if
- * this become a "special directory" by being nested within the default output directory.
+ * @param test true if is a test directory, false otherwise
+ * @param include a string in the eclipse pattern format for the include filter
+ * @param exclude a string in the eclipse pattern format for the exclude filter
+ * @param filtering true if filtering should be applied, false otherwise. Note: Filtering will only be applied if
+ * this become a "special directory" by being nested within the default output directory.
*/
public EclipseSourceDir( String path, String output, boolean isResource, boolean test, List include, List exclude,
boolean filtering )
@@ -87,7 +87,7 @@ public class EclipseSourceDir
/**
* Getter for <code>exclude</code>.
- *
+ *
* @return Returns the exclude. Never null.
*/
public List getExclude()
@@ -97,7 +97,7 @@ public class EclipseSourceDir
/**
* Setter for <code>exclude</code>.
- *
+ *
* @param exclude The exclude to set.
*/
public void setExclude( List exclude )
@@ -111,7 +111,7 @@ public class EclipseSourceDir
/**
* Getter for <code>include</code>.
- *
+ *
* @return Returns the include. Never null.
*/
public List getInclude()
@@ -121,7 +121,7 @@ public class EclipseSourceDir
/**
* Setter for <code>include</code>.
- *
+ *
* @param include The include to set.
*/
public void setInclude( List include )
@@ -151,9 +151,9 @@ public class EclipseSourceDir
/**
* Getter for <code>output</code>.
- * <p>
+ * <p/>
* source directories should always have a null output value.
- *
+ *
* @return Returns the output.
*/
public String getOutput()
@@ -163,7 +163,7 @@ public class EclipseSourceDir
/**
* Setter for <code>output</code>.
- *
+ *
* @param output The output to set.
*/
public void setOutput( String output )
@@ -173,7 +173,7 @@ public class EclipseSourceDir
/**
* Getter for <code>path</code>.
- *
+ *
* @return Returns the path.
*/
public String getPath()
@@ -183,7 +183,7 @@ public class EclipseSourceDir
/**
* Setter for <code>path</code>. Converts \\ to / in path.
- *
+ *
* @param path The path to set.
*/
public void setPath( String path )
@@ -193,7 +193,7 @@ public class EclipseSourceDir
/**
* Getter for <code>test</code>.
- *
+ *
* @return Returns the test.
*/
public boolean isTest()
@@ -203,7 +203,7 @@ public class EclipseSourceDir
/**
* Setter for <code>test</code>.
- *
+ *
* @param test The test to set.
*/
public void setTest( boolean test )
@@ -213,7 +213,7 @@ public class EclipseSourceDir
/**
* Getter for <code>isResource</code>.
- *
+ *
* @return Returns the isResource.
*/
public boolean isResource()
@@ -231,9 +231,10 @@ public class EclipseSourceDir
/**
* Wheter this resource should be copied with filtering.
+ *
* @param filtering filter resources
*/
- public void setFiltering(boolean filtering)
+ public void setFiltering( boolean filtering )
{
this.filtering = filtering;
}
@@ -243,8 +244,8 @@ public class EclipseSourceDir
*/
public boolean equals( Object obj )
{
- return ( obj != null ) && ( obj instanceof EclipseSourceDir )
- && this.path.equals( ( (EclipseSourceDir) obj ).path );
+ return ( obj != null ) && ( obj instanceof EclipseSourceDir ) && this.path.equals(
+ ( (EclipseSourceDir) obj ).path );
}
/**
@@ -268,26 +269,28 @@ public class EclipseSourceDir
*/
public String toString()
{
- return (isResource ? "resource " : "source ") + path + ": " + "output=" + output + ", " + "include=[" + getIncludeAsString() + "], " + "exclude=[" + getExcludeAsString() + "], " + "test=" + test + ", " + "filtering=" + filtering;
+ return ( isResource ? "resource " : "source " ) + path + ": " + "output=" + output + ", " + "include=["
+ + getIncludeAsString() + "], " + "exclude=[" + getExcludeAsString() + "], " + "test=" + test + ", "
+ + "filtering=" + filtering;
}
/**
* Merge with the provided directory.
- * <p>
+ * <p/>
* If one directory is a source and the other is a resource directory then the result will be a source directory and
* any includes or excludes will be removed since Eclipse has no "main", "test" or "resource" concepts. The output
* directory will be the source directories value.
- * <p>
+ * <p/>
* If the two directories are the same resources type (i.e isResource is equal) then the result will be the same
* resource type with the includes from each merged together (duplicates will be removed), similarly for the
* excludes. No effort is made to ensure that the includes and excludes are disjointed sets. Please fix your pom
* instead.
- * <p>
+ * <p/>
* No support for cases where the test, or filtering values are not identical.
- *
+ *
* @param mergeWith the directory to merge with
* @throws MojoExecutionException test or filtering values are not identical, or isResource true and output are not
- * identical
+ * identical
*/
public boolean merge( EclipseSourceDir mergeWith )
throws MojoExecutionException
@@ -312,10 +315,10 @@ public class EclipseSourceDir
// if the orginal or merged dir have an empty "include" this means all is included,
// so merge includes only if both are not empty
- if (!include.isEmpty() && !mergeWith.include.isEmpty())
+ if ( !include.isEmpty() && !mergeWith.include.isEmpty() )
{
- includesAsSet.addAll(include);
- includesAsSet.addAll(mergeWith.include);
+ includesAsSet.addAll( include );
+ includesAsSet.addAll( mergeWith.include );
}
include = new ArrayList( includesAsSet );
@@ -326,19 +329,19 @@ public class EclipseSourceDir
exclude = new ArrayList( excludesAsSet );
}
- if (!StringUtils.equals(output, mergeWith.output))
+ if ( !StringUtils.equals( output, mergeWith.output ) )
{
// Request to merge when 'output' is not identical
return false;
}
- if (test != mergeWith.test)
+ if ( test != mergeWith.test )
{
// Request to merge when 'test' is not identical
return false;
}
- if (filtering != mergeWith.filtering)
+ if ( filtering != mergeWith.filtering )
{
// Request to merge when 'filtering' is not identical
return false;
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseToMavenMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseToMavenMojo.java?rev=1517827&r1=1517826&r2=1517827&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseToMavenMojo.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseToMavenMojo.java Tue Aug 27 14:16:42 2013
@@ -215,22 +215,23 @@ public class EclipseToMavenMojo
Map plugins = new HashMap();
Map models = new HashMap();
- for (File file : files) {
+ for ( File file : files )
+ {
getLog().info(
- Messages.getString("EclipseToMavenMojo.processingfile", file.getAbsolutePath())); //$NON-NLS-1$
+ Messages.getString( "EclipseToMavenMojo.processingfile", file.getAbsolutePath() ) ); //$NON-NLS-1$
- processFile(file, plugins, models);
+ processFile( file, plugins, models );
}
int i = 1;
- for (Object o : plugins.keySet()) {
- getLog().info(Messages.getString("EclipseToMavenMojo.processingplugin",
- new Object[]{i++,
- plugins.keySet().size()})); //$NON-NLS-1$
+ for ( Object o : plugins.keySet() )
+ {
+ getLog().info( Messages.getString( "EclipseToMavenMojo.processingplugin",
+ new Object[]{ i++, plugins.keySet().size() } ) ); //$NON-NLS-1$
String key = (String) o;
- EclipseOsgiPlugin plugin = (EclipseOsgiPlugin) plugins.get(key);
- Model model = (Model) models.get(key);
- writeArtifact(plugin, model, remoteRepo);
+ EclipseOsgiPlugin plugin = (EclipseOsgiPlugin) plugins.get( key );
+ Model model = (Model) models.get( key );
+ writeArtifact( plugin, model, remoteRepo );
}
}
@@ -284,19 +285,22 @@ public class EclipseToMavenMojo
protected void resolveVersionRanges( Model model, Map models )
throws MojoFailureException
{
- for (Dependency dep : model.getDependencies()) {
- if (dep.getVersion().contains("[")
- || dep.getVersion().contains("(")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- String key = getKey(model);
- Model dependencyModel = (Model) models.get(getKey(dep));
- if (dependencyModel != null) {
- dep.setVersion(dependencyModel.getVersion());
- } else {
+ for ( Dependency dep : model.getDependencies() )
+ {
+ if ( dep.getVersion().contains( "[" ) || dep.getVersion().contains( "(" ) ) //$NON-NLS-1$ //$NON-NLS-2$
+ {
+ String key = getKey( model );
+ Model dependencyModel = (Model) models.get( getKey( dep ) );
+ if ( dependencyModel != null )
+ {
+ dep.setVersion( dependencyModel.getVersion() );
+ }
+ else
+ {
throw new MojoFailureException(
- Messages.getString("EclipseToMavenMojo.unabletoresolveversionrange",
- new Object[]{dep //$NON-NLS-1$
- , key})); //$NON-NLS-1$
+ Messages.getString( "EclipseToMavenMojo.unabletoresolveversionrange",
+ new Object[]{ dep //$NON-NLS-1$
+ , key } ) ); //$NON-NLS-1$
}
}
}
@@ -414,8 +418,9 @@ public class EclipseToMavenMojo
if ( deps.length > 0 )
{
- for (Dependency dep : deps) {
- model.getDependencies().add(dep);
+ for ( Dependency dep : deps )
+ {
+ model.getDependencies().add( dep );
}
}
@@ -651,29 +656,31 @@ public class EclipseToMavenMojo
Map requireBundleHeader = analyzer.parseHeader( requireBundle );
// now iterates on bundles and extract dependencies
- for (Object o : requireBundleHeader.entrySet()) {
+ for ( Object o : requireBundleHeader.entrySet() )
+ {
Map.Entry entry = (Map.Entry) o;
String bundleName = (String) entry.getKey();
Map attributes = (Map) entry.getValue();
- String version = (String) attributes.get(Analyzer.BUNDLE_VERSION.toLowerCase());
- boolean optional = "optional".equals(attributes.get("resolution:")); //$NON-NLS-1$ //$NON-NLS-2$
+ String version = (String) attributes.get( Analyzer.BUNDLE_VERSION.toLowerCase() );
+ boolean optional = "optional".equals( attributes.get( "resolution:" ) ); //$NON-NLS-1$ //$NON-NLS-2$
- if (version == null) {
+ if ( version == null )
+ {
getLog().info(
- Messages.getString("EclipseToMavenMojo.missingversionforbundle", bundleName)); //$NON-NLS-1$
+ Messages.getString( "EclipseToMavenMojo.missingversionforbundle", bundleName ) ); //$NON-NLS-1$
version = "[0,)"; //$NON-NLS-1$
}
- version = fixBuildNumberSeparator(version);
+ version = fixBuildNumberSeparator( version );
Dependency dep = new Dependency();
- dep.setGroupId(createGroupId(bundleName));
- dep.setArtifactId(createArtifactId(bundleName));
- dep.setVersion(version);
- dep.setOptional(optional);
+ dep.setGroupId( createGroupId( bundleName ) );
+ dep.setArtifactId( createArtifactId( bundleName ) );
+ dep.setVersion( version );
+ dep.setOptional( optional );
- dependencies.add(dep);
+ dependencies.add( dep );
}