View Javadoc

1   package org.apache.maven.plugin.eclipse.writers.myeclipse;
2   
3   import org.apache.maven.plugin.MojoExecutionException;
4   import org.apache.maven.plugin.eclipse.writers.EclipseClasspathWriter;
5   import org.apache.maven.plugin.ide.IdeDependency;
6   import org.codehaus.plexus.util.xml.XMLWriter;
7   
8   /**
9    * @author <a href="mailto:olivier.jacob@gmail.com">Olivier Jacob</a>
10   */
11  public class MyEclipseClasspathWriter
12      extends EclipseClasspathWriter
13  {
14      /**
15       * Write the dependency only if scope is <b>not</b> provided
16       * 
17       * @param writer the XmlWriter to write the config with
18       * @param dep the dependency to be added to configuration
19       * @throws MojoExecutionException
20       */
21      protected void addDependency( XMLWriter writer, IdeDependency dep )
22          throws MojoExecutionException
23      {
24  
25          if ( log.isDebugEnabled() )
26          {
27              log.debug( "Currently processing " + dep.getArtifactId() + " dependency" );
28          }
29  
30          if ( !dep.isProvided() )
31          {
32              super.addDependency( writer, dep );
33          }
34      }
35  }