maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r730530 - in /maven/plugins/trunk/maven-install-plugin: ./ src/it/attach-jar-checksum/ src/it/pom-checksum/ src/main/java/org/apache/maven/plugin/install/ src/test/java/org/apache/maven/plugin/install/
Date Thu, 01 Jan 2009 11:40:02 GMT
Author: bentmann
Date: Thu Jan  1 03:40:02 2009
New Revision: 730530

URL: http://svn.apache.org/viewvc?rev=730530&view=rev
Log:
[MINSTALL-56] No checksums installed for project with packaging POM

Added:
    maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/
    maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/pom.xml   (with props)
    maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/setup.bsh   (with
props)
    maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/verify.bsh   (with
props)
    maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/
    maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/pom.xml   (with props)
    maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/setup.bsh   (with props)
    maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/verify.bsh   (with props)
    maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/Utils.java
  (with props)
Modified:
    maven/plugins/trunk/maven-install-plugin/pom.xml
    maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java

Modified: maven/plugins/trunk/maven-install-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/pom.xml?rev=730530&r1=730529&r2=730530&view=diff
==============================================================================
--- maven/plugins/trunk/maven-install-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-install-plugin/pom.xml Thu Jan  1 03:40:02 2009
@@ -113,6 +113,7 @@
               <postBuildHookScript>verify</postBuildHookScript>
               <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
               <settingsFile>src/it/settings.xml</settingsFile>
+              <addTestClassPath>true</addTestClassPath>
               <goals>
                 <goal>install</goal>
               </goals>

Added: maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/pom.xml?rev=730530&view=auto
==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/pom.xml (added)
+++ maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/pom.xml Thu Jan  1
03:40:02 2009
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.install.ajc</groupId>
+  <artifactId>test</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <description>
+    Tests the installation of a simple snapshot JAR with an attached artifact and checksums
+  </description>
+
+  <properties>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <version>@project.version@</version>
+        <configuration>
+          <createChecksum>true</createChecksum>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.1</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <version>2.0.4</version>
+        <executions>
+          <execution>
+            <id>attach-sources</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.3.1</version>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/setup.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/setup.bsh?rev=730530&view=auto
==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/setup.bsh (added)
+++ maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/setup.bsh Thu Jan
 1 03:40:02 2009
@@ -0,0 +1,10 @@
+import java.io.*;
+import java.util.*;
+
+import org.codehaus.plexus.util.*;
+
+File file = new File( localRepositoryPath, "org/apache/maven/its/install/ajc" );
+System.out.println( "Deleting " + file );
+FileUtils.deleteDirectory( file );
+
+return true;

Propchange: maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/setup.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/setup.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/verify.bsh?rev=730530&view=auto
==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/verify.bsh (added)
+++ maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/verify.bsh Thu Jan
 1 03:40:02 2009
@@ -0,0 +1,35 @@
+import java.io.*;
+import java.util.*;
+
+import org.apache.maven.plugin.install.*;
+
+String[] paths =
+{
+    "org/apache/maven/its/install/ajc/test/maven-metadata-local.xml",
+    "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom",
+    "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom.md5",
+    "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom.sha1",
+    "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar",
+    "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar.md5",
+    "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar.sha1",
+    "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-sources.jar",
+    "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-sources.jar.md5",
+    "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-sources.jar.sha1",
+};
+
+for ( String path : paths )
+{
+    File file = new File( localRepositoryPath, path );
+    System.out.println( "Checking for existence of " + file );
+    if ( !file.isFile() )
+    {
+        throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() );
+    }
+    if ( file.getName().endsWith( ".md5" ) || file.getName().endsWith( ".sha1" ) )
+    {
+        System.out.println( "Verifying " + file );
+        Utils.verifyChecksum( file );
+    }
+}
+
+return true;

Propchange: maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/verify.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-install-plugin/src/it/attach-jar-checksum/verify.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/pom.xml?rev=730530&view=auto
==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/pom.xml (added)
+++ maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/pom.xml Thu Jan  1 03:40:02
2009
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.install.pc</groupId>
+  <artifactId>test</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <description>
+    Tests the installation of a simple snapshot POM with checksums
+  </description>
+
+  <properties>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <version>@project.version@</version>
+        <configuration>
+          <createChecksum>true</createChecksum>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.3.1</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-site-plugin</artifactId>
+        <version>2.0-beta-5</version>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/setup.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/setup.bsh?rev=730530&view=auto
==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/setup.bsh (added)
+++ maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/setup.bsh Thu Jan  1 03:40:02
2009
@@ -0,0 +1,10 @@
+import java.io.*;
+import java.util.*;
+
+import org.codehaus.plexus.util.*;
+
+File file = new File( localRepositoryPath, "org/apache/maven/its/install/pc" );
+System.out.println( "Deleting " + file );
+FileUtils.deleteDirectory( file );
+
+return true;

Propchange: maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/setup.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/setup.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/verify.bsh?rev=730530&view=auto
==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/verify.bsh (added)
+++ maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/verify.bsh Thu Jan  1 03:40:02
2009
@@ -0,0 +1,30 @@
+import java.io.*;
+import java.util.*;
+
+import org.apache.maven.plugin.install.*;
+
+String[] paths =
+{
+    "org/apache/maven/its/install/pc/test/maven-metadata-local.xml",
+    "org/apache/maven/its/install/pc/test/1.0-SNAPSHOT/maven-metadata-local.xml",
+    "org/apache/maven/its/install/pc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom",
+    "org/apache/maven/its/install/pc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom.md5",
+    "org/apache/maven/its/install/pc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom.sha1",
+};
+
+for ( String path : paths )
+{
+    File file = new File( localRepositoryPath, path );
+    System.out.println( "Checking for existence of " + file );
+    if ( !file.isFile() )
+    {
+        throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() );
+    }
+    if ( file.getName().endsWith( ".md5" ) || file.getName().endsWith( ".sha1" ) )
+    {
+        System.out.println( "Verifying " + file );
+        Utils.verifyChecksum( file );
+    }
+}
+
+return true;

Propchange: maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/verify.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-install-plugin/src/it/pom-checksum/verify.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java?rev=730530&r1=730529&r2=730530&view=diff
==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java
(original)
+++ maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java
Thu Jan  1 03:40:02 2009
@@ -93,6 +93,11 @@
             if ( isPomArtifact )
             {
                 installer.install( pomFile, artifact, localRepository );
+
+                if ( createChecksum )
+                {
+                    installCheckSum( pomFile, artifact, false );
+                }
             }
             else
             {

Added: maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/Utils.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/Utils.java?rev=730530&view=auto
==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/Utils.java
(added)
+++ maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/Utils.java
Thu Jan  1 03:40:02 2009
@@ -0,0 +1,68 @@
+package org.apache.maven.plugin.install;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+
+import org.codehaus.plexus.digest.Digester;
+import org.codehaus.plexus.digest.Md5Digester;
+import org.codehaus.plexus.digest.Sha1Digester;
+import org.codehaus.plexus.util.FileUtils;
+
+/**
+ * A utility class to assist testing.
+ * 
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class Utils
+{
+
+    /**
+     * Verifies a checksum file in the local repo.
+     * 
+     * @param checksumFile The checksum file to verify, must not be <code>null</code>.
+     * @throws Exception If the verification failed.
+     */
+    public static void verifyChecksum( File checksumFile )
+        throws Exception
+    {
+        File dataFile;
+        Digester digester;
+        if ( checksumFile.getName().endsWith( ".md5" ) )
+        {
+            digester = new Md5Digester();
+            dataFile = new File( checksumFile.getPath().substring( 0, checksumFile.getPath().length()
- 4 ) );
+        }
+        else if ( checksumFile.getName().endsWith( ".sha1" ) )
+        {
+            digester = new Sha1Digester();
+            dataFile = new File( checksumFile.getPath().substring( 0, checksumFile.getPath().length()
- 5 ) );
+        }
+        else
+        {
+            throw new IllegalArgumentException( "Unsupported checksum file: " + checksumFile
);
+        }
+
+        String expected = FileUtils.fileRead( checksumFile, "UTF-8" );
+        digester.verify( dataFile, expected );
+    }
+
+}

Propchange: maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/Utils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/Utils.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message