You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vm...@apache.org on 2006/04/08 18:35:28 UTC
svn commit: r392554 - in /maven/plugins/trunk/maven-clover-plugin: ./
src/it/maven-clover-plugin-sample-multiproject/
src/it/maven-clover-plugin-sample-simple/ src/it/multiproject/
src/it/multiproject/ear1/ src/it/multiproject/jar1/ src/it/multiproject...
Author: vmassol
Date: Sat Apr 8 09:35:02 2006
New Revision: 392554
URL: http://svn.apache.org/viewcvs?rev=392554&view=rev
Log:
MCLOVER-32: Add support for aggregating functional tests results
Added:
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/ear1/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/ear1/pom.xml (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/pom.xml (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/maven/plugin/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/maven/plugin/clover/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/maven/plugin/clover/samples/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1.java (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/maven/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/maven/plugin/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/maven/plugin/clover/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/maven/plugin/clover/samples/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1Test.java (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/pom.xml (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/maven/plugin/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/maven/plugin/clover/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/maven/plugin/clover/samples/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2.java (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/maven/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/maven/plugin/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/maven/plugin/clover/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/maven/plugin/clover/samples/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2Test.java (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/pom.xml (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/pom.xml (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/src/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/src/main/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/src/main/webapp/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/src/main/webapp/WEB-INF/
maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/src/main/webapp/WEB-INF/web.xml (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/simple/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/pom.xml (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Dummy.java (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Simple.java (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/site/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/site/site.xml (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/maven/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/maven/plugin/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/maven/plugin/clover/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/maven/plugin/clover/samples/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/maven/plugin/clover/samples/simple/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/maven/plugin/clover/samples/simple/SimpleTest.java (with props)
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/maven/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/maven/plugin/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/maven/plugin/clover/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/maven/plugin/clover/samples/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/maven/plugin/clover/samples/simple/
maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/maven/plugin/clover/samples/simple/test.properties (with props)
Removed:
maven/plugins/trunk/maven-clover-plugin/src/it/maven-clover-plugin-sample-multiproject/
maven/plugins/trunk/maven-clover-plugin/src/it/maven-clover-plugin-sample-simple/
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/CloverInstrumentInternalMojo.java
maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverInstrumentMojo.java
maven/plugins/trunk/maven-clover-plugin/src/main/resources/META-INF/maven/lifecycle.xml
Modified: maven/plugins/trunk/maven-clover-plugin/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/pom.xml?rev=392554&r1=392553&r2=392554&view=diff
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-clover-plugin/pom.xml Sat Apr 8 09:35:02 2006
@@ -67,7 +67,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
- <version>2.0</version>
+ <version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Added: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/ear1/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/ear1/pom.xml?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/ear1/pom.xml (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/ear1/pom.xml Sat Apr 8 09:35:02 2006
@@ -0,0 +1,21 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin-sample-multiproject</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>maven-clover-plugin-sample-multiproject-ear1</artifactId>
+ <packaging>ear</packaging>
+ <name>Maven Clover Plugin Multiproject Sample - EAR 1</name>
+ <description>Maven Clover Plugin Multiproject Sample - EAR 1</description>
+ <version>1.0-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin-sample-multiproject-war1</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ </dependencies>
+</project>
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/ear1/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/ear1/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/pom.xml?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/pom.xml (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/pom.xml Sat Apr 8 09:35:02 2006
@@ -0,0 +1,13 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin-sample-multiproject</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>maven-clover-plugin-sample-multiproject-jar1</artifactId>
+ <packaging>jar</packaging>
+ <name>Maven Clover Plugin Multiproject Sample - JAR 1</name>
+ <description>Maven Clover Plugin Multiproject Sample - JAR 1</description>
+ <version>1.0-SNAPSHOT</version>
+</project>
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1.java?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1.java (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1.java Sat Apr 8 09:35:02 2006
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2005-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.multiproject;
+
+public class Simple1
+{
+ public void someMethod1()
+ {
+ int i = 0;
+ if (i > 0)
+ {
+ i = i + 1;
+ }
+ }
+
+ public void someMethod2()
+ {
+ int i = 0;
+ if (i > 0)
+ {
+ i = i + 1;
+ }
+ }
+}
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1Test.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1Test.java?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1Test.java (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1Test.java Sat Apr 8 09:35:02 2006
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.maven.plugin.clover.samples.multiproject;
+
+import junit.framework.TestCase;
+
+public class Simple1Test extends TestCase
+{
+ public void testSomeMethod()
+ {
+ Simple1 simple = new Simple1();
+ simple.someMethod1();
+ }
+}
+
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1Test.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar1/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple1Test.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/pom.xml?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/pom.xml (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/pom.xml Sat Apr 8 09:35:02 2006
@@ -0,0 +1,20 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin-sample-multiproject</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>maven-clover-plugin-sample-multiproject-jar2</artifactId>
+ <packaging>jar</packaging>
+ <name>Maven Clover Plugin Multiproject Sample - JAR 2</name>
+ <description>Maven Clover Plugin Multiproject Sample - JAR 2</description>
+ <version>1.0-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin-sample-multiproject-jar1</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2.java?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2.java (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2.java Sat Apr 8 09:35:02 2006
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.maven.plugin.clover.samples.multiproject;
+
+public class Simple2
+{
+ public void someMethod2()
+ {
+ int i = 0;
+ if (i > 0)
+ {
+ i = i + 1;
+ }
+ }
+}
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/main/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2Test.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2Test.java?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2Test.java (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2Test.java Sat Apr 8 09:35:02 2006
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.maven.plugin.clover.samples.multiproject;
+
+import junit.framework.TestCase;
+
+import java.net.URLClassLoader;
+
+public class Simple2Test extends TestCase
+{
+ public void testSomeMethod()
+ {
+ Simple2 simple2 = new Simple2();
+ simple2.someMethod2();
+
+ Simple1 simple1 = new Simple1();
+ simple1.someMethod2();
+ }
+}
+
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2Test.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/jar2/src/test/java/org/apache/maven/plugin/clover/samples/multiproject/Simple2Test.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/pom.xml?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/pom.xml (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/pom.xml Sat Apr 8 09:35:02 2006
@@ -0,0 +1,51 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin-sample-multiproject</artifactId>
+ <packaging>pom</packaging>
+ <name>Maven Clover Plugin Multiproject Sample</name>
+ <description>Maven Clover Plugin Multiproject 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>
+ <reporting>
+ <excludeDefaults>true</excludeDefaults>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clover-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clover-plugin</artifactId>
+ <configuration>
+ <flushPolicy>threaded</flushPolicy>
+ <flushInterval>100</flushInterval>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>instrument</goal>
+ <goal>aggregate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <modules>
+ <module>jar1</module>
+ <module>jar2</module>
+ <module>war1</module>
+ <module>ear1</module>
+ </modules>
+</project>
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/pom.xml?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/pom.xml (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/pom.xml Sat Apr 8 09:35:02 2006
@@ -0,0 +1,20 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin-sample-multiproject</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>maven-clover-plugin-sample-multiproject-war1</artifactId>
+ <packaging>war</packaging>
+ <name>Maven Clover Plugin Multiproject Sample - WAR 1</name>
+ <description>Maven Clover Plugin Multiproject Sample - WAR 1</description>
+ <version>1.0-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin-sample-multiproject-jar1</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/src/main/webapp/WEB-INF/web.xml?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/src/main/webapp/WEB-INF/web.xml (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/src/main/webapp/WEB-INF/web.xml Sat Apr 8 09:35:02 2006
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
+ "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
+
+<web-app>
+ <description>Simple Webapp for testing</description>
+</web-app>
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/multiproject/war1/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/simple/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/simple/pom.xml?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/simple/pom.xml (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/simple/pom.xml Sat Apr 8 09:35:02 2006
@@ -0,0 +1,85 @@
+<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 Simple Sample</name>
+ <description>Maven Clover Plugin Simple 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>
+ <reporting>
+ <excludeDefaults>true</excludeDefaults>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin</artifactId>
+ <configuration>
+
+ <!-- Verify that we can modify the location of the Clover database and that the directory is created if
+ it doesn't exist. Note: we're putting the configuration here and not in the build section because the
+ build section inherits from the reporting section but not the other way around... -->
+ <cloverDatabase>${project.build.directory}/customclover/myclover.db</cloverDatabase>
+
+ <!-- Verify that we can generate all types of Clover reports -->
+ <generateHtml>true</generateHtml>
+ <generatePdf>true</generatePdf>
+ <generateXml>true</generateXml>
+
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin</artifactId>
+ <configuration>
+
+ <targetPercentage>1%</targetPercentage>
+
+ <!-- Verify that we can specify the JDK version for Clover's instrumentation -->
+ <jdk>1.4</jdk>
+
+ <!-- Verify that we can exclude some files from the instrumentation -->
+ <excludes>
+ <exclude>**/*Dummy*.java</exclude>
+ </excludes>
+
+ </configuration>
+ <executions>
+ <execution>
+ <id>main</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>instrument</goal>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>site</id>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>instrument</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/simple/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/simple/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Dummy.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Dummy.java?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Dummy.java (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Dummy.java Sat Apr 8 09:35:02 2006
@@ -0,0 +1,24 @@
+/*
+ * 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.simple;
+
+public class Dummy
+{
+ public void dummyMethod()
+ {
+ int i = 0;
+ }
+}
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Dummy.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Dummy.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Simple.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Simple.java?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Simple.java (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Simple.java Sat Apr 8 09:35:02 2006
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.maven.plugin.clover.samples.simple;
+
+public class Simple
+{
+ public void someMethod()
+ {
+ assert true == true : "true was not true";
+
+ int i = 0;
+ if (i > 0)
+ {
+ i = i + 1;
+ }
+ }
+}
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Simple.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/main/java/org/apache/maven/plugin/clover/samples/simple/Simple.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/site/site.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/site/site.xml?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/site/site.xml (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/site/site.xml Sat Apr 8 09:35:02 2006
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+/*
+ * Copyright 2001-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.
+ */
+-->
+
+<project name="Maven Clover Simple Sample">
+ <bannerLeft>
+ <name>Maven Clover Simple Sample</name>
+ <src>http://maven.apache.org/images/apache-maven-project.png</src>
+ <href>http://maven.apache.org/</href>
+ </bannerLeft>
+ <bannerRight>
+ <src>http://maven.apache.org/images/maven-small.gif</src>
+ </bannerRight>
+ <publishDate format="dd MMM yyyy" />
+ <body>
+ <links>
+ <item name="Maven" href="http://maven.apache.org/"/>
+ </links>
+
+ <menu name="Other Reports">
+ <item name="Clover PDF" href="clover/clover.pdf"/>
+ <item name="Clover XML" href="clover/clover.xml"/>
+ </menu>
+
+ ${reports}
+
+ </body>
+</project>
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/site/site.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/site/site.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/maven/plugin/clover/samples/simple/SimpleTest.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/maven/plugin/clover/samples/simple/SimpleTest.java?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/maven/plugin/clover/samples/simple/SimpleTest.java (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/maven/plugin/clover/samples/simple/SimpleTest.java Sat Apr 8 09:35:02 2006
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.maven.plugin.clover.samples.simple;
+
+import junit.framework.TestCase;
+import java.util.Properties;
+
+public class SimpleTest extends TestCase
+{
+ public void testSomeMethod() throws Exception
+ {
+ Simple simple = new Simple();
+ simple.someMethod();
+
+ // Verify that we can load resource files from tess when using the clover plugin
+ Properties props = new Properties();
+ props.load(getClass().getResourceAsStream("/org/apache/maven/plugin/clover/samples/simple/test.properties"));
+ }
+}
+
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/maven/plugin/clover/samples/simple/SimpleTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/java/org/apache/maven/plugin/clover/samples/simple/SimpleTest.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/maven/plugin/clover/samples/simple/test.properties
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/maven/plugin/clover/samples/simple/test.properties?rev=392554&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/maven/plugin/clover/samples/simple/test.properties (added)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/maven/plugin/clover/samples/simple/test.properties Sat Apr 8 09:35:02 2006
@@ -0,0 +1,2 @@
+# Sample file used for testing. We're using it to validate that tests using resources are
+# still working when called by the clover plugin.
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/maven/plugin/clover/samples/simple/test.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/simple/src/test/resources/org/apache/maven/plugin/clover/samples/simple/test.properties
------------------------------------------------------------------------------
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/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverCheckMojo.java?rev=392554&r1=392553&r2=392554&view=diff
==============================================================================
--- 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 Sat Apr 8 09:35:02 2006
@@ -47,27 +47,37 @@
public void execute()
throws MojoExecutionException
{
- super.execute();
+ if ( !isInCloverForkedLifecycle() )
+ {
+ super.execute();
- AbstractCloverMojo.waitForFlush( getWaitForFlush(), getFlushInterval() );
+ AbstractCloverMojo.waitForFlush( getWaitForFlush(), getFlushInterval() );
- Project antProject = registerCloverAntTasks();
+ Project antProject = registerCloverAntTasks();
- getLog().info( "Checking for coverage of " + targetPercentage);
+ getLog().info( "Checking for coverage of " + targetPercentage);
- CloverPassTask cloverPassTask = (CloverPassTask) antProject.createTask( "clover-check" );
- cloverPassTask.setInitString( getCloverDatabase() );
- cloverPassTask.setHaltOnFailure( true );
- cloverPassTask.setTarget( new Percentage( this.targetPercentage ) );
- cloverPassTask.setFailureProperty( "clovercheckproperty" );
- try
- {
- cloverPassTask.execute();
- }
- catch ( BuildException e )
- {
- getLog().error( antProject.getProperty( "clovercheckproperty" ) );
- throw new MojoExecutionException( e.getMessage(), e );
+ CloverPassTask cloverPassTask = (CloverPassTask) antProject.createTask( "clover-check" );
+ cloverPassTask.setInitString( getCloverDatabase() );
+ cloverPassTask.setHaltOnFailure( true );
+ cloverPassTask.setTarget( new Percentage( this.targetPercentage ) );
+ cloverPassTask.setFailureProperty( "clovercheckproperty" );
+ try
+ {
+ cloverPassTask.execute();
+ }
+ catch ( BuildException e )
+ {
+ getLog().error( antProject.getProperty( "clovercheckproperty" ) );
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
}
+ }
+
+ private boolean isInCloverForkedLifecycle()
+ {
+ // We know we're in the forked lifecycle if the output directory is set to target/clover...
+ // TODO: Not perfect, need to find a better way. This is a hack!
+ return getProject().getBuild().getDirectory().endsWith( "clover" );
}
}
Modified: maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverInstrumentInternalMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverInstrumentInternalMojo.java?rev=392554&r1=392553&r2=392554&view=diff
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverInstrumentInternalMojo.java (original)
+++ maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverInstrumentInternalMojo.java Sat Apr 8 09:35:02 2006
@@ -17,6 +17,8 @@
import com.cenqua.clover.CloverInstr;
import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.plugin.MojoExecutionException;
@@ -60,7 +62,22 @@
* @required
* @readonly
*/
- private ArtifactFactory factory;
+ private ArtifactFactory artifactFactory;
+
+ /**
+ * @component role="org.apache.maven.artifact.resolver.ArtifactResolver"
+ * @required
+ * @readonly
+ */
+ private ArtifactResolver artifactResolver;
+
+ /**
+ * Local maven repository.
+ *
+ * @parameter expression="${localRepository}"
+ * @required
+ */
+ private ArtifactRepository localRepository;
/**
* The list of file to include in the instrumentation.
@@ -83,16 +100,17 @@
public void execute()
throws MojoExecutionException
{
- if ( shouldExecute() )
- {
- // Ensure output directories exist
- new File( this.cloverOutputDirectory ).mkdirs();
- this.cloverOutputSourceDirectory = new File( this.cloverOutputDirectory, "src" ).getPath();
+ // Ensure output directories exist
+ new File( this.cloverOutputDirectory ).mkdirs();
+ this.cloverOutputSourceDirectory = new File( this.cloverOutputDirectory, "src" ).getPath();
+ new File( getCloverDatabase() ).getParentFile().mkdirs();
- new File( getCloverDatabase() ).getParentFile().mkdirs();
+ super.execute();
- super.execute();
+ logArtifacts("before changes");
+ if ( isJavaProject() )
+ {
Set filesToInstrument = computeFilesToInstrument();
if ( filesToInstrument.isEmpty() )
{
@@ -101,33 +119,35 @@
else
{
instrumentSources( filesToInstrument );
- addCloverDependencyToCompileClasspath();
- redirectSourceDirectories();
- redirectOutputDirectories();
}
}
+
+ swizzleCloverDependencies();
+ addCloverDependencyToCompileClasspath();
+ redirectSourceDirectories();
+ redirectOutputDirectories();
+ redirectArtifact();
+
+ logArtifacts("after changes");
}
- private boolean shouldExecute()
+ private boolean isJavaProject()
{
- boolean shouldExecute = true;
+ boolean isJavaProject;
- // Only execute reports for java projects
ArtifactHandler artifactHandler = getProject().getArtifact().getArtifactHandler();
- File srcDir = new File( getProject().getBuild().getSourceDirectory() );
- if ( !"java".equals( artifactHandler.getLanguage() ) )
+ if ( "java".equals( artifactHandler.getLanguage() ) )
{
- getLog().debug( "Not instrumenting sources with Clover as this is not a Java project." );
- shouldExecute = false;
+ isJavaProject = true;
}
- else if ( !srcDir.exists() )
+ else
{
- getLog().debug("No sources found - No Clover instrumentation done");
- shouldExecute = false;
+ getLog().info( "Not instrumenting sources with Clover as this is not a Java project." );
+ isJavaProject = false;
}
- return shouldExecute;
+ return isJavaProject;
}
private void instrumentSources(Set filesToInstrument) throws MojoExecutionException
@@ -145,9 +165,13 @@
// thereafter output files in the Clover output directory and not in the main output directory.
getProject().getBuild().setDirectory( this.cloverOutputDirectory );
- // TODO: Ulgy hack below. Changing the directory should be enough for changing the values of all other
+ // TODO: Ugly hack below. Changing the directory should be enough for changing the values of all other
// properties depending on it!
getProject().getBuild().setOutputDirectory( new File( this.cloverOutputDirectory, "classes" ).getPath() );
+
+ // TODO: This is a hack. Remove this when http://jira.codehaus.org/browse/MINSTALL-18 is fixed.
+ new File( getProject().getBuild().getOutputDirectory() ).mkdirs();
+
getProject().getBuild().setTestOutputDirectory(
new File( this.cloverOutputDirectory, "test-classes" ).getPath() );
}
@@ -156,25 +180,108 @@
{
String oldSourceDirectory = getProject().getBuild().getSourceDirectory();
- getProject().getBuild().setSourceDirectory( this.cloverOutputSourceDirectory );
+ if ( new File( oldSourceDirectory ).exists() )
+ {
+ getProject().getBuild().setSourceDirectory( this.cloverOutputSourceDirectory );
+ }
+
+ getLog().debug( "Clover source directories before change:" );
+ logSourceDirectories();
// Maven2 limitation: changing the source directory doesn't change the compile source roots
// See http://jira.codehaus.org/browse/MNG-1945
- List sourceRoots = getProject().getCompileSourceRoots();
- for (int i = 0; i < sourceRoots.size(); i++)
+ List sourceRoots = new ArrayList( getProject().getCompileSourceRoots() );
+
+ // Clean all source roots to add them again in order to keep the same original order of source roots.
+ getProject().getCompileSourceRoots().removeAll( sourceRoots );
+
+ for ( Iterator i = sourceRoots.iterator(); i.hasNext(); )
{
- String sourceRoot = (String) getProject().getCompileSourceRoots().get( i );
- if (sourceRoot.equals(oldSourceDirectory))
+ String sourceRoot = (String) i.next();
+ if ( new File( oldSourceDirectory ).exists() && sourceRoot.equals( oldSourceDirectory ) )
{
- getProject().getCompileSourceRoots().remove( i );
-
- // Note: Ideally we should add the new compile source root at the same place as the
- // one we're removing but there's no API for this...
getProject().addCompileSourceRoot( getProject().getBuild().getSourceDirectory() );
}
+ else
+ {
+ getProject().addCompileSourceRoot( sourceRoot );
+ }
+ }
+
+ getLog().debug( "Clover source directories after change:" );
+ logSourceDirectories();
+ }
+
+ /**
+ * Modify main artifact to add a "clover" classifier to it so that it's not mixed with the main artifact of
+ * a normal build.
+ */
+ private void redirectArtifact()
+ {
+ // Only redirect main artifact for non-pom projects
+ if ( !getProject().getPackaging().equals("pom") )
+ {
+ Artifact oldArtifact = getProject().getArtifact();
+ Artifact newArtifact = this.artifactFactory.createArtifactWithClassifier( oldArtifact.getGroupId(),
+ oldArtifact.getArtifactId(), oldArtifact.getVersion(), oldArtifact.getType(), "clover" );
+ getProject().setArtifact( newArtifact );
+
+ getProject().getBuild().setFinalName( getProject().getArtifactId() + "-" + getProject().getVersion()
+ + "-clover");
}
}
+ private void logSourceDirectories()
+ {
+ if ( getLog().isDebugEnabled() )
+ {
+ for ( Iterator i = getProject().getCompileSourceRoots().iterator(); i.hasNext(); )
+ {
+ String sourceRoot = (String) i.next();
+ getLog().debug( "[Clover] source root [" + sourceRoot + "]");
+ }
+ }
+ }
+
+ /**
+ * Browse through all project dependencies and try to find a clovered version of the dependency. If found
+ * replace the main depedencency by the clovered version.
+ */
+ private void swizzleCloverDependencies()
+ {
+ getProject().setDependencyArtifacts(
+ swizzleCloverDependencies( getProject().getDependencyArtifacts() ) );
+ getProject().setArtifacts(
+ swizzleCloverDependencies( getProject().getArtifacts() ) );
+ }
+
+ private Set swizzleCloverDependencies(Set artifacts)
+ {
+ Set resolvedArtifacts = new HashSet();
+ for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+ {
+ Artifact artifact = (Artifact) i.next();
+ Artifact cloverArtifact = this.artifactFactory.createArtifactWithClassifier( artifact.getGroupId(),
+ artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), "clover" );
+
+ try
+ {
+ this.artifactResolver.resolve( cloverArtifact, new ArrayList(), localRepository );
+
+ // Set the same scope as the main artifact as this is not set by createArtifactWithClassifier.
+ cloverArtifact.setScope( artifact.getScope() );
+
+ resolvedArtifacts.add( cloverArtifact );
+ }
+ catch ( Exception e )
+ {
+ resolvedArtifacts.add( artifact );
+ }
+ }
+
+ return resolvedArtifacts;
+ }
+
private void addCloverDependencyToCompileClasspath()
throws MojoExecutionException
{
@@ -194,16 +301,36 @@
throw new MojoExecutionException( "Couldn't find 'clover' artifact in plugin dependencies" );
}
- cloverArtifact = factory.createArtifact( cloverArtifact.getGroupId(), cloverArtifact.getArtifactId(),
- cloverArtifact.getVersion(), Artifact.SCOPE_COMPILE,
- cloverArtifact.getType() );
+ cloverArtifact = artifactFactory.createArtifact( cloverArtifact.getGroupId(), cloverArtifact.getArtifactId(),
+ cloverArtifact.getVersion(), Artifact.SCOPE_COMPILE, cloverArtifact.getType() );
// TODO: use addArtifacts when it's implemented, see http://jira.codehaus.org/browse/MNG-2197
- Set set = new HashSet( getProject().getArtifacts() );
+ Set set = new HashSet( getProject().getDependencyArtifacts() );
set.add( cloverArtifact );
getProject().setDependencyArtifacts( set );
}
+ private void logArtifacts(String message)
+ {
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug("[Clover] List of dependency artifacts " + message + ":");
+ logArtifacts( getProject().getDependencyArtifacts() );
+
+ getLog().debug("[Clover] List of artifacts " + message + ":");
+ logArtifacts( getProject().getArtifacts() );
+ }
+ }
+
+ private void logArtifacts(Set artifacts)
+ {
+ for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+ {
+ Artifact artifact = (Artifact) i.next();
+ getLog().debug("[Clover] Artifact [" + artifact.getId() + "], scope = [" + artifact.getScope() + "]" );
+ }
+ }
+
/**
* @return the list of files to instrument taking into account the includes and excludes specified by the user
*/
@@ -230,17 +357,18 @@
// Note: we shouldn't have to do this but this is a limitation of the Plexus SimpleSourceInclusionScanner
scanner.addSourceMapping(new SuffixMapping("dummy", "dummy"));
- Iterator roots = getProject().getCompileSourceRoots().iterator();
- while (roots.hasNext())
+ // Only instrument main sources. Do not instrument other source roots as we don't want to instrument
+ // generates files for example.
+ File sourceDir = new File( getProject().getBuild().getSourceDirectory() );
+ if ( sourceDir.exists() )
{
- String sourceRoot = (String) roots.next();
try
{
- filesToInstrument.addAll(scanner.getIncludedSources(new File(sourceRoot), null));
+ filesToInstrument.addAll( scanner.getIncludedSources( sourceDir, null ) );
}
catch (InclusionScanException e)
{
- getLog().warn("Failed to add sources from [" + sourceRoot + "]", e);
+ getLog().warn("Failed to add sources from [" + getProject().getBuild().getSourceDirectory() + "]", e);
}
}
Modified: maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverInstrumentMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverInstrumentMojo.java?rev=392554&r1=392553&r2=392554&view=diff
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverInstrumentMojo.java (original)
+++ maven/plugins/trunk/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/CloverInstrumentMojo.java Sat Apr 8 09:35:02 2006
@@ -28,7 +28,7 @@
* project as usual and another time for instrumenting the sources with Clover and generating the Clover database.
*
* @goal instrument
- * @execute phase="test" lifecycle="clover"
+ * @execute phase="install" lifecycle="clover"
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
* @version $Id$
Modified: maven/plugins/trunk/maven-clover-plugin/src/main/resources/META-INF/maven/lifecycle.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clover-plugin/src/main/resources/META-INF/maven/lifecycle.xml?rev=392554&r1=392553&r2=392554&view=diff
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/main/resources/META-INF/maven/lifecycle.xml (original)
+++ maven/plugins/trunk/maven-clover-plugin/src/main/resources/META-INF/maven/lifecycle.xml Sat Apr 8 09:35:02 2006
@@ -16,6 +16,14 @@
</execution>
</executions>
</phase>
+<!--
+ <phase>
+ <id>install</id>
+ <configuration>
+ <classifier>clover</classifier>
+ </configuration>
+ </phase>
+-->
</phases>
</lifecycle>
</lifecycles>