You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2009/04/08 23:31:43 UTC
svn commit: r763406 - in /maven/plugins/trunk/maven-dependency-plugin/src:
main/java/org/apache/maven/plugin/dependency/ site/apt/
test/java/org/apache/maven/plugin/dependency/
test/java/org/apache/maven/plugin/dependency/testUtils/stubs/
test/resource...
Author: vsiveton
Date: Wed Apr 8 21:31:43 2009
New Revision: 763406
URL: http://svn.apache.org/viewvc?rev=763406&view=rev
Log:
MDEP-206: Add new Mojo to find duplicate dependency declared
o new mojo added with test case
Added:
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java (with props)
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestAnalyzeDuplicateMojo.java (with props)
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependencies2ProjectStub.java (with props)
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependenciesProjectStub.java (with props)
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config.xml (with props)
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config2.xml (with props)
Modified:
maven/plugins/trunk/maven-dependency-plugin/src/site/apt/index.apt
Added: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java?rev=763406&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java Wed Apr 8 21:31:43 2009
@@ -0,0 +1,149 @@
+package org.apache.maven.plugin.dependency;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.FileReader;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * Analyzes the <code><dependencies/></code> and <code><dependencyManagement/></code> tags in the
+ * <code>pom.xml</code> and determines the duplicate declared dependencies.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ * @goal analyze-duplicate
+ * @aggregator false
+ */
+public class AnalyzeDuplicateMojo
+ extends AbstractMojo
+{
+ /**
+ * The Maven project to analyze.
+ *
+ * @parameter expression="${project}"
+ * @required
+ * @readonly
+ */
+ private MavenProject project;
+
+ /** {@inheritDoc} */
+ public void execute()
+ throws MojoExecutionException, MojoFailureException
+ {
+ MavenXpp3Reader pomReader = new MavenXpp3Reader();
+ Model model = null;
+ try
+ {
+ model = pomReader.read( new FileReader( project.getFile() ) );
+ }
+ catch ( Exception e )
+ {
+ throw new MojoExecutionException( "IOException: " + e.getMessage(), e );
+ }
+
+ Set duplicateDependencies = new HashSet();
+ if ( model.getDependencies() != null )
+ {
+ duplicateDependencies = findDuplicateDependencies( model.getDependencies() );
+ }
+
+ Set duplicateDependenciesManagement = new HashSet();
+ if ( model.getDependencyManagement() != null && model.getDependencyManagement().getDependencies() != null )
+ {
+ duplicateDependenciesManagement =
+ findDuplicateDependencies( model.getDependencyManagement().getDependencies() );
+ }
+
+ if ( getLog().isInfoEnabled() )
+ {
+ StringBuffer sb = new StringBuffer();
+
+ if ( !duplicateDependencies.isEmpty() )
+ {
+ sb.append( "List of duplicate dependencies defined in <dependencies/> in your pom.xml:\n" );
+ for ( Iterator it = duplicateDependencies.iterator(); it.hasNext(); )
+ {
+ String dup = (String) it.next();
+
+ sb.append( "\to " + dup );
+ if ( it.hasNext() )
+ {
+ sb.append( "\n" );
+ }
+ }
+ }
+
+ if ( !duplicateDependenciesManagement.isEmpty() )
+ {
+ if ( sb.length() > 0 )
+ {
+ sb.append( "\n" );
+ }
+ sb.append( "List of duplicate dependencies defined in <dependencyManagement/> in "
+ + "your pom.xml:\n" );
+ for ( Iterator it = duplicateDependenciesManagement.iterator(); it.hasNext(); )
+ {
+ String dup = (String) it.next();
+
+ sb.append( "\to " + dup );
+ if ( it.hasNext() )
+ {
+ sb.append( "\n" );
+ }
+ }
+ }
+
+ if ( sb.length() > 0 )
+ {
+ getLog().info( sb.toString() );
+ }
+ else
+ {
+ getLog().info( "No duplicate dependencies found in <dependencies/> or in <dependencyManagement/>" );
+ }
+ }
+ }
+
+ private Set findDuplicateDependencies( List modelDependencies )
+ {
+ List modelDependencies2 = new ArrayList();
+ for ( Iterator it = modelDependencies.iterator(); it.hasNext(); )
+ {
+ Dependency dep = (Dependency) it.next();
+
+ modelDependencies2.add( dep.getManagementKey() );
+ }
+
+ return new HashSet( CollectionUtils.disjunction( modelDependencies2, new HashSet( modelDependencies2 ) ) );
+ }
+}
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/plugins/trunk/maven-dependency-plugin/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/site/apt/index.apt?rev=763406&r1=763405&r2=763406&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/site/apt/index.apt (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/site/apt/index.apt Wed Apr 8 21:31:43 2009
@@ -46,6 +46,9 @@
*{{{analyze-report-mojo.html}dependency:analyze-report}} analyzes the dependencies of this project and produces a report
that summarises which are: used and declared; used and undeclared; unused and declared.
+ *{{{analyze-duplicate-mojo.html}dependency:analyze-duplicate}} analyzes the <dependencies/> and <dependencyManagement/>
+ tags in the pom.xml and determines the duplicate declared dependencies.
+
*{{{build-classpath-mojo.html}dependency:build-classpath}} tells
Maven to output the path of the dependencies from the local repository in a classpath format to be used in java -cp.
The classpath file may also be attached and installed/deployed along with the main artifact.
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestAnalyzeDuplicateMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestAnalyzeDuplicateMojo.java?rev=763406&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestAnalyzeDuplicateMojo.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestAnalyzeDuplicateMojo.java Wed Apr 8 21:31:43 2009
@@ -0,0 +1,223 @@
+package org.apache.maven.plugin.dependency;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import org.apache.maven.plugin.logging.Log;
+import org.codehaus.plexus.logging.Logger;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class TestAnalyzeDuplicateMojo
+ extends AbstractDependencyMojoTestCase
+{
+ public void testDuplicate()
+ throws Exception
+ {
+ File testPom =
+ new File( getBasedir(), "target/test-classes/unit/duplicate-dependencies/plugin-config.xml" );
+ AnalyzeDuplicateMojo mojo = (AnalyzeDuplicateMojo) lookupMojo( "analyze-duplicate", testPom );
+ assertNotNull( mojo );
+ DuplicateLog log = new DuplicateLog();
+ mojo.setLog( log );
+ mojo.execute();
+
+ assertTrue( log.getContent().indexOf(
+ "List of duplicate dependencies defined in <dependencies/> in "
+ + "your pom.xml" ) != -1 );
+ assertTrue( log.getContent().indexOf( "junit:junit:jar" ) != -1 );
+ }
+
+ public void testDuplicate2()
+ throws Exception
+ {
+ File testPom =
+ new File( getBasedir(), "target/test-classes/unit/duplicate-dependencies/plugin-config2.xml" );
+ AnalyzeDuplicateMojo mojo = (AnalyzeDuplicateMojo) lookupMojo( "analyze-duplicate", testPom );
+ assertNotNull( mojo );
+ DuplicateLog log = new DuplicateLog();
+ mojo.setLog( log );
+ mojo.execute();
+
+ assertTrue( log.getContent().indexOf(
+ "List of duplicate dependencies defined in <dependencyManagement/> in "
+ + "your pom.xml" ) != -1 );
+ assertTrue( log.getContent().indexOf( "junit:junit:jar" ) != -1 );
+ }
+
+ class DuplicateLog
+ implements Log
+ {
+ StringBuffer sb = new StringBuffer();
+
+ /** {@inheritDoc} */
+ public void debug( CharSequence content )
+ {
+ print( "debug", content );
+ }
+
+ /** {@inheritDoc} */
+ public void debug( CharSequence content, Throwable error )
+ {
+ print( "debug", content, error );
+ }
+
+ /** {@inheritDoc} */
+ public void debug( Throwable error )
+ {
+ print( "debug", error );
+ }
+
+ /** {@inheritDoc} */
+ public void info( CharSequence content )
+ {
+ print( "info", content );
+ }
+
+ /** {@inheritDoc} */
+ public void info( CharSequence content, Throwable error )
+ {
+ print( "info", content, error );
+ }
+
+ /** {@inheritDoc} */
+ public void info( Throwable error )
+ {
+ print( "info", error );
+ }
+
+ /** {@inheritDoc} */
+ public void warn( CharSequence content )
+ {
+ print( "warn", content );
+ }
+
+ /** {@inheritDoc} */
+ public void warn( CharSequence content, Throwable error )
+ {
+ print( "warn", content, error );
+ }
+
+ /** {@inheritDoc} */
+ public void warn( Throwable error )
+ {
+ print( "warn", error );
+ }
+
+ /** {@inheritDoc} */
+ public void error( CharSequence content )
+ {
+ System.err.println( "[error] " + content.toString() );
+ }
+
+ /** {@inheritDoc} */
+ public void error( CharSequence content, Throwable error )
+ {
+ StringWriter sWriter = new StringWriter();
+ PrintWriter pWriter = new PrintWriter( sWriter );
+
+ error.printStackTrace( pWriter );
+
+ System.err.println( "[error] " + content.toString() + "\n\n" + sWriter.toString() );
+ }
+
+ /**
+ * @see org.apache.maven.plugin.logging.Log#error(java.lang.Throwable)
+ */
+ public void error( Throwable error )
+ {
+ StringWriter sWriter = new StringWriter();
+ PrintWriter pWriter = new PrintWriter( sWriter );
+
+ error.printStackTrace( pWriter );
+
+ System.err.println( "[error] " + sWriter.toString() );
+ }
+
+ /**
+ * @see org.apache.maven.plugin.logging.Log#isDebugEnabled()
+ */
+ public boolean isDebugEnabled()
+ {
+ // TODO: Not sure how best to set these for this implementation...
+ return false;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.logging.Log#isInfoEnabled()
+ */
+ public boolean isInfoEnabled()
+ {
+ return true;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.logging.Log#isWarnEnabled()
+ */
+ public boolean isWarnEnabled()
+ {
+ return true;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.logging.Log#isErrorEnabled()
+ */
+ public boolean isErrorEnabled()
+ {
+ return true;
+ }
+
+ private void print( String prefix, CharSequence content )
+ {
+ sb.append( "[" + prefix + "] " ).append( content.toString() ).append( "\n" );
+ }
+
+ private void print( String prefix, Throwable error )
+ {
+ StringWriter sWriter = new StringWriter();
+ PrintWriter pWriter = new PrintWriter( sWriter );
+
+ error.printStackTrace( pWriter );
+
+ sb.append( "[" + prefix + "] " ).append( sWriter.toString() ).append( "\n" );
+ }
+
+ private void print( String prefix, CharSequence content, Throwable error )
+ {
+ StringWriter sWriter = new StringWriter();
+ PrintWriter pWriter = new PrintWriter( sWriter );
+
+ error.printStackTrace( pWriter );
+
+ sb.append( "[" + prefix + "] " ).append( content.toString() ).append( "\n\n" )
+ .append( sWriter.toString() ).append( "\n" );
+ }
+
+ protected String getContent()
+ {
+ return sb.toString();
+ }
+ }
+}
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestAnalyzeDuplicateMojo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestAnalyzeDuplicateMojo.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependencies2ProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependencies2ProjectStub.java?rev=763406&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependencies2ProjectStub.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependencies2ProjectStub.java Wed Apr 8 21:31:43 2009
@@ -0,0 +1,69 @@
+package org.apache.maven.plugin.dependency.testUtils.stubs;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 java.io.FileReader;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
+
+/**
+ * very simple stub of maven project, going to take a lot of work to make it
+ * useful as a stub though
+ */
+public class DuplicateDependencies2ProjectStub
+ extends MavenProjectStub
+{
+ public DuplicateDependencies2ProjectStub()
+ {
+ File pom = new File( getBasedir(), "plugin-config2.xml" );
+ MavenXpp3Reader pomReader = new MavenXpp3Reader();
+ Model model = null;
+
+ try
+ {
+ model = pomReader.read( new FileReader( pom ) );
+ setModel( model );
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( e );
+ }
+
+ setGroupId( model.getGroupId() );
+ setArtifactId( model.getArtifactId() );
+ setVersion( model.getVersion() );
+ setName( model.getName() );
+ setUrl( model.getUrl() );
+ setPackaging( model.getPackaging() );
+ setFile( pom );
+ }
+
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getBasedir()
+ */
+ public File getBasedir()
+ {
+ return new File( super.getBasedir() + "/src/test/resources/unit/duplicate-dependencies" );
+ }
+}
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependencies2ProjectStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependencies2ProjectStub.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependenciesProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependenciesProjectStub.java?rev=763406&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependenciesProjectStub.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependenciesProjectStub.java Wed Apr 8 21:31:43 2009
@@ -0,0 +1,69 @@
+package org.apache.maven.plugin.dependency.testUtils.stubs;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 java.io.FileReader;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
+
+/**
+ * very simple stub of maven project, going to take a lot of work to make it
+ * useful as a stub though
+ */
+public class DuplicateDependenciesProjectStub
+ extends MavenProjectStub
+{
+ public DuplicateDependenciesProjectStub()
+ {
+ File pom = new File( getBasedir(), "plugin-config.xml" );
+ MavenXpp3Reader pomReader = new MavenXpp3Reader();
+ Model model = null;
+
+ try
+ {
+ model = pomReader.read( new FileReader( pom ) );
+ setModel( model );
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( e );
+ }
+
+ setGroupId( model.getGroupId() );
+ setArtifactId( model.getArtifactId() );
+ setVersion( model.getVersion() );
+ setName( model.getName() );
+ setUrl( model.getUrl() );
+ setPackaging( model.getPackaging() );
+ setFile( pom );
+ }
+
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getBasedir()
+ */
+ public File getBasedir()
+ {
+ return new File( super.getBasedir() + "/src/test/resources/unit/duplicate-dependencies" );
+ }
+}
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependenciesProjectStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DuplicateDependenciesProjectStub.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config.xml?rev=763406&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config.xml Wed Apr 8 21:31:43 2009
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+
+ <groupId>com.mycompany.app</groupId>
+ <artifactId>my-mojo</artifactId>
+ <packaging>maven-plugin</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <name>my-mojo Maven Mojo</name>
+ <url>http://maven.apache.org</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <configuration>
+ <project implementation="org.apache.maven.plugin.dependency.testUtils.stubs.DuplicateDependenciesProjectStub"/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config2.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config2.xml?rev=763406&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config2.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config2.xml Wed Apr 8 21:31:43 2009
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+
+ <groupId>com.mycompany.app</groupId>
+ <artifactId>my-mojo</artifactId>
+ <packaging>maven-plugin</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <name>my-mojo Maven Mojo</name>
+ <url>http://maven.apache.org</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <configuration>
+ <project implementation="org.apache.maven.plugin.dependency.testUtils.stubs.DuplicateDependencies2ProjectStub"/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config2.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/duplicate-dependencies/plugin-config2.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision