From commitsypena@example.com Mon Oct 02 12:08:12 2006 Return-Path: <commitsypena@example.com> Delivered-To: ypena@example.com Received: (qmail 13328 invoked from network); 2 Oct 2006 12:08:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 12:08:11 -0000 Received: (qmail 24589 invoked by uid 500); 2 Oct 2006 12:08:11 -0000 Delivered-To: ypena@example.com Received: (qmail 24410 invoked by uid 500); 2 Oct 2006 12:08:10 -0000 Mailing-List: contact ypena@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:ypena@example.com> List-Unsubscribe: <mailto:ypena@example.com> List-Post: <mailto:ypena@example.com> List-Id: <commits.maven.apache.org> Reply-To: ypena@example.com Delivered-To: mailing list ypena@example.com Received: (qmail 24397 invoked by uid 99); 2 Oct 2006 12:08:10 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 05:08:10 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [83.161.120.155] ([83.161.120.155:54813] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id 7E/08-16499-32101254 for <ypena@example.com>; Mon, 02 Oct 2006 05:08:09 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id AF0831A981A; Mon, 2 Oct 2006 05:07:58 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r451991 - in /maven/sandbox/plugins: maven-csharp-source-plugin/pom.xml pom.xml Date: Mon, 02 Oct 2006 12:07:58 -0000 To: ypena@example.com From: ypena@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <ypena@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jstrachan Date: Mon Oct 2 05:07:57 2006 New Revision: 451991 URL: http://svn.apache.org/viewvc?view=rev&rev=451991 Log: Fixed up the pom for building the csharp plugins Modified: maven/sandbox/plugins/maven-csharp-source-plugin/pom.xml maven/sandbox/plugins/pom.xml Modified: maven/sandbox/plugins/maven-csharp-source-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-csharp-source-plugin/pom.xml?view=diff&rev=451991&r1=451990&r2=451991 ============================================================================== --- maven/sandbox/plugins/maven-csharp-source-plugin/pom.xml (original) +++ maven/sandbox/plugins/maven-csharp-source-plugin/pom.xml Mon Oct 2 05:07:57 2006 @@ -48,7 +48,7 @@ <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-csharp-helper-plugin</artifactId> - <version>1.0.RC6-SNAPSHOT</version> + <version>1.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.codehaus.plexus</groupId> Modified: maven/sandbox/plugins/pom.xml URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/pom.xml?view=diff&rev=451991&r1=451990&r2=451991 ============================================================================== --- maven/sandbox/plugins/pom.xml (original) +++ maven/sandbox/plugins/pom.xml Mon Oct 2 05:07:57 2006 @@ -1 +1,17 @@ -<project> <modelVersion>4.0.0</modelVersion> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugins-sandbox</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> <modules> <module>maven-csharp-helper-plugin</module> <module>maven-csharp-lifecycle-plugin</module> <module>maven-csharp-package-plugin</module> <module>maven-csharp-source-plugin</module> </modules> </project> \ No newline at end of file +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugins-sandbox</artifactId> + <packaging>pom</packaging> + <version>1.0-SNAPSHOT</version> + + <modules> + <module>maven-csharp-helper-plugin</module> + <module>maven-csharp-lifecycle-plugin</module> + <module>maven-csharp-package-plugin</module> + <module>maven-csharp-source-plugin</module> + <module>maven-nunit-plugin</module> + <module>maven-vstudio-plugin</module> + </modules> + +</project> \ No newline at end of file From commitsypena@example.com Mon Oct 02 18:39:45 2006 Return-Path: <commitsypena@example.com> Delivered-To: ypena@example.com Received: (qmail 25697 invoked from network); 2 Oct 2006 18:39:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 18:39:45 -0000 Received: (qmail 4921 invoked by uid 500); 2 Oct 2006 18:39:44 -0000 Delivered-To: ypena@example.com Received: (qmail 4854 invoked by uid 500); 2 Oct 2006 18:39:44 -0000 Mailing-List: contact ypena@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:ypena@example.com> List-Unsubscribe: <mailto:ypena@example.com> List-Post: <mailto:ypena@example.com> List-Id: <commits.maven.apache.org> Reply-To: ypena@example.com Delivered-To: mailing list ypena@example.com Received: (qmail 4841 invoked by uid 99); 2 Oct 2006 18:39:43 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 11:39:43 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [83.161.120.155] ([83.161.120.155:52088] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id 78/C4-24395-EEC51254 for <ypena@example.com>; Mon, 02 Oct 2006 11:39:43 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id B13B71A981A; Mon, 2 Oct 2006 11:39:39 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r452168 - /maven/plugins/trunk/maven-ear-plugin/pom.xml Date: Mon, 02 Oct 2006 18:39:39 -0000 To: ypena@example.com From: ypena@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <ypena@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: snicoll Date: Mon Oct 2 11:39:38 2006 New Revision: 452168 URL: http://svn.apache.org/viewvc?view=rev&rev=452168 Log: Added testing harness dependency. Modified: maven/plugins/trunk/maven-ear-plugin/pom.xml Modified: maven/plugins/trunk/maven-ear-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/pom.xml?view=diff&rev=452168&r1=452167&r2=452168 ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-ear-plugin/pom.xml Mon Oct 2 11:39:38 2006 @@ -63,6 +63,12 @@ <artifactId>plexus-utils</artifactId> <version>1.2</version> </dependency> + <dependency> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-plugin-testing-harness</artifactId> + <version>1.0-beta-2-SNAPSHOT</version> + <scope>test</scope> + </dependency> </dependencies> </project> From commitsypena@example.com Mon Oct 02 19:20:40 2006 Return-Path: <commitsypena@example.com> Delivered-To: ypena@example.com Received: (qmail 44968 invoked from network); 2 Oct 2006 19:20:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 19:20:40 -0000 Received: (qmail 82879 invoked by uid 500); 2 Oct 2006 19:20:37 -0000 Delivered-To: ypena@example.com Received: (qmail 82708 invoked by uid 500); 2 Oct 2006 19:20:37 -0000 Mailing-List: contact ypena@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:ypena@example.com> List-Unsubscribe: <mailto:ypena@example.com> List-Post: <mailto:ypena@example.com> List-Id: <commits.maven.apache.org> Reply-To: ypena@example.com Delivered-To: mailing list ypena@example.com Received: (qmail 82695 invoked by uid 99); 2 Oct 2006 19:20:37 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 12:20:37 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [83.161.120.155] ([83.161.120.155:58428] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id B3/E5-24395-28661254 for <ypena@example.com>; Mon, 02 Oct 2006 12:20:36 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 97D531A981A; Mon, 2 Oct 2006 12:20:32 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r452177 - /maven/plugins/trunk/maven-ear-plugin/pom.xml Date: Mon, 02 Oct 2006 19:20:32 -0000 To: ypena@example.com From: ypena@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <ypena@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: snicoll Date: Mon Oct 2 12:20:31 2006 New Revision: 452177 URL: http://svn.apache.org/viewvc?view=rev&rev=452177 Log: Revert to 2.0.1 to fix localRepository issue. Modified: maven/plugins/trunk/maven-ear-plugin/pom.xml Modified: maven/plugins/trunk/maven-ear-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/pom.xml?view=diff&rev=452177&r1=452176&r2=452177 ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-ear-plugin/pom.xml Mon Oct 2 12:20:31 2006 @@ -17,41 +17,42 @@ <url>http://jira.codehaus.org/browse/MEAR</url> </issueManagement> <dependencies> - <dependency> + <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-project</artifactId> - <version>2.0.4</version> + <version>2.0.1</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-settings</artifactId> - <version>2.0.4</version> + <version>2.0.1</version> + <scope>test</scope> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> - <version>2.0.4</version> + <version>2.0.1</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-model</artifactId> - <version>2.0.4</version> + <version>2.0.1</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-artifact-manager</artifactId> - <version>2.0.4</version> + <version>2.0.1</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-embedder</artifactId> - <version>2.0.4</version> + <version>2.0.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-artifact</artifactId> - <version>2.0.4</version> + <version>2.0.1</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> @@ -61,7 +62,7 @@ <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> - <version>1.2</version> + <version>1.0.5</version> </dependency> <dependency> <groupId>org.apache.maven.shared</groupId> From commitsypena@example.com Tue Oct 03 04:03:18 2006 Return-Path: <commitsypena@example.com> Delivered-To: ypena@example.com Received: (qmail 75242 invoked from network); 3 Oct 2006 04:03:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Oct 2006 04:03:18 -0000 Received: (qmail 5331 invoked by uid 500); 3 Oct 2006 04:03:17 -0000 Delivered-To: ypena@example.com Received: (qmail 5301 invoked by uid 500); 3 Oct 2006 04:03:17 -0000 Mailing-List: contact ypena@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:ypena@example.com> List-Unsubscribe: <mailto:ypena@example.com> List-Post: <mailto:ypena@example.com> List-Id: <commits.maven.apache.org> Reply-To: ypena@example.com Delivered-To: mailing list ypena@example.com Received: (qmail 5288 invoked by uid 99); 3 Oct 2006 04:03:16 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 21:03:16 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [83.161.120.155] ([83.161.120.155:57972] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id 0A/95-29668-FF0E1254 for <ypena@example.com>; Mon, 02 Oct 2006 21:03:11 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 740EE1A981A; Mon, 2 Oct 2006 21:03:08 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r452307 - in /maven/plugins/trunk/maven-dependency-plugin: ./ src/main/java/org/apache/maven/plugin/dependency/ src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ src/main/java/org/apache/maven/plugin/dependency/resolvers/ ... Date: Tue, 03 Oct 2006 04:03:07 -0000 To: ypena@example.com From: ypena@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <ypena@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: brianf Date: Mon Oct 2 21:03:06 2006 New Revision: 452307 URL: http://svn.apache.org/viewvc?view=rev&rev=452307 Log: more tests Added: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestFilterArtifacts.java Modified: maven/plugins/trunk/maven-dependency-plugin/pom.xml maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/FilterArtifacts.java maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ScopeFilter.java maven/plugins/trunk/maven-dependency-plugin/src/site/fml/faq.fml maven/plugins/trunk/maven-dependency-plugin/src/site/site.xml maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestResolveMojo.java maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestMarkerFileFilter.java maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestScopeFilter.java maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTransitivityFilter.java maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-dependencies-test/plugin-config.xml Modified: maven/plugins/trunk/maven-dependency-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/pom.xml?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-dependency-plugin/pom.xml Mon Oct 2 21:03:06 2006 @@ -10,7 +10,7 @@ <artifactId>maven-dependency-plugin</artifactId> <packaging>maven-plugin</packaging> <name>Dependency Maven Plugin</name> - <version>2.0-ALPHA-1</version> + <version>2.0-ALPHA-1-SNAPSHOT</version> <prerequisites> <maven>2.0.3</maven> </prerequisites> Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java Mon Oct 2 21:03:06 2006 @@ -144,7 +144,7 @@ Set artifacts = project.getArtifacts(); //perform filtering - artifacts = filter.filter( artifacts, log ); + artifacts = filter.filter( artifacts, getLog() ); //transform artifacts if classifier is set DependencyStatusSets status = null; @@ -172,7 +172,7 @@ if ( StringUtils.isNotEmpty( classifier ) ) { ArtifactTranslator translator = new ClassifierTypeTranslator( this.classifier, this.type, this.factory ); - artifacts = translator.translate( artifacts, log ); + artifacts = translator.translate( artifacts, getLog() ); status = filterMarkedDependencies( artifacts ); @@ -182,7 +182,7 @@ //resolve the rest of the artifacts ArtifactsResolver artifactsResolver = new DefaultArtifactsResolver( this.resolver, this.local, this.remoteRepos, stopOnFailure ); - resolvedArtifacts = artifactsResolver.resolve( artifacts, log ); + resolvedArtifacts = artifactsResolver.resolve( artifacts, getLog() ); //calculate the artifacts not resolved. unResolvedArtifacts.addAll( artifacts ); @@ -205,7 +205,7 @@ filter.addFilter( new MarkerFileFilter( this.overWriteReleases, this.overWriteSnapshots, this.overWriteIfNewer, this.markersDirectory ) ); - Set unMarkedArtifacts = filter.filter( artifacts, log ); + Set unMarkedArtifacts = filter.filter( artifacts, getLog() ); //calculate the skipped artifacts Set skippedArtifacts = new HashSet(); Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java Mon Oct 2 21:03:06 2006 @@ -93,25 +93,22 @@ */ protected boolean silent; - protected Log log; - - public AbstractDependencyMojo () - { - if (silent) - { - log = new SilentLog(); - } - else - { - log = super.getLog(); - } - } + private Log log; /** * @return Returns the log. */ public Log getLog() { + if (silent) + { + log = new SilentLog(); + } + else + { + log = super.getLog(); + } + return this.log; } Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java Mon Oct 2 21:03:06 2006 @@ -30,7 +30,6 @@ * Goal that retrieves a list of artifacts from the repository and unpacks them in a defined location. * * @goal unpack - * * @phase process-sources * @author brianf */ Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java Mon Oct 2 21:03:06 2006 @@ -50,7 +50,7 @@ //get sets of dependencies results = this.getDependencySets(); - results.logStatus(log, outputArtifactFilename); + results.logStatus(getLog(), outputArtifactFilename); } /** Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/FilterArtifacts.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/FilterArtifacts.java?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/FilterArtifacts.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/FilterArtifacts.java Mon Oct 2 21:03:06 2006 @@ -88,14 +88,19 @@ return artifacts; } - private void log(Set artifacts, Log log) - { - log.debug("Artifacts:"); - Iterator iter = artifacts.iterator(); - while (iter.hasNext()) - { - Artifact artifact = (Artifact) iter.next(); - log.debug(""+artifact); - } - } +/** + * @return Returns the filters. + */ +public ArrayList getFilters() +{ + return this.filters; +} + +/** + * @param filters The filters to set. + */ +public void setFilters( ArrayList filters ) +{ + this.filters = filters; +} } Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ScopeFilter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ScopeFilter.java?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ScopeFilter.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ScopeFilter.java Mon Oct 2 21:03:06 2006 @@ -40,42 +40,71 @@ } /** - * This function determines if filtering needs to be performed. Excludes are ignored if Includes are used. + * This function determines if filtering needs to be performed. Excludes are + * ignored if Includes are used. + * * @param dependencies - * the set of dependencies to filter. + * the set of dependencies to filter. * * @return a Set of filtered dependencies. - * @throws MojoExecutionException + * @throws MojoExecutionException */ - public Set filter( Set artifacts, Log log ) throws MojoExecutionException + public Set filter( Set artifacts, Log log ) + throws MojoExecutionException { Set results = artifacts; if ( StringUtils.isNotEmpty( includeScope ) ) { + if (!Artifact.SCOPE_COMPILE.equals(includeScope)&& + !Artifact.SCOPE_TEST.equals(includeScope)&& + !Artifact.SCOPE_PROVIDED.equals(includeScope)&& + !Artifact.SCOPE_RUNTIME.equals(includeScope)&& + !Artifact.SCOPE_SYSTEM.equals(includeScope)) + { + throw new MojoExecutionException("Invalid Scope in includeScope: "+ includeScope); + } + results = new HashSet(); - ScopeArtifactFilter saf = new ScopeArtifactFilter( includeScope ); - Iterator iter = artifacts.iterator(); - while ( iter.hasNext() ) + if ( Artifact.SCOPE_PROVIDED.equals( includeScope ) || Artifact.SCOPE_SYSTEM.equals( includeScope ) ) + { + results = includeSingleScope( artifacts, includeScope ); + } + else { - Artifact artifact = (Artifact) iter.next(); - if ( saf.include( artifact ) ) + ScopeArtifactFilter saf = new ScopeArtifactFilter( includeScope ); + + Iterator iter = artifacts.iterator(); + while ( iter.hasNext() ) { - results.add( artifact ); + Artifact artifact = (Artifact) iter.next(); + if ( saf.include( artifact ) ) + { + results.add( artifact ); + } } } } else if ( StringUtils.isNotEmpty( excludeScope ) ) { + if (!Artifact.SCOPE_COMPILE.equals(excludeScope)&& + !Artifact.SCOPE_TEST.equals(excludeScope)&& + !Artifact.SCOPE_PROVIDED.equals(excludeScope)&& + !Artifact.SCOPE_RUNTIME.equals(excludeScope)&& + !Artifact.SCOPE_SYSTEM.equals(excludeScope)) + { + throw new MojoExecutionException("Invalid Scope in excludeScope: "+ excludeScope); + } results = new HashSet(); - //plexus ScopeArtifactFilter doesn't handle the provided scope so we - //need special handling for it. - if ( Artifact.SCOPE_TEST.equals(excludeScope)) + // plexus ScopeArtifactFilter doesn't handle the provided scope so + // we + // need special handling for it. + if ( Artifact.SCOPE_TEST.equals( excludeScope ) ) { - throw new MojoExecutionException(" Can't exclude Test scope, this will exclude everything."); + throw new MojoExecutionException( " Can't exclude Test scope, this will exclude everything." ); } - else if ( !Artifact.SCOPE_PROVIDED.equals( excludeScope ) ) + else if ( !Artifact.SCOPE_PROVIDED.equals( excludeScope ) && !Artifact.SCOPE_SYSTEM.equals( excludeScope ) ) { ScopeArtifactFilter saf = new ScopeArtifactFilter( excludeScope ); @@ -91,19 +120,40 @@ } else { - Iterator iter = artifacts.iterator(); - while ( iter.hasNext() ) - { - Artifact artifact = (Artifact) iter.next(); - if ( !Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ) ) - { - results.add( artifact ); - } - } + excludeSingleScope( artifacts, excludeScope ); } + } + return results; + } + + private Set includeSingleScope( Set artifacts, String scope ) + { + HashSet results = new HashSet(); + Iterator iter = artifacts.iterator(); + while ( iter.hasNext() ) + { + Artifact artifact = (Artifact) iter.next(); + if ( scope.equals( artifact.getScope() ) ) + { + results.add( artifact ); + } } + return results; + } + private Set excludeSingleScope( Set artifacts, String scope ) + { + HashSet results = new HashSet(); + Iterator iter = artifacts.iterator(); + while ( iter.hasNext() ) + { + Artifact artifact = (Artifact) iter.next(); + if ( !scope.equals( artifact.getScope() ) ) + { + results.add( artifact ); + } + } return results; } @@ -116,7 +166,8 @@ } /** - * @param includeScope The includeScope to set. + * @param includeScope + * The includeScope to set. */ public void setIncludeScope( String scope ) { @@ -132,7 +183,8 @@ } /** - * @param excludeScope The excludeScope to set. + * @param excludeScope + * The excludeScope to set. */ public void setExcludeScope( String excludeScope ) { Modified: maven/plugins/trunk/maven-dependency-plugin/src/site/fml/faq.fml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/site/fml/faq.fml?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/site/fml/faq.fml (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/site/fml/faq.fml Mon Oct 2 21:03:06 2006 @@ -7,7 +7,7 @@ <p> Actually, they are the same, it's just that it was moved and renamed. The dependency-maven-plugin is hosted at Mojo while maven-dependency-plugin is ypena@example.com. The recommended - plugin to use is the maven-dependency-plugin. + plugin to use is the maven-dependency-plugin. </p> </answer> </faq> Modified: maven/plugins/trunk/maven-dependency-plugin/src/site/site.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/site/site.xml?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/site/site.xml (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/site/site.xml Mon Oct 2 21:03:06 2006 @@ -20,7 +20,7 @@ <project name="Maven Dependency Plugin"> <bannerLeft> - <name>Maven Rar Plugin</name> + <name>Maven Dependency Plugin</name> <src>http://maven.apache.org/images/apache-maven-project.png</src> <href>http://maven.apache.org/</href> </bannerLeft> Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java Mon Oct 2 21:03:06 2006 @@ -28,6 +28,8 @@ File testPom = new File( getBasedir(), "target/test-classes/unit/copy-dependencies-test/plugin-config.xml" ); CopyDependenciesMojo mojo = (CopyDependenciesMojo) lookupMojo( "copy-dependencies", testPom ); mojo.outputDirectory = new File( this.testDir, "outputDirectory" ); + // mojo.silent = true; + assertNotNull( mojo ); assertNotNull( mojo.project ); MavenProject project = mojo.project; @@ -53,7 +55,6 @@ { CopyDependenciesMojo mojo = getNewMojo(); mojo.execute(); - Iterator iter = mojo.project.getArtifacts().iterator(); while ( iter.hasNext() ) { @@ -247,6 +248,7 @@ mojo.project.setArtifacts( stubFactory.getScopedArtifacts() ); mojo.project.setDependencyArtifacts( new HashSet() ); mojo.includeScope = "test"; + mojo.execute(); ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope ); @@ -289,17 +291,15 @@ mojo.project.setArtifacts( stubFactory.getScopedArtifacts() ); mojo.project.setDependencyArtifacts( new HashSet() ); mojo.includeScope = "provided"; + mojo.execute(); - ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope ); - Iterator iter = mojo.project.getArtifacts().iterator(); while ( iter.hasNext() ) { Artifact artifact = (Artifact) iter.next(); String fileName = DependencyUtil.getFormattedFileName( artifact, false ); File file = new File( mojo.outputDirectory, fileName ); - - assertEquals( saf.include( artifact ), file.exists() ); + assertEquals( Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ), file.exists() ); } } @@ -310,8 +310,8 @@ mojo.project.setArtifacts( stubFactory.getScopedArtifacts() ); mojo.project.setDependencyArtifacts( new HashSet() ); mojo.includeScope = "system"; + mojo.execute(); - ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope ); Iterator iter = mojo.project.getArtifacts().iterator(); while ( iter.hasNext() ) @@ -320,7 +320,7 @@ String fileName = DependencyUtil.getFormattedFileName( artifact, false ); File file = new File( mojo.outputDirectory, fileName ); - assertEquals( saf.include( artifact ), file.exists() ); + assertEquals( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ), file.exists() ); } } } Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestResolveMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestResolveMojo.java?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestResolveMojo.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestResolveMojo.java Mon Oct 2 21:03:06 2006 @@ -30,7 +30,7 @@ { File testPom = new File( getBasedir(), "target/test-classes/unit/resolve-test/plugin-config.xml" ); ResolveDependenciesMojo mojo = (ResolveDependenciesMojo) lookupMojo( "resolve", testPom ); - + mojo.silent = false; assertNotNull( mojo ); assertNotNull(mojo.project); MavenProject project = mojo.project; Added: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestFilterArtifacts.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestFilterArtifacts.java?view=auto&rev=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestFilterArtifacts.java (added) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestFilterArtifacts.java Mon Oct 2 21:03:06 2006 @@ -0,0 +1,79 @@ +/* + * Copyright 2005-2006 Brian Fox (ypena@example.com) + * + * 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. + */ +/** + * + */ +package org.apache.maven.plugin.dependency.utils.filters; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; + +import junit.framework.TestCase; + +import org.apache.maven.plugin.dependency.utils.SilentLog; +import org.apache.maven.plugin.logging.Log; + +/** + * @author brianf + * + */ +public class TestFilterArtifacts + extends TestCase +{ + Log log = new SilentLog(); + protected void setUp() + throws Exception + { + super.setUp(); + } + + public void testArtifactFilter() + { + Set a = new HashSet(); + FilterArtifacts fa = new FilterArtifacts(); + ArtifactsFilter scope = new ScopeFilter("compile","system"); + ArtifactsFilter type = new TypeFilter("jar","war"); + ArtifactsFilter trans = new TransitivityFilter(a,true); + + assertEquals(0,fa.getFilters().size()); + fa.addFilter(scope); + assertEquals(1,fa.getFilters().size()); + fa.addFilter(type); + assertEquals(2,fa.getFilters().size()); + assertTrue(fa.getFilters().get(0) instanceof ScopeFilter ); + assertTrue(fa.getFilters().get(1) instanceof TypeFilter ); + fa.addFilter(1,trans); + assertEquals(3,fa.getFilters().size()); + assertTrue(fa.getFilters().get(0) instanceof ScopeFilter ); + assertTrue(fa.getFilters().get(1) instanceof TransitivityFilter ); + assertTrue(fa.getFilters().get(2) instanceof TypeFilter ); + + ArrayList list = new ArrayList(); + list.addAll(fa.getFilters()); + + fa.clearFilters(); + assertEquals(0,fa.getFilters().size()); + + fa.setFilters(list); + assertEquals(3,fa.getFilters().size()); + assertTrue(fa.getFilters().get(0) instanceof ScopeFilter ); + assertTrue(fa.getFilters().get(1) instanceof TransitivityFilter ); + assertTrue(fa.getFilters().get(2) instanceof TypeFilter ); + + } + + } Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestMarkerFileFilter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestMarkerFileFilter.java?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestMarkerFileFilter.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestMarkerFileFilter.java Mon Oct 2 21:03:06 2006 @@ -144,5 +144,25 @@ assertFalse(outputFolder.exists()); } + public void testGettersSetters() + { + MarkerFileFilter filter = new MarkerFileFilter(true,false,true,outputFolder); + assertEquals(true,filter.isOverWriteReleases()); + assertEquals(false,filter.isOverWriteSnapshots()); + assertEquals(true,filter.isOverWriteIfNewer()); + assertEquals(outputFolder,filter.getMarkerFileDirectory()); + + filter.setOverWriteReleases(false); + filter.setOverWriteSnapshots(true); + filter.setOverWriteIfNewer(false); + File file = new File(outputFolder,"child"); + filter.setMarkerFileDirectory(file); + assertEquals(false,filter.isOverWriteReleases()); + assertEquals(true,filter.isOverWriteSnapshots()); + assertEquals(false,filter.isOverWriteIfNewer()); + assertEquals(file,filter.getMarkerFileDirectory()); + + + } } Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestScopeFilter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestScopeFilter.java?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestScopeFilter.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestScopeFilter.java Mon Oct 2 21:03:06 2006 @@ -19,23 +19,20 @@ package org.apache.maven.plugin.dependency.utils.filters; import java.util.HashSet; +import java.util.Iterator; import java.util.Set; import junit.framework.TestCase; import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.DefaultArtifact; -import org.apache.maven.artifact.handler.ArtifactHandler; -import org.apache.maven.artifact.handler.DefaultArtifactHandler; -import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.logging.Log; import org.apache.maven.plugin.dependency.utils.ArtifactStubFactory; import org.apache.maven.plugin.dependency.utils.SilentLog; +import org.apache.maven.plugin.logging.Log; /** * @author brianf - * + * */ public class TestScopeFilter extends TestCase @@ -49,123 +46,166 @@ { super.setUp(); - ArtifactStubFactory factory = new ArtifactStubFactory (null,false); + ArtifactStubFactory factory = new ArtifactStubFactory( null, false ); artifacts = factory.getScopedArtifacts(); } - public void testScopeFilter() + public void testScopeCompile() + throws MojoExecutionException { ScopeFilter filter = new ScopeFilter( Artifact.SCOPE_COMPILE, null ); Set result; - try - { - result = filter.filter( artifacts, log ); - assertEquals( 3, result.size() ); - } - catch ( MojoExecutionException e ) - { - assertTrue( true ); - } + + result = filter.filter( artifacts, log ); + assertEquals( 3, result.size() ); + } - public void testScopeFilter2() + public void testScopeRuntime() + throws MojoExecutionException { ScopeFilter filter = new ScopeFilter( Artifact.SCOPE_RUNTIME, null ); Set result; - try - { - result = filter.filter( artifacts, log ); - assertEquals( 2, result.size() ); - } - catch ( MojoExecutionException e ) - { - assertTrue( false ); - } + result = filter.filter( artifacts, log ); + assertEquals( 2, result.size() ); + } - public void testScopeFilter3() + public void testScopeTest() + throws MojoExecutionException { - try - { - ScopeFilter filter = new ScopeFilter( Artifact.SCOPE_TEST, null ); - Set result = filter.filter( artifacts, log ); - assertEquals( 5, result.size() ); - } - catch ( MojoExecutionException e ) - { - assertTrue( false ); - } + ScopeFilter filter = new ScopeFilter( Artifact.SCOPE_TEST, null ); + Set result = filter.filter( artifacts, log ); + assertEquals( 5, result.size() ); } - public void testScopeFilterNull() + public void testScopeProvided() + throws MojoExecutionException { - try + + ScopeFilter filter = new ScopeFilter( Artifact.SCOPE_PROVIDED, null ); + Set result = filter.filter( artifacts, log ); + Iterator iter = result.iterator(); + assertTrue( result.size() > 0 ); + while ( iter.hasNext() ) { - ScopeFilter filter = new ScopeFilter( null, null ); - Set result = filter.filter( artifacts, log ); - assertEquals( 5, result.size() ); + Artifact artifact = (Artifact) iter.next(); + assertEquals( Artifact.SCOPE_PROVIDED, artifact.getScope() ); } - catch ( MojoExecutionException e ) + } + + public void testScopeSystem() + throws MojoExecutionException + { + + ScopeFilter filter = new ScopeFilter( Artifact.SCOPE_SYSTEM, null ); + Set result = filter.filter( artifacts, log ); + Iterator iter = result.iterator(); + assertTrue( result.size() > 0 ); + while ( iter.hasNext() ) { - assertTrue( false ); + Artifact artifact = (Artifact) iter.next(); + assertEquals( Artifact.SCOPE_SYSTEM, artifact.getScope() ); } + } + public void testScopeFilterNull() + throws MojoExecutionException + { + ScopeFilter filter = new ScopeFilter( null, null ); + Set result = filter.filter( artifacts, log ); + assertEquals( 5, result.size() ); } public void testScopeFilterEmpty() + throws MojoExecutionException { - try - { - ScopeFilter filter = new ScopeFilter( "", "" ); - Set result = filter.filter( artifacts, log ); - assertEquals( 5, result.size() ); - } - catch ( MojoExecutionException e ) - { - assertTrue( false ); - } + ScopeFilter filter = new ScopeFilter( "", "" ); + Set result = filter.filter( artifacts, log ); + assertEquals( 5, result.size() ); } public void testExcludeProvided() + throws MojoExecutionException { - try + ScopeFilter filter = new ScopeFilter( "", Artifact.SCOPE_PROVIDED ); + Set result = filter.filter( artifacts, log ); + Iterator iter = result.iterator(); + while ( iter.hasNext() ) { - ScopeFilter filter = new ScopeFilter( "", Artifact.SCOPE_PROVIDED ); - Set result = filter.filter( artifacts, log ); - assertEquals( 4, result.size() ); + Artifact artifact = (Artifact) iter.next(); + assertFalse( Artifact.SCOPE_PROVIDED.equalsIgnoreCase( artifact.getScope() ) ); } - catch ( MojoExecutionException e ) + } + + public void testExcludeSystem() + throws MojoExecutionException + { + ScopeFilter filter = new ScopeFilter( "", Artifact.SCOPE_SYSTEM ); + Set result = filter.filter( artifacts, log ); + Iterator iter = result.iterator(); + while ( iter.hasNext() ) { - assertTrue( false ); + Artifact artifact = (Artifact) iter.next(); + assertFalse( Artifact.SCOPE_SYSTEM.equalsIgnoreCase( artifact.getScope() ) ); } } public void testExcludeCompile() + throws MojoExecutionException + { + ScopeFilter filter = new ScopeFilter( "", Artifact.SCOPE_COMPILE ); + Set result = filter.filter( artifacts, log ); + assertEquals( 2, result.size() ); + } + + public void testExcludeTest() { try { - ScopeFilter filter = new ScopeFilter( "", Artifact.SCOPE_COMPILE ); - Set result = filter.filter( artifacts, log ); - assertEquals( 2, result.size() ); + ScopeFilter filter = new ScopeFilter( "", Artifact.SCOPE_TEST ); + filter.filter( artifacts, log ); + fail( "Expected an Exception" ); } catch ( MojoExecutionException e ) { - assertTrue( false ); + } } - public void testExcludeTest() + public void testBadScope() { + ScopeFilter filter = new ScopeFilter( "cOmpile", "" ); try + { + filter.filter( artifacts, log ); + fail( "Expected an Exception" ); + } + catch ( MojoExecutionException e ) { - ScopeFilter filter = new ScopeFilter( "", Artifact.SCOPE_TEST ); - Set result = filter.filter( artifacts, log ); - assertTrue(false); + + } + try + { + filter = new ScopeFilter( "", "coMpile" ); + filter.filter( artifacts, log ); + fail( "Expected an Exception" ); } catch ( MojoExecutionException e ) { - //I expect an exception here. - assertTrue( true ); + } + } + + public void testSettersGetters() + { + ScopeFilter filter = new ScopeFilter("include","exclude"); + assertEquals("include",filter.getIncludeScope()); + assertEquals("exclude",filter.getExcludeScope()); + + filter.setExcludeScope("a"); + filter.setIncludeScope("b"); + assertEquals("b",filter.getIncludeScope()); + assertEquals("a",filter.getExcludeScope()); } } Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTransitivityFilter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTransitivityFilter.java?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTransitivityFilter.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTransitivityFilter.java Mon Oct 2 21:03:06 2006 @@ -66,8 +66,10 @@ public void testExclude() { - TransitivityFilter filter = new TransitivityFilter( directArtifacts, true ); - + TransitivityFilter filter = new TransitivityFilter( directArtifacts, false ); + assertFalse(filter.isExcludeTransitive()); + filter.setExcludeTransitive(true); + assertTrue(filter.isExcludeTransitive()); Set result = filter.filter( artifacts, log ); assertEquals( 2, result.size() ); Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-dependencies-test/plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-dependencies-test/plugin-config.xml?view=diff&rev=452307&r1=452306&r2=452307 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-dependencies-test/plugin-config.xml (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-dependencies-test/plugin-config.xml Mon Oct 2 21:03:06 2006 @@ -5,6 +5,7 @@ <artifactId>maven-dependency-plugin</artifactId> <configuration> <project implementation="org.apache.maven.plugin.dependency.stubs.DependencyProjectStub"/> + <silent>true</silent> </configuration> </plugin> </plugins> From commitsypena@example.com Tue Oct 03 11:31:52 2006 Return-Path: <commitsypena@example.com> Delivered-To: ypena@example.com Received: (qmail 31252 invoked from network); 3 Oct 2006 11:31:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Oct 2006 11:31:52 -0000 Received: (qmail 84856 invoked by uid 500); 3 Oct 2006 11:30:58 -0000 Delivered-To: ypena@example.com Received: (qmail 84816 invoked by uid 500); 3 Oct 2006 11:30:57 -0000 Mailing-List: contact ypena@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:ypena@example.com> List-Unsubscribe: <mailto:ypena@example.com> List-Post: <mailto:ypena@example.com> List-Id: <commits.maven.apache.org> Reply-To: ypena@example.com Delivered-To: mailing list ypena@example.com Received: (qmail 84796 invoked by uid 99); 3 Oct 2006 11:30:57 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2006 04:30:57 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [83.161.120.155] ([83.161.120.155:60530] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id 0C/4B-29668-80542254 for <ypena@example.com>; Tue, 03 Oct 2006 04:10:06 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id AD2D21A981A; Tue, 3 Oct 2006 04:08:43 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r452419 - /maven/plugins/trunk/maven-clover-plugin/src/site/apt/usage.apt Date: Tue, 03 Oct 2006 11:08:43 -0000 To: ypena@example.com From: ypena@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <ypena@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: vmassol Date: Tue Oct 3 04:08:42 2006 New Revision: 452419 URL: http://svn.apache.org/viewvc?view=rev&rev=452419 Log: MCLOVER-56: Add documentation about the clover:log goal Modified: maven/plugins/trunk/maven-clover-plugin/src/site/apt/usage.apt Modified: maven/plugins/trunk/maven-clover-plugin/src/site/apt/usage.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/site/apt/usage.apt?view=diff&rev=452419&r1=452418&r2=452419 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/src/site/apt/usage.apt (original) +++ maven/plugins/trunk/maven-clover-plugin/src/site/apt/usage.apt Tue Oct 3 04:08:42 2006 @@ -28,6 +28,8 @@ * {{{usage.html#Controlling files to instrument}Controlling files to instrument}} + * {{{usage.html#Getting information on an existing Clover database}Getting information on an existing Clover database}} + [] * {Generating a Clover report when generating the site} @@ -407,4 +409,23 @@ </excludes> [...] +--------- - \ No newline at end of file + +* {Getting information on an existing Clover database} + + You can dump information about your project's Clover database (after it has been populated) by running + <<<mvn clover:log>>>. + + Here's an example of an output: + ++-------- +[INFO] [clover:log] +[INFO] Clover Coverage Report +Coverage Timestamp: Tue Oct 03 12:54:52 CEST 2006 + + +Coverage Overview - + Methods: 2/3 (66,7%) + Statements: 2/3 (66,7%) + Conditionals: 1/2 (50%) + TOTAL: 62,5% ++--------- From commitsypena@example.com Tue Oct 03 12:50:25 2006 Return-Path: <commitsypena@example.com> Delivered-To: ypena@example.com Received: (qmail 65158 invoked from network); 3 Oct 2006 12:50:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Oct 2006 12:50:25 -0000 Received: (qmail 94288 invoked by uid 500); 3 Oct 2006 12:50:25 -0000 Delivered-To: ypena@example.com Received: (qmail 94052 invoked by uid 500); 3 Oct 2006 12:50:24 -0000 Mailing-List: contact ypena@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:ypena@example.com> List-Unsubscribe: <mailto:ypena@example.com> List-Post: <mailto:ypena@example.com> List-Id: <commits.maven.apache.org> Reply-To: ypena@example.com Delivered-To: mailing list ypena@example.com Received: (qmail 94039 invoked by uid 99); 3 Oct 2006 12:50:24 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2006 05:50:24 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [83.161.120.155] ([83.161.120.155:56251] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id DE/FB-29668-06C52254 for <ypena@example.com>; Tue, 03 Oct 2006 05:50:14 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 4B69D1A9820; Tue, 3 Oct 2006 05:49:03 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r452461 - /maven/shared/trunk/maven-plugin-testing-harness/pom.xml Date: Tue, 03 Oct 2006 12:49:03 -0000 To: ypena@example.com From: ypena@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <ypena@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: carlos Date: Tue Oct 3 05:49:02 2006 New Revision: 452461 URL: http://svn.apache.org/viewvc?view=rev&rev=452461 Log: Upgrade parent version Modified: maven/shared/trunk/maven-plugin-testing-harness/pom.xml Modified: maven/shared/trunk/maven-plugin-testing-harness/pom.xml URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-plugin-testing-harness/pom.xml?view=diff&rev=452461&r1=452460&r2=452461 ============================================================================== --- maven/shared/trunk/maven-plugin-testing-harness/pom.xml (original) +++ maven/shared/trunk/maven-plugin-testing-harness/pom.xml Tue Oct 3 05:49:02 2006 @@ -3,7 +3,7 @@ <parent> <artifactId>maven-shared-components</artifactId> <groupId>org.apache.maven.shared</groupId> - <version>1</version> + <version>3</version> </parent> <artifactId>maven-plugin-testing-harness</artifactId> <version>1.0-beta-2-SNAPSHOT</version> From commitsypena@example.com Tue Oct 03 14:45:05 2006 Return-Path: <commitsypena@example.com> Delivered-To: ypena@example.com Received: (qmail 12426 invoked from network); 3 Oct 2006 14:45:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Oct 2006 14:45:04 -0000 Received: (qmail 26896 invoked by uid 500); 3 Oct 2006 14:45:03 -0000 Delivered-To: ypena@example.com Received: (qmail 26859 invoked by uid 500); 3 Oct 2006 14:45:03 -0000 Mailing-List: contact ypena@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:ypena@example.com> List-Unsubscribe: <mailto:ypena@example.com> List-Post: <mailto:ypena@example.com> List-Id: <commits.maven.apache.org> Reply-To: ypena@example.com Delivered-To: mailing list ypena@example.com Received: (qmail 26845 invoked by uid 99); 3 Oct 2006 14:45:03 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2006 07:45:03 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [83.161.120.155] ([83.161.120.155:52986] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id AC/01-08153-C6772254 for <ypena@example.com>; Tue, 03 Oct 2006 07:45:00 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id E91CC1A981A; Tue, 3 Oct 2006 07:44:57 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r452517 - in /maven/plugins/trunk/maven-clover-plugin: ./ src/it/contexts/ src/it/contexts/src/ src/it/contexts/src/main/ src/it/contexts/src/main/java/ src/it/contexts/src/main/java/org/ src/it/contexts/src/main/java/org/apache/ src/it/con... Date: Tue, 03 Oct 2006 14:44:57 -0000 To: ypena@example.com From: ypena@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <ypena@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: vmassol Date: Tue Oct 3 07:44:56 2006 New Revision: 452517 URL: http://svn.apache.org/viewvc?view=rev&rev=452517 Log: MCLOVER-48: Add support for block contexts * Added usage of the invoker plugin to run integration tests automatically using the -Pintegration-tests profile * Started adding block context support Added: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt (with props) maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml (with props) maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java (with props) maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/maven/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/maven/plugin/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/maven/plugin/clover/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/maven/plugin/clover/samples/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/maven/plugin/clover/samples/contexts/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/maven/plugin/clover/samples/contexts/SimpleTest.java (with props) Modified: maven/plugins/trunk/maven-clover-plugin/pom.xml maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverCheckMojo.java maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverReportMojo.java Modified: maven/plugins/trunk/maven-clover-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/pom.xml?view=diff&rev=452517&r1=452516&r2=452517 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-clover-plugin/pom.xml Tue Oct 3 07:44:56 2006 @@ -129,4 +129,65 @@ <scope>test</scope> </dependency> </dependencies> + <profiles> + <profile> + <id>integration-tests</id> + <activation> + <property> + <name>integration-tests</name> + <value>true</value> + </property> + </activation> + <build> + <plugins> + <plugin> + <artifactId>maven-clean-plugin</artifactId> + <configuration> + <filesets> + <fileset> + <directory>src/it</directory> + <includes> + <include>**/target</include> + <include>**/build.log</include> + </includes> + </fileset> + </filesets> + </configuration> + </plugin> + <plugin> + <artifactId>maven-plugin-management-plugin</artifactId> + <executions> + <execution> + <id>handle-plugin-staging</id> + <goals> + <goal>stage</goal> + <goal>unstage</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-invoker-plugin</artifactId> + <configuration> + <debug>true</debug> + <projectsDirectory>src/it</projectsDirectory> + <pomIncludes> + <pomInclude>**/contexts/pom.xml</pomInclude> + </pomIncludes> + <postBuildHookScript>verify.bsh</postBuildHookScript> + </configuration> + <executions> + <execution> + <id>integration-test</id> + <phase>integration-test</phase> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> </project> Added: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt?view=auto&rev=452517 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt (added) +++ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt Tue Oct 3 07:44:56 2006 @@ -0,0 +1 @@ +clean install Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml?view=auto&rev=452517 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml (added) +++ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml Tue Oct 3 07:44:56 2006 @@ -0,0 +1,44 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clover-plugin-sample-simple</artifactId> + <packaging>jar</packaging> + <name>Maven Clover Plugin Contexts Sample</name> + <description>Maven Clover Plugin Contexts Sample</description> + <version>1.0-SNAPSHOT</version> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clover-plugin</artifactId> + <configuration> + + <!-- Verify that context filters work --> + <contextFilters>static</contextFilters> + + <targetPercentage>80%</targetPercentage> + + </configuration> + <executions> + <execution> + <id>main</id> + <phase>verify</phase> + <goals> + <goal>instrument</goal> + <goal>check</goal> + <goal>log</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java?view=auto&rev=452517 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java (added) +++ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java Tue Oct 3 07:44:56 2006 @@ -0,0 +1,41 @@ +/* + * Copyright 2006 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. + */ +package org.apache.maven.plugin.clover.samples.contexts; + +public class Simple +{ + static + { + System.getProperties(); + } + + public void someMethod1() + { + } + + public void someMethodToReduceStatementCoverage() + { + System.getProperties(); + } + + public void someMethod2(int i) + { + if (i == 2) + { + // Do nothing + } + } +} \ No newline at end of file Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/maven/plugin/clover/samples/contexts/SimpleTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/maven/plugin/clover/samples/contexts/SimpleTest.java?view=auto&rev=452517 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/maven/plugin/clover/samples/contexts/SimpleTest.java (added) +++ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/maven/plugin/clover/samples/contexts/SimpleTest.java Tue Oct 3 07:44:56 2006 @@ -0,0 +1,28 @@ +/* + * Copyright 2006 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. + */ +package org.apache.maven.plugin.clover.samples.contexts; + +import junit.framework.TestCase; + +public class SimpleTest extends TestCase +{ + public void testSomeMethod() + { + Simple simple = new Simple(); + simple.someMethod1(); + simple.someMethod2(1); + } +} \ No newline at end of file Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/maven/plugin/clover/samples/contexts/SimpleTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/java/org/apache/maven/plugin/clover/samples/contexts/SimpleTest.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Modified: maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverCheckMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverCheckMojo.java?view=diff&rev=452517&r1=452516&r2=452517 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverCheckMojo.java (original) +++ maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverCheckMojo.java Tue Oct 3 07:44:56 2006 @@ -45,6 +45,13 @@ private String targetPercentage; /** + * Comma or space separated list of Clover contexts (block, statement or method filers) to exclude when + * generating coverage reports. + * @parameter + */ + private String contextFilters; + + /** * {@inheritDoc} * @see org.apache.maven.plugin.clover.internal.AbstractCloverMojo#execute() * @throws MojoExecutionException when the TPC is below the threshold @@ -102,6 +109,11 @@ cloverPassTask.setHaltOnFailure( true ); cloverPassTask.setTarget( new Percentage( this.targetPercentage ) ); cloverPassTask.setFailureProperty( "clovercheckproperty" ); + + if ( this.contextFilters != null ) + { + cloverPassTask.setFilter( this.contextFilters ); + } try { Modified: maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverReportMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverReportMojo.java?view=diff&rev=452517&r1=452516&r2=452517 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverReportMojo.java (original) +++ maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverReportMojo.java Tue Oct 3 07:44:56 2006 @@ -127,6 +127,13 @@ private boolean generateHistorical; /** + * Comma or space separated list of Clover contexts (block, statement or method filers) to exclude when + * generating coverage reports. + * @parameter + */ + private String contextFilters; + + /** * <p>Note: This is passed by Maven and must not be configured by the user.</p> * * @component @@ -295,6 +302,10 @@ { CloverFormatType type = new CloverFormatType(); type.setType( format ); + if ( this.contextFilters != null ) + { + type.setFilter( contextFilters ); + } return type; } From commitsypena@example.com Tue Oct 03 15:05:57 2006 Return-Path: <commitsypena@example.com> Delivered-To: ypena@example.com Received: (qmail 20038 invoked from network); 3 Oct 2006 15:05:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Oct 2006 15:05:56 -0000 Received: (qmail 74927 invoked by uid 500); 3 Oct 2006 15:05:55 -0000 Delivered-To: ypena@example.com Received: (qmail 74879 invoked by uid 500); 3 Oct 2006 15:05:55 -0000 Mailing-List: contact ypena@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:ypena@example.com> List-Unsubscribe: <mailto:ypena@example.com> List-Post: <mailto:ypena@example.com> List-Id: <commits.maven.apache.org> Reply-To: ypena@example.com Delivered-To: mailing list ypena@example.com Received: (qmail 74866 invoked by uid 99); 3 Oct 2006 15:05:55 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2006 08:05:55 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [83.161.120.155] ([83.161.120.155:64381] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id F4/C1-08153-25C72254 for <ypena@example.com>; Tue, 03 Oct 2006 08:05:54 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 815041A981A; Tue, 3 Oct 2006 08:05:52 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r452524 - in /maven/sandbox/plugins/maven-invoker-plugin: ./ src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java Date: Tue, 03 Oct 2006 15:05:52 -0000 To: ypena@example.com From: ypena@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <ypena@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: vmassol Date: Tue Oct 3 08:05:51 2006 New Revision: 452524 URL: http://svn.apache.org/viewvc?view=rev&rev=452524 Log: MNG-2587: [maven-invoker-plugin] build.log file should not be placed inside the target/ directory The build.log file is now created in the project's top level dir (next to pom.xml). Another solution would be to create those build.log files in the calling project's target dir and name them with some unique name pointing to the project they're logging... Modified: maven/sandbox/plugins/maven-invoker-plugin/ (props changed) maven/sandbox/plugins/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java Propchange: maven/sandbox/plugins/maven-invoker-plugin/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 3 08:05:51 2006 @@ -0,0 +1 @@ +target Modified: maven/sandbox/plugins/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java?view=diff&rev=452524&r1=452523&r2=452524 ============================================================================== --- maven/sandbox/plugins/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java (original) +++ maven/sandbox/plugins/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java Tue Oct 3 08:05:51 2006 @@ -232,7 +232,7 @@ getLog().info( "Building: " + pom ); - final File outputLog = new File( basedir, "target/build.log" ); + final File outputLog = new File( basedir, "build.log" ); FileLogger logger = null; From commitsypena@example.com Tue Oct 03 21:22:18 2006 Return-Path: <commitsypena@example.com> Delivered-To: ypena@example.com Received: (qmail 67153 invoked from network); 3 Oct 2006 21:22:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Oct 2006 21:22:17 -0000 Received: (qmail 48456 invoked by uid 500); 3 Oct 2006 21:22:16 -0000 Delivered-To: ypena@example.com Received: (qmail 48409 invoked by uid 500); 3 Oct 2006 21:22:16 -0000 Mailing-List: contact ypena@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:ypena@example.com> List-Unsubscribe: <mailto:ypena@example.com> List-Post: <mailto:ypena@example.com> List-Id: <commits.maven.apache.org> Reply-To: ypena@example.com Delivered-To: mailing list ypena@example.com Received: (qmail 48396 invoked by uid 99); 3 Oct 2006 21:22:16 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2006 14:22:16 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [83.161.120.155] ([83.161.120.155:61151] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id D3/82-00170-784D2254 for <ypena@example.com>; Tue, 03 Oct 2006 14:22:15 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 487CB1A981A; Tue, 3 Oct 2006 14:22:13 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r452628 - in /maven/plugins/trunk/maven-clover-plugin/src/it/contexts: ./ goals.txt pom.xml src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java src/test/verifier/ src/test/verifier/verifications.xml Date: Tue, 03 Oct 2006 21:22:13 -0000 To: ypena@example.com From: ypena@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <ypena@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: vmassol Date: Tue Oct 3 14:22:12 2006 New Revision: 452628 URL: http://svn.apache.org/viewvc?view=rev&rev=452628 Log: MCLOVER-48: Add support for block contexts * Finished adding tests Added: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml (with props) Modified: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/ (props changed) maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 3 14:22:12 2006 @@ -0,0 +1,2 @@ +build.log +target Modified: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt?view=diff&rev=452628&r1=452627&r2=452628 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt (original) +++ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt Tue Oct 3 14:22:12 2006 @@ -1 +1 @@ -clean install +clean install site verifier:verify Modified: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml?view=diff&rev=452628&r1=452627&r2=452628 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml (original) +++ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml Tue Oct 3 14:22:12 2006 @@ -14,18 +14,28 @@ <scope>test</scope> </dependency> </dependencies> - <build> + <reporting> + <excludeDefaults>true</excludeDefaults> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-clover-plugin</artifactId> <configuration> - <!-- Verify that context filters work --> - <contextFilters>static</contextFilters> - - <targetPercentage>80%</targetPercentage> - + <contextFilters>try</contextFilters> + </configuration> + </plugin> + </plugins> + </reporting> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clover-plugin</artifactId> + <configuration> + <!-- Without the block filter the TPC is 50% and with it it's 57,1%. Thus we check for a TPC above of + 55% to verify the filter has been applied correctly --> + <targetPercentage>55%</targetPercentage> </configuration> <executions> <execution> @@ -34,7 +44,6 @@ <goals> <goal>instrument</goal> <goal>check</goal> - <goal>log</goal> </goals> </execution> </executions> Modified: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java?view=diff&rev=452628&r1=452627&r2=452628 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java (original) +++ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java Tue Oct 3 14:22:12 2006 @@ -17,18 +17,20 @@ public class Simple { - static - { - System.getProperties(); - } - public void someMethod1() { } public void someMethodToReduceStatementCoverage() { - System.getProperties(); + try + { + System.getProperties(); + } + finally + { + // We use a try/finally so that we can use a block context of + } } public void someMethod2(int i) Added: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml?view=auto&rev=452628 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml (added) +++ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml Tue Oct 3 14:22:12 2006 @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<verifications> + <files> + <file> + <location>target/site/clover/pkgs-summary.html</location> + <contains>57.1%</contains> + </file> + </files> +</verifications> Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" From commitsypena@example.com Tue Oct 03 21:30:19 2006 Return-Path: <commitsypena@example.com> Delivered-To: ypena@example.com Received: (qmail 69942 invoked from network); 3 Oct 2006 21:30:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Oct 2006 21:30:18 -0000 Received: (qmail 59982 invoked by uid 500); 3 Oct 2006 21:30:17 -0000 Delivered-To: ypena@example.com Received: (qmail 59941 invoked by uid 500); 3 Oct 2006 21:30:17 -0000 Mailing-List: contact ypena@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:ypena@example.com> List-Unsubscribe: <mailto:ypena@example.com> List-Post: <mailto:ypena@example.com> List-Id: <commits.maven.apache.org> Reply-To: ypena@example.com Delivered-To: mailing list ypena@example.com Received: (qmail 59928 invoked by uid 99); 3 Oct 2006 21:30:17 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2006 14:30:17 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [83.161.120.155] ([83.161.120.155:51159] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id FF/A2-00170-966D2254 for <ypena@example.com>; Tue, 03 Oct 2006 14:30:17 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 003551A981D; Tue, 3 Oct 2006 14:30:15 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r452632 - /maven/plugins/trunk/maven-clover-plugin/src/site/apt/usage.apt Date: Tue, 03 Oct 2006 21:30:14 -0000 To: ypena@example.com From: ypena@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <ypena@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: vmassol Date: Tue Oct 3 14:30:14 2006 New Revision: 452632 URL: http://svn.apache.org/viewvc?view=rev&rev=452632 Log: MCLOVER-48: Add support for block contexts * Added documentation on using block contexts Modified: maven/plugins/trunk/maven-clover-plugin/src/site/apt/usage.apt Modified: maven/plugins/trunk/maven-clover-plugin/src/site/apt/usage.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/site/apt/usage.apt?view=diff&rev=452632&r1=452631&r2=452632 ============================================================================== --- maven/plugins/trunk/maven-clover-plugin/src/site/apt/usage.apt (original) +++ maven/plugins/trunk/maven-clover-plugin/src/site/apt/usage.apt Tue Oct 3 14:30:14 2006 @@ -30,6 +30,8 @@ * {{{usage.html#Getting information on an existing Clover database}Getting information on an existing Clover database}} + * {{{usage.html#Using block contexts}Using block contexts}} + [] * {Generating a Clover report when generating the site} @@ -429,3 +431,22 @@ Conditionals: 1/2 (50%) TOTAL: 62,5% +--------- + +* {Using block contexts} + + Clover allows specifying {{{http://cenqua.com/clover/doc/adv/contexts.html}block contexts}} + (i.e. elements to be excluded from the Test Percentage Coverage). To configure a block context use + the <<<contextFilters>>> element. For example to exclude <<<try>>> and <<<static>>> block contexts, you would + write: + ++-------- +[...] + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clover-plugin</artifactId> + <configuration> + <contextFilters>try,static</contextFilters> + </configuration> +[...] ++--------- + \ No newline at end of file From commitsypena@example.com Wed Oct 04 04:09:38 2006 Return-Path: <commitsypena@example.com> Delivered-To: ypena@example.com Received: (qmail 47722 invoked from network); 4 Oct 2006 04:09:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Oct 2006 04:09:37 -0000 Received: (qmail 96873 invoked by uid 500); 4 Oct 2006 04:09:35 -0000 Delivered-To: ypena@example.com Received: (qmail 96815 invoked by uid 500); 4 Oct 2006 04:09:35 -0000 Mailing-List: contact ypena@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:ypena@example.com> List-Unsubscribe: <mailto:ypena@example.com> List-Post: <mailto:ypena@example.com> List-Id: <commits.maven.apache.org> Reply-To: ypena@example.com Delivered-To: mailing list ypena@example.com Received: (qmail 96729 invoked by uid 99); 4 Oct 2006 04:09:34 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2006 21:09:34 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [83.161.120.155] ([83.161.120.155:49834] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id 61/AA-00170-8D333254 for <ypena@example.com>; Tue, 03 Oct 2006 21:09:04 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id EDBA61A981A; Tue, 3 Oct 2006 21:07:13 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r452714 - in /maven/plugins/trunk/maven-dependency-plugin/src: main/java/org/apache/maven/plugin/dependency/utils/translators/ test/java/org/apache/maven/plugin/dependency/ test/java/org/apache/maven/plugin/dependency/utils/ test/java/org/a... Date: Wed, 04 Oct 2006 04:07:13 -0000 To: ypena@example.com From: ypena@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <ypena@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: brianf Date: Tue Oct 3 21:07:13 2006 New Revision: 452714 URL: http://svn.apache.org/viewvc?view=rev&rev=452714 Log: more unit tests Added: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/AbstractDependencyMojoTestCase.java maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/ArtifactStubFactory.java Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java?view=diff&rev=452714&r1=452713&r2=452714 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java Tue Oct 3 21:07:13 2006 @@ -25,10 +25,11 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.plugin.logging.Log; +import org.codehaus.plexus.util.StringUtils; /** * @author brianf - * + * */ public class ClassifierTypeTranslator implements ArtifactTranslator @@ -47,8 +48,11 @@ this.factory = factory; } - /* (non-Javadoc) - * @see org.apache.mojo.dependency.utils.translators.ArtifactTranslator#translate(java.util.Set, org.apache.maven.plugin.logging.Log) + /* + * (non-Javadoc) + * + * @see org.apache.mojo.dependency.utils.translators.ArtifactTranslator#translate(java.util.Set, + * org.apache.maven.plugin.logging.Log) */ public Set translate( Set artifacts, Log log ) { @@ -59,9 +63,37 @@ for ( Iterator i = artifacts.iterator(); i.hasNext(); ) { Artifact artifact = (Artifact) i.next(); + + //this translator must pass both type and classifier here so we will use the + //base artifact value if null comes in + String useType = null; + if ( StringUtils.isNotEmpty(this.type) ) + { + useType = this.type; + } + else + { + useType = artifact.getType(); + } + + String useClassifier = null; + if ( StringUtils.isNotEmpty(this.classifier) ) + { + useClassifier = this.classifier; + } + else + { + useClassifier = artifact.getClassifier(); + } + // Create a new artifact Artifact newArtifact = factory.createArtifactWithClassifier( artifact.getGroupId(), artifact - .getArtifactId(), artifact.getVersion(), this.type, this.classifier ); + .getArtifactId(), artifact.getVersion(), useType, useClassifier ); + + // note the new artifacts will always have the scope set to null. We + // should + // reset it here so that it will pass other filters if needed + newArtifact.setScope( artifact.getScope() ); results.add( newArtifact ); } @@ -78,7 +110,8 @@ } /** - * @param classifier The classifier to set. + * @param classifier + * The classifier to set. */ public void setClassifier( String classifier ) { @@ -94,7 +127,8 @@ } /** - * @param type The type to set. + * @param type + * The type to set. */ public void setType( String type ) { Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/AbstractDependencyMojoTestCase.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/AbstractDependencyMojoTestCase.java?view=diff&rev=452714&r1=452713&r2=452714 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/AbstractDependencyMojoTestCase.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/AbstractDependencyMojoTestCase.java Tue Oct 3 21:07:13 2006 @@ -39,17 +39,20 @@ protected void tearDown() { - try + if ( testDir != null ) { - DependencyTestUtils.removeDirectory( testDir ); + try + { + DependencyTestUtils.removeDirectory( testDir ); + } + catch ( IOException e ) + { + // TODO Auto-generated catch block + e.printStackTrace(); + fail("Trying to remove directory:"+testDir); + } + assertFalse( testDir.exists() ); } - catch ( IOException e ) - { - // TODO Auto-generated catch block - e.printStackTrace(); - assertTrue( false ); - } - assertFalse( testDir.exists() ); } } Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/ArtifactStubFactory.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/ArtifactStubFactory.java?view=diff&rev=452714&r1=452713&r2=452714 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/ArtifactStubFactory.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/ArtifactStubFactory.java Tue Oct 3 21:07:13 2006 @@ -10,7 +10,6 @@ import org.apache.maven.artifact.handler.ArtifactHandler; import org.apache.maven.artifact.handler.DefaultArtifactHandler; import org.apache.maven.artifact.versioning.VersionRange; -import org.codehaus.plexus.util.StringUtils; public class ArtifactStubFactory { @@ -106,9 +105,18 @@ { Set set = new HashSet(); set.add(createArtifact("g","a","1.0",Artifact.SCOPE_COMPILE,"war",null)); - set.add(createArtifact("g","a","1.0",Artifact.SCOPE_COMPILE,"jar",null)); - set.add(createArtifact("g","a","1.0",Artifact.SCOPE_COMPILE,"sources",null)); - set.add(createArtifact("g","a","1.0",Artifact.SCOPE_COMPILE,"zip",null)); + set.add(createArtifact("g","b","1.0",Artifact.SCOPE_COMPILE,"jar",null)); + set.add(createArtifact("g","c","1.0",Artifact.SCOPE_COMPILE,"sources",null)); + set.add(createArtifact("g","d","1.0",Artifact.SCOPE_COMPILE,"zip",null)); return set; + } + + public Set getMixedArtifacts() + { + Set set = new HashSet(); + set.addAll(getTypedArtifacts()); + set.addAll(getScopedArtifacts()); + set.addAll(getReleaseAndSnapshotArtifacts()); + return set; } } Added: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java?view=auto&rev=452714 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java (added) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java Tue Oct 3 21:07:13 2006 @@ -0,0 +1,196 @@ +/* + * Copyright 2005-2006 Brian Fox (ypena@example.com) + * + * 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. + */ +/** + * + */ +package org.apache.maven.plugin.dependency.utils.translators; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.factory.DefaultArtifactFactory; +import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; +import org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager; +import org.apache.maven.plugin.dependency.AbstractDependencyMojoTestCase; +import org.apache.maven.plugin.dependency.utils.ArtifactStubFactory; +import org.apache.maven.plugin.dependency.utils.SilentLog; +import org.apache.maven.plugin.logging.Log; + +/** + * @author brianf + * + */ +public class TestClassifierTypeTranslator + extends AbstractDependencyMojoTestCase +{ + Set artifacts = new HashSet(); + + ArtifactFactory artifactFactory; + + Log log = new SilentLog(); + + protected void setUp() + throws Exception + { + super.setUp(); + + ArtifactHandlerManager manager = new DefaultArtifactHandlerManager(); + this.setVariableValueToObject(manager,"artifactHandlers",new HashMap()); + + artifactFactory = new DefaultArtifactFactory(); + this.setVariableValueToObject(artifactFactory,"artifactHandlerManager",manager); + + ArtifactStubFactory factory = new ArtifactStubFactory( null, false ); + artifacts = factory.getMixedArtifacts(); + } + + public void testNullClassifier() + { + doTestNullEmptyClassifier(null); + } + public void testEmptyClassifier() + { + doTestNullEmptyClassifier(""); + } + + public void doTestNullEmptyClassifier(String classifier) + { + String type = "zip"; + + ArtifactTranslator at = new ClassifierTypeTranslator( classifier,type, artifactFactory ); + Set results = at.translate(artifacts,log); + + Iterator iter = artifacts.iterator(); + + while (iter.hasNext()) + { + Artifact artifact = (Artifact) iter.next(); + Iterator resultIter = results.iterator(); + boolean found = false; + while (!found && resultIter.hasNext() ) + { + Artifact translatedArtifact = (Artifact) resultIter.next(); + if (artifact.getArtifactId() == translatedArtifact.getArtifactId() && + artifact.getGroupId() == translatedArtifact.getGroupId() && + artifact.getScope() == translatedArtifact.getScope()) + { + //classifier is null, should be the same as the artifact + assertEquals(artifact.getClassifier(),translatedArtifact.getClassifier()); + assertEquals(type,translatedArtifact.getType()); + + found = true; + break; + } + } + assertTrue(found); + } + } + + public void testNullType() + { + doTestNullEmptyType(null); + } + public void testEmptyType() + { + doTestNullEmptyType(""); + } + + public void doTestNullEmptyType(String type) + { + String classifier = "jdk5"; + + ArtifactTranslator at = new ClassifierTypeTranslator( classifier,type, artifactFactory ); + Set results = at.translate(artifacts,log); + + Iterator iter = artifacts.iterator(); + + while (iter.hasNext()) + { + Artifact artifact = (Artifact) iter.next(); + Iterator resultIter = results.iterator(); + boolean found = false; + while (!found && resultIter.hasNext() ) + { + Artifact translatedArtifact = (Artifact) resultIter.next(); + if
{'source': 'Apache Software Foundation Public Mail Archives'}