svn commit: r170605 - in /maven/components/trunk/maven-plugins/maven-release-plugin: ./ src/main/java/org/apache/maven/plugin/release/ src/main/java/org/apache/maven/plugin/transformer/

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r170605 - in /maven/components/trunk/maven-plugins/maven-release-plugin: ./ src/main/java/org/apache/maven/plugin/release/ src/main/java/org/apache/maven/plugin/transformer/

Emmanuel Venisse
Author: evenisse
Date: Tue May 17 07:58:14 2005
New Revision: 170605

URL: http://svn.apache.org/viewcvs?rev=170605&view=rev
Log:
Add pom rewriting

Added:
    maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/
    maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/AbstractPomTransformer.java
    maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/PomTransformer.java
    maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/Transformation.java
    maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java
Modified:
    maven/components/trunk/maven-plugins/maven-release-plugin/pom.xml
    maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/AbstractReleaseMojo.java
    maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java

Modified: maven/components/trunk/maven-plugins/maven-release-plugin/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-release-plugin/pom.xml?rev=170605&r1=170604&r2=170605&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-release-plugin/pom.xml (original)
+++ maven/components/trunk/maven-plugins/maven-release-plugin/pom.xml Tue May 17 07:58:14 2005
@@ -30,5 +30,15 @@
       <artifactId>maven-scm-provider-svn</artifactId>
       <version>1.0-alpha-1-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>dom4j</groupId>
+      <artifactId>dom4j</artifactId>
+      <version>1.4-dev-8</version>
+    </dependency>
+    <dependency>
+      <groupId>jaxen</groupId>
+      <artifactId>jaxen</artifactId>
+      <version>1.0-FCS</version>
+    </dependency>
   </dependencies>
 </project>

Modified: maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/AbstractReleaseMojo.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/AbstractReleaseMojo.java?rev=170605&r1=170604&r2=170605&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/AbstractReleaseMojo.java (original)
+++ maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/AbstractReleaseMojo.java Tue May 17 07:58:14 2005
@@ -92,6 +92,11 @@
         return scmManager;
     }
 
+    public String getTag()
+    {
+        return tag;
+    }
+
     protected ScmBean getScm()
     {
         ScmBean scm = new ScmBean();

Modified: maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java?rev=170605&r1=170604&r2=170605&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java (original)
+++ maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java Tue May 17 07:58:14 2005
@@ -23,17 +23,16 @@
 import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.scm.ScmBean;
+import org.apache.maven.plugin.transformer.PomTransformer;
+import org.apache.maven.plugin.transformer.VersionTransformer;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFile;
 
-import java.io.IOException;
-import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 
 /**
  * @goal prepare
@@ -73,7 +72,7 @@
 
         transformPom();
 
-        //checkin();
+        checkin();
 
         tag();
     }
@@ -228,16 +227,18 @@
             }
         }
 
+        //Write pom
         MavenXpp3Writer modelWriter = new MavenXpp3Writer();
         try
         {
-            //TODO: Write in pom file
-            //TODO: Write only necessary informations
-            StringWriter writer = new StringWriter();
-            modelWriter.write( writer, model );
-            getLog().info( writer.toString() );
+            PomTransformer transformer = new VersionTransformer();
+            transformer.setOutputFile( project.getFile() );
+            transformer.setProject( project.getFile() );
+            transformer.setUpdatedModel ( model );
+            transformer.transformNodes();
+            transformer.write();
         }
-        catch ( IOException e )
+        catch ( Exception e )
         {
             throw new MojoExecutionException( "Can't update pom.", e );
         }

Added: maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/AbstractPomTransformer.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/AbstractPomTransformer.java?rev=170605&view=auto
==============================================================================
--- maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/AbstractPomTransformer.java (added)
+++ maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/AbstractPomTransformer.java Tue May 17 07:58:14 2005
@@ -0,0 +1,349 @@
+package org.apache.maven.plugin.transformer;
+
+/* ====================================================================
+ *   Copyright 2001-2005 The Apache Software Foundation.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ * ====================================================================
+ */
+
+import org.apache.maven.model.Model;
+import org.codehaus.plexus.util.FileUtils;
+import org.dom4j.Document;
+import org.dom4j.Node;
+import org.dom4j.io.OutputFormat;
+import org.dom4j.io.SAXReader;
+import org.dom4j.io.XMLWriter;
+import org.jaxen.XPath;
+import org.jaxen.dom4j.Dom4jXPath;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * This is the base class for any tool that attempts to transform fields
+ * in the POM. Currently we are using the XML form of the POM and using Jaxen
+ * but eventually we will be able to perform the same transformations on
+ * POM beans. Jaxen needs to be modified and some serious cleanup needs to
+ * go on in Maven internally, but this will serve as a start. An attempt is
+ * made to make this tool GUI friendly.
+ *
+ * @author <a href="mailto:[hidden email]">Jason van Zyl</a>
+ *
+ * @version $Id: AbstractPomTransformer.java 115932 2004-08-06 22:43:03Z carlos $
+ */
+public abstract class AbstractPomTransformer
+    implements PomTransformer
+{
+    /** POM document */
+    private File project;
+
+    /** Dom4j document. */
+    private Document document;
+
+    /** Output file. */
+    private File outputFile;
+
+    /** Properties used in transformNode */
+    private Map variables;
+
+    /** Nodes selected for transformation using xpath. */
+    private List selectedNodes;
+
+    /** Updated model obtain from MavenProject. */
+    private Model updatedModel;
+
+    private List transformations;
+
+    // -------------------------------------------------------------------------
+    // Accessors
+    // -------------------------------------------------------------------------
+
+    /**
+     *
+     * @param updatedModel
+     */
+    public Model getUpdatedModel()
+    {
+        return updatedModel;
+    }
+
+    /**
+     *
+     * @param updatedModel
+     */
+    public void setUpdatedModel( Model updatedModel )
+    {
+        this.updatedModel = updatedModel;
+    }
+
+    /**
+     *
+     * @return
+     */
+    public Map getVariables()
+    {
+        return variables;
+    }
+
+    /**
+     *
+     * @param variables
+     */
+    public void setVariables( Map variables )
+    {
+        this.variables = variables;
+    }
+
+    /**
+     *
+     * @param project
+     */
+    public void setProject( File project )
+    {
+        this.project = project;
+    }
+
+    /**
+     *
+     * @return
+     */
+    public File getProject()
+    {
+        return project;
+    }
+
+    /**
+     *
+     * @return
+     */
+    public Document getDocument()
+    {
+        return document;
+    }
+
+    /**
+     *
+     * @param document
+     */
+    public void setDocument( Document document )
+    {
+        this.document = document;
+    }
+
+    /**
+     *
+     * @return
+     */
+    public File getOutputFile()
+    {
+        return outputFile;
+    }
+
+    /**
+     *
+     * @param outputFile
+     */
+    public void setOutputFile( File outputFile )
+    {
+        this.outputFile = outputFile;
+    }
+
+    /**
+     *
+     * @return
+     */
+    public List getSelectedNodes()
+    {
+        if ( selectedNodes == null )
+        {
+            try
+            {
+                selectNodes();
+            }
+            catch ( Exception e )
+            {
+                // do nothing.
+            }
+        }
+        return selectedNodes;
+    }
+
+    /**
+     *
+     * @param selectedNodes
+     */
+    public void setSelectedNodes( List selectedNodes )
+    {
+        this.selectedNodes = selectedNodes;
+    }
+
+    /**
+     *
+     * @return
+     */
+    public int getSelectedNodeCount()
+    {
+        return getSelectedNodes().size();
+    }
+
+    /**
+     *
+     * @return
+     */
+    public List getTransformations()
+    {
+        if ( transformations == null )
+        {
+            createTransformations();
+        }
+
+        return transformations;
+    }
+
+    /**
+     *
+     */
+    public void createTransformations()
+    {
+        transformations = new ArrayList();
+
+        for ( Iterator i = getSelectedNodes().iterator(); i.hasNext(); )
+        {
+            Object o = i.next();
+
+            if ( o instanceof Node )
+            {
+                Transformation transformation = new Transformation( this );
+                transformation.setNode( (Node) o );
+                transformations.add( transformation );
+            }
+        }
+    }
+
+    /**
+     * This is the automated way of transforming the nodes if there is
+     * no user interaction involved.
+     *
+     * @throws Exception If an error occurs while transforming the nodes.
+     */
+    public void transformNodes()
+        throws Exception
+    {
+        for ( Iterator i = getSelectedNodes().iterator(); i.hasNext(); )
+        {
+            Object o = i.next();
+
+            if ( o instanceof Node )
+            {
+                transformNode( (Node) o );
+            }
+        }
+    }
+
+    // ----------------------------------------------------------------------
+    // Implementation
+    // ----------------------------------------------------------------------
+
+    /**
+     *
+     * @return
+     */
+    public abstract String selectProjectNodeXPathExpression();
+
+    /**
+     *
+     * @return
+     */
+    public abstract String selectDependenciesNodesXPathExpression();
+
+    /**
+     *
+     * @return
+     */
+    public abstract String selectPluginsNodesXPathExpression();
+
+    /**
+     *
+     * @param node
+     * @throws Exception
+     */
+    public abstract void transformNode( Node node )
+        throws Exception;
+
+    /**
+     * Update the snapshot version identifiers with actual timestamp versions
+     * and write out the POM in its updated form.
+     *
+     * @throws Exception
+     */
+    public void selectNodes()
+        throws Exception
+    {
+        SAXReader reader = new SAXReader();
+        setDocument( reader.read( getProject() ) );
+
+        // The selecting nodes with the xpath expression will give us a list
+        // of dependencies elements where the version element is equal to 'SNAPSHOT'.
+        // So we can get any information we need, and alter anything we need to before writing
+        // the dom4j document back out.
+        XPath pomXpath = new Dom4jXPath( selectProjectNodeXPathExpression() );
+        XPath dependenciesXpath = new Dom4jXPath( selectDependenciesNodesXPathExpression() );
+        XPath pluginsXpath = new Dom4jXPath( selectPluginsNodesXPathExpression() );
+        List nodes = new ArrayList();
+        nodes.addAll( pomXpath.selectNodes( getDocument() ) );
+        nodes.addAll( dependenciesXpath.selectNodes( getDocument() ) );
+        nodes.addAll( pluginsXpath.selectNodes( getDocument() ) );
+        setSelectedNodes( nodes );
+    }
+
+    /**
+     *
+     * @throws Exception
+     */
+    public void write()
+        throws Exception
+    {
+        OutputStream os = null;
+
+        if ( getOutputFile() != null )
+        {
+            // Backup the original first.
+            FileUtils.copyFile( getOutputFile(), new File( getOutputFile() + ".backup" ) );
+
+            // Now hand of the os.
+            os = new FileOutputStream( getOutputFile() );
+        }
+        else
+        {
+            os = new PrintStream( System.out );
+        }
+
+        OutputFormat format = new OutputFormat();
+        format.setIndentSize( 2 );
+        format.setNewlines( true );
+        format.setTrimText( true );
+
+        XMLWriter writer = new XMLWriter( format );
+        writer.setOutputStream( os );
+        writer.write( getDocument() );
+        writer.flush();
+        writer.close();
+    }
+}

Added: maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/PomTransformer.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/PomTransformer.java?rev=170605&view=auto
==============================================================================
--- maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/PomTransformer.java (added)
+++ maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/PomTransformer.java Tue May 17 07:58:14 2005
@@ -0,0 +1,56 @@
+package org.apache.maven.plugin.transformer;
+
+/* ====================================================================
+ *   Copyright 2001-2005 The Apache Software Foundation.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ * ====================================================================
+ */
+
+import java.io.File;
+
+import org.apache.maven.model.Model;
+
+import org.dom4j.Node;
+
+/**
+ * @author <a href="mailto:[hidden email]">Jason van Zyl</a>
+ *
+ * @version $Id: PomTransformer.java 114783 2004-03-02 15:37:56Z evenisse $
+ */
+public interface PomTransformer
+{
+    File getProject();
+
+    void setProject( File project );
+
+    void transformNodes()
+        throws Exception;
+
+    void transformNode( Node node )
+    throws Exception;
+
+    Node getTransformedNode( Node node )
+    throws Exception;
+
+    void write()
+        throws Exception;
+
+    Model getUpdatedModel();
+
+    void setUpdatedModel( Model updatedModel );
+
+    File getOutputFile();
+
+    void setOutputFile( File outputFile );
+}

Added: maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/Transformation.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/Transformation.java?rev=170605&view=auto
==============================================================================
--- maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/Transformation.java (added)
+++ maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/Transformation.java Tue May 17 07:58:14 2005
@@ -0,0 +1,95 @@
+package org.apache.maven.plugin.transformer;
+
+/* ====================================================================
+ *   Copyright 2001-2005 The Apache Software Foundation.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ * ====================================================================
+ */
+
+import org.dom4j.Node;
+
+/**
+ *
+ *
+ * @author <a href="mailto:[hidden email]">Jason van Zyl</a>
+ *
+ * @version $Id: Transformation.java 114783 2004-03-02 15:37:56Z evenisse $
+ */
+public class Transformation
+{
+    /** Pom Transformer associated with this transformation. */
+    private PomTransformer pomTransformer;
+
+    /** Node to transform. */
+    private Node node;
+
+    public Transformation( PomTransformer pomTransformer )
+    {
+        this.pomTransformer = pomTransformer;
+    }
+
+    // ----------------------------------------------------------------------
+    // Accessors
+    // ----------------------------------------------------------------------
+
+    /**
+     *
+     * @return
+     */
+    public Node getNode()
+    {
+        return node;
+    }
+
+    /**
+     *
+     * @param node
+     */
+    public void setNode( Node node )
+    {
+        this.node = node;
+    }
+
+    /**
+     *
+     * @throws Exception
+     */
+    public void transform()
+        throws Exception
+    {
+        pomTransformer.transformNode( node );
+    }
+
+    /**
+     *
+     * @return
+     * @throws Exception
+     */
+    public String getBeforeTransformation()
+        throws Exception
+    {
+        return getNode().asXML();
+    }
+
+    /**
+     *
+     * @return
+     * @throws Exception
+     */
+    public String getAfterTransformation()
+        throws Exception
+    {
+        return pomTransformer.getTransformedNode( getNode() ).asXML();
+    }
+}

Added: maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java?rev=170605&view=auto
==============================================================================
--- maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java (added)
+++ maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java Tue May 17 07:58:14 2005
@@ -0,0 +1,160 @@
+package org.apache.maven.plugin.transformer;
+
+/* ====================================================================
+ *   Copyright 2001-2005 The Apache Software Foundation.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ * ====================================================================
+ */
+
+import java.util.Iterator;
+
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Plugin;
+import org.dom4j.Element;
+import org.dom4j.Node;
+
+/**
+ *
+ *
+ * @author <a href="mailto:[hidden email]">Brett Porter</a>
+ *
+ * @version $Id: VersionTransformer.java 115421 2004-06-01 02:20:18Z dion $
+ */
+public class VersionTransformer
+    extends AbstractPomTransformer
+{
+    // -------------------------------------------------------------------------
+    // Accessors
+    // -------------------------------------------------------------------------
+
+    public String selectProjectNodeXPathExpression()
+    {
+        return "/project";
+    }
+
+    public String selectDependenciesNodesXPathExpression()
+    {
+        return "/project/dependencies/dependency";
+    }
+
+    public String selectPluginsNodesXPathExpression()
+    {
+        return "/project/build/plugins/plugin";
+    }
+
+    public void transformNode( Node node )
+        throws Exception
+    {
+        if ( selectProjectNodeXPathExpression().equals( node.getPath() ) )
+        {
+            Element project = (Element) node;
+
+            Node version = node.selectSingleNode( "version" );
+            if ( version != null )
+            {
+                version.setText( getUpdatedModel().getVersion() );
+            }
+            else
+            {
+                project.addElement( "version" ).addText( getUpdatedModel().getVersion() );
+            }
+        }
+        else if ( selectDependenciesNodesXPathExpression().equals( node.getPath() ) )
+        {
+            Element dependency = (Element) node;
+            Node groupId = node.selectSingleNode( "groupId" );
+            Node artifactId = node.selectSingleNode( "artifactId" );
+            Node type = node.selectSingleNode( "type" );
+            String typeText = "jar";
+            if ( type != null )
+            {
+                typeText = type.getText();
+            }
+            Node version = node.selectSingleNode( "version" );
+            if ( version != null )
+            {
+                version.setText( getDependency( groupId.getText(), artifactId.getText(), typeText ).getVersion() );
+            }
+            else
+            {
+                dependency.addElement( "version" ).addText( getDependency( groupId.getText(), artifactId.getText(),
+                                                                           type.getText() ).getVersion() );
+            }
+        }
+        else
+        {
+            Element plugin = (Element) node;
+            Node groupId = node.selectSingleNode( "groupId" );
+            String groupIdText = "org.apache.maven.plugins";
+            if ( groupId != null )
+            {
+                groupIdText = groupId.getText();
+            }
+            Node artifactId = node.selectSingleNode( "artifactId" );
+            Node version = node.selectSingleNode( "version" );
+            Plugin p = getPlugin( groupIdText, artifactId.getText() );
+            if ( groupId != null )
+            {
+                groupId.setText( p.getGroupId() );
+            }
+            else
+            {
+                plugin.addElement( "groupId" ).addText( p.getGroupId() );
+            }
+            if ( version != null )
+            {
+                version.setText( p.getVersion() );
+            }
+            else
+            {
+                plugin.addElement( "version" ).addText( p.getVersion() );
+            }
+        }
+    }
+
+    private Dependency getDependency( String groupId, String artifactId, String type )
+    {
+        for ( Iterator i = getUpdatedModel().getDependencies().iterator(); i.hasNext(); )
+        {
+            Dependency dependency = (Dependency) i.next();
+            if ( dependency.getGroupId().equals( groupId ) && dependency.getArtifactId().equals( artifactId )
+                && dependency.getType().equals( type ) )
+            {
+                return dependency;
+            }
+        }
+
+        return null;
+    }
+
+    private Plugin getPlugin( String groupId, String artifactId )
+    {
+        for ( Iterator i = getUpdatedModel().getBuild().getPlugins().iterator(); i.hasNext(); )
+        {
+            Plugin plugin = (Plugin) i.next();
+            if ( plugin.getGroupId().equals( groupId ) && plugin.getArtifactId().equals( artifactId ) )
+            {
+                return plugin;
+            }
+        }
+
+        return null;
+    }
+
+    public Node getTransformedNode( Node node )
+        throws Exception
+    {
+        throw new UnsupportedOperationException( "getTransformedNode not implemented" );
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]