]> source.dussan.org Git - archiva.git/commitdiff
add some checks and notes
authorBrett Porter <brett@apache.org>
Tue, 6 Jun 2006 07:26:13 +0000 (07:26 +0000)
committerBrett Porter <brett@apache.org>
Tue, 6 Jun 2006 07:26:13 +0000 (07:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@412024 13f79535-47bb-0310-9956-ffa450edef68

maven-repository-application/pom.xml
maven-repository-artifact-applet/pom.xml
maven-repository-proxy/pom.xml
maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/DefaultProxyManager.java
maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManager.java
maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ProxyConfiguration.java
maven-repository-utils/src/main/java/org/apache/maven/repository/ArtifactUtils.java
maven-repository-webapp/pom.xml
pom.xml

index d2f042856ded89283d6c132a336d16b27c577e80..ffe8183f460587827460559057b7ba7074b4df10 100644 (file)
@@ -15,7 +15,7 @@
   -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.maven.repository</groupId>
     <artifactId>maven-repository-manager</artifactId>
       <artifactId>plexus-container-default</artifactId>
     </dependency>
   </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+        <configuration>
+          <instrumentation>
+            <!-- TODO: should this module have tests? -->
+            <excludes>
+              <exclude>**/**</exclude>
+            </excludes>
+          </instrumentation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 </project>
index ca4f4b8159110de1a14fbc410c31a1e8b6ea124b..144879018837505e000a3cc582a203d1b5d3279e 100644 (file)
@@ -1,5 +1,5 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.maven.repository</groupId>
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+        <configuration>
+          <instrumentation>
+            <!-- TODO: should this module have tests? -->
+            <excludes>
+              <exclude>**/**</exclude>
+            </excludes>
+          </instrumentation>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
   <pluginRepositories>
index 001447976b2dc18ab9d1c07a797fb066d156103b..e6acb7e05b7c7f44f87100810ca865db48db9458 100644 (file)
@@ -15,7 +15,7 @@
   -->\r
 \r
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
   <parent>\r
     <groupId>org.apache.maven.repository</groupId>\r
     <artifactId>maven-repository-manager</artifactId>\r
       <artifactId>wagon-provider-api</artifactId>\r
     </dependency>\r
   </dependencies>\r
+  <build>\r
+    <plugins>\r
+      <plugin>\r
+        <groupId>org.codehaus.mojo</groupId>\r
+        <artifactId>cobertura-maven-plugin</artifactId>\r
+        <configuration>\r
+          <check>\r
+            <!-- TODO: increase coverage -->\r
+            <totalLineRate>60</totalLineRate>\r
+            <totalBranchRate>75</totalBranchRate>\r
+          </check>\r
+        </configuration>\r
+      </plugin>\r
+    </plugins>\r
+  </build>\r
 </project>\r
index bb9c4d76f8213fee2d7c4f9c778d79aa994fda2d..c1426bde3d6e5442ef52119f4373436ddaee08e7 100644 (file)
@@ -52,6 +52,7 @@ import java.util.Map;
 /**
  * @author Edwin Punzalan
  * @plexus.component role="org.apache.maven.repository.proxy.ProxyManager"
+ * @todo too much of wagon manager is reproduced here because checksums need to be downloaded separately - is that necessary?
  */
 public class DefaultProxyManager
     extends AbstractLogEnabled
@@ -289,17 +290,13 @@ public class DefaultProxyManager
     private ArtifactRepositoryPolicy getReleasesPolicy()
     {
         //todo get policy configuration from ProxyConfiguration
-        ArtifactRepositoryPolicy repositoryPolicy = new ArtifactRepositoryPolicy();
-
-        return repositoryPolicy;
+        return new ArtifactRepositoryPolicy();
     }
 
     private ArtifactRepositoryPolicy getSnapshotsPolicy()
     {
         //todo get policy configuration from ProxyConfiguration
-        ArtifactRepositoryPolicy repositoryPolicy = new ArtifactRepositoryPolicy();
-
-        return repositoryPolicy;
+        return new ArtifactRepositoryPolicy();
     }
 
     public URL getRepositoryCacheURL()
index bd9838022fb501acdd67814112213ad5899fbf88..68e3e2fa89eb0d1959017b47e88126b1eec75e1b 100644 (file)
@@ -25,6 +25,7 @@ import java.io.File;
  * Class used to bridge the servlet to the repository proxy implementation.
  *
  * @author Edwin Punzalan
+ * @todo the names get() and getRemoteFile() are confusing
  */
 public interface ProxyManager
 {
index c7aae0c8b94af155cd5a56c38a666285517596dd..b54f02a4f687464eb180479474fdf4dd02f9d865 100644 (file)
@@ -29,6 +29,7 @@ import java.util.List;
  *
  * @author Edwin Punzalan
  * @plexus.component role="org.apache.maven.repository.proxy.configuration.ProxyConfiguration"
+ * @todo investigate how these should be set - probably plexus configuration
  */
 public class ProxyConfiguration
 {
index 41e5bf74b10be8fd62f24c4f93eb224de1e563da..e4d7d6602031b1ef7907992b485600f865b425a4 100644 (file)
@@ -33,6 +33,7 @@ import java.util.StringTokenizer;
  * Class used to build an artifact object based on a relative from a repository's basedir.
  *
  * @author Edwin Punzalan
+ * @todo I'm not sure why this class needs to exist. It seems like the perfect candidate for two implementations of an interface
  */
 public class ArtifactUtils
 {
index a987c31a8f94e643f16f5a228de79fab6d602e61..cad86049f9ef7262c7e90e3c6ee31524b8b32551 100644 (file)
@@ -52,7 +52,6 @@
       <plugin>
         <groupId>org.mortbay.jetty</groupId>
         <artifactId>maven-jetty6-plugin</artifactId>
-        <version>6.0.0beta11</version>
         <configuration>
           <scanIntervalSeconds>10</scanIntervalSeconds>
           <connectors>
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+        <configuration>
+          <instrumentation>
+            <!-- TODO: should this module have tests? -->
+            <excludes>
+              <exclude>**/**</exclude>
+            </excludes>
+          </instrumentation>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 </project>
diff --git a/pom.xml b/pom.xml
index a5a2966d71287289ea9a0276f991dea61a021721..88ec547a23e88114db78b9bd9ce72a58b8a29207 100644 (file)
--- a/pom.xml
+++ b/pom.xml
   ~ 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>
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.maven</groupId>
     </plugins>
     <pluginManagement>
       <plugins>
+        <plugin>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <configuration>
+            <source>1.4</source>
+            <target>1.4</target>
+          </configuration>
+        </plugin>
+        <plugin>
+          <artifactId>maven-idea-plugin</artifactId>
+          <configuration>
+            <jdkLevel>1.4</jdkLevel>
+          </configuration>
+        </plugin>
         <plugin>
           <artifactId>maven-release-plugin</artifactId>
           <configuration>
   </dependencyManagement>
   <reporting>
     <plugins>
-      <!-- TODO: should be omitted when there are no tests to run -->
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>cobertura-maven-plugin</artifactId>
       </plugin>
-      <!--
-            <plugin>
-              <artifactId>maven-checkstyle-plugin</artifactId>
-            </plugin>
-      -->
-      <!-- TODO: should work, even if there are no sources -->
+      <plugin>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>config/maven_checks.xml</configLocation>
+        </configuration>
+      </plugin>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>changelog-maven-plugin</artifactId>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>taglist-maven-plugin</artifactId>
       </plugin>
-      <!-- TODO: should be omitted when there are no sources -->
       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>jxr-maven-plugin</artifactId>
+        <artifactId>maven-jxr-plugin</artifactId>
+        <configuration>
+          <aggregate>true</aggregate>
+        </configuration>
       </plugin>
-      <!-- TODO: should be omitted when there are no tests to run -->
       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>surefire-report-maven-plugin</artifactId>
+        <artifactId>maven-surefire-report-plugin</artifactId>
       </plugin>
-      <!-- TODO: should be omitted when there are no sources/not java -->
       <plugin>
         <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <aggregate>true</aggregate>
+        </configuration>
       </plugin>
-      <!-- TODO: should be omitted when there are no sources/not java -->
       <plugin>
         <artifactId>maven-pmd-plugin</artifactId>
+        <!-- TODO: choose appropriate rulesets -->
       </plugin>
     </plugins>
   </reporting>
+  <profiles>
+    <profile>
+      <id>ciProfile</id>
+      <activation>
+        <property>
+          <name>enableCiProfile</name>
+          <value>true</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-pmd-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>process-sources</phase>
+                <goals>
+                  <!-- TODO: after rules are set
+                                    <goal>check</goal>
+                  -->
+                  <goal>cpd-check</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-checkstyle-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>process-sources</phase>
+                <goals>
+                  <!-- TODO: reformat first
+                                    <goal>check</goal>
+                  -->
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>cobertura-maven-plugin</artifactId>
+            <configuration>
+              <check>
+                <!-- TODO! raise to 85/100 -->
+                <totalLineRate>80</totalLineRate>
+                <totalBranchRate>95</totalBranchRate>
+              </check>
+
+              <instrumentation>
+                <excludes>
+                  <exclude>**/*$*</exclude>
+                </excludes>
+              </instrumentation>
+            </configuration>
+            <executions>
+              <execution>
+                <id>clean</id>
+                <goals>
+                  <goal>clean</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>check</id>
+                <goals>
+                  <goal>check</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>