maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r684587 - in /maven/plugins/trunk/maven-source-plugin: ./ src/it/ src/it/jar-attached/ src/it/jar-attached/src/ src/it/jar-attached/src/main/ src/it/jar-attached/src/main/java/ src/it/jar/ src/it/jar/src/ src/it/jar/src/main/ src/it/jar/src...
Date Sun, 10 Aug 2008 20:49:10 GMT
Author: bentmann
Date: Sun Aug 10 13:49:08 2008
New Revision: 684587

URL: http://svn.apache.org/viewvc?rev=684587&view=rev
Log:
o Added some basic integration tests

Added:
    maven/plugins/trunk/maven-source-plugin/src/it/
    maven/plugins/trunk/maven-source-plugin/src/it/jar/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/pom.xml   (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/src/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/src/main/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/src/main/java/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/src/main/java/MyClass.java
  (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/verify.bsh   (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar/invoker.properties   (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar/pom.xml   (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar/src/
    maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/
    maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/java/
    maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/java/MyClass.java   (with
props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/resources/
    maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/resources/main.properties
  (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/
    maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/java/
    maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/java/MyTest.java   (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/resources/
    maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/resources/test.properties
  (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar/verify.bsh   (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/settings.xml   (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/invoker.properties   (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/pom.xml   (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/java/
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/java/MyClass.java   (with
props)
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/resources/
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/resources/main.properties
  (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/java/
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/java/MyTest.java   (with
props)
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/resources/
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/resources/test.properties
  (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/test-jar/verify.bsh   (with props)
Modified:
    maven/plugins/trunk/maven-source-plugin/pom.xml

Modified: maven/plugins/trunk/maven-source-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/pom.xml?rev=684587&r1=684586&r2=684587&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-source-plugin/pom.xml Sun Aug 10 13:49:08 2008
@@ -103,20 +103,26 @@
       <build>
         <plugins>
           <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-antrun-plugin</artifactId>
+            <artifactId>maven-invoker-plugin</artifactId>
+            <configuration>
+              <debug>true</debug>
+              <projectsDirectory>src/it</projectsDirectory>
+              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+              <pomIncludes>
+                <pomInclude>*/pom.xml</pomInclude>
+              </pomIncludes>
+              <postBuildHookScript>verify.bsh</postBuildHookScript>
+              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+              <settingsFile>src/it/settings.xml</settingsFile>
+              <goals>
+                <goal>install</goal>
+              </goals>
+            </configuration>
             <executions>
               <execution>
                 <id>integration-test</id>
-                <phase>integration-test</phase>
-                <configuration>
-                  <tasks>
-                    <echo/><echo/><echo/><echo/><echo/>
-                    <echo level="warning">NO INTEGRATION TESTS DEFINED</echo>
-                    <echo/><echo/><echo/><echo/><echo/>
-                  </tasks>
-                </configuration>
                 <goals>
+                  <goal>install</goal>
                   <goal>run</goal>
                 </goals>
               </execution>

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/pom.xml?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/pom.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/pom.xml Sun Aug 10 13:49:08
2008
@@ -0,0 +1,56 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>test</groupId>
+  <artifactId>jar-attached</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>Test for jar-attached</name>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <version>@pom.version@</version>
+        <executions>
+          <execution>
+            <id>attach-sources</id>
+            <configuration>
+            </configuration>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/src/main/java/MyClass.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/src/main/java/MyClass.java?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/src/main/java/MyClass.java
(added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/src/main/java/MyClass.java
Sun Aug 10 13:49:08 2008
@@ -0,0 +1,4 @@
+public class MyClass
+{
+
+}

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/src/main/java/MyClass.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/src/main/java/MyClass.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/verify.bsh?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/verify.bsh (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/verify.bsh Sun Aug 10 13:49:08
2008
@@ -0,0 +1,38 @@
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+    File jarFile = new File( basedir, "target/jar-attached-1.0-SNAPSHOT-sources.jar" );
+    System.out.println( "Checking for existence of " + jarFile );
+    if ( !jarFile.isFile() )
+    {
+        System.out.println( "FAILURE!" );
+        return false;
+    }
+
+    // TODO: Use variable localRepositoryPath once MINVOKER-49 is released
+    File localRepoDir = new File( basedir.getParentFile().getParentFile(), "local-repo" );
+    System.out.println( "Checking for existence of " + localRepoDir );
+    if ( !localRepoDir.isDirectory() )
+    {
+        System.out.println( "FAILURE!" );
+        return false;
+    }
+
+    File attachedFile = new File( localRepoDir, "test/jar-attached/1.0-SNAPSHOT/jar-attached-1.0-SNAPSHOT-sources.jar"
);
+    System.out.println( "Checking for existence of " + attachedFile );
+    if ( !attachedFile.isFile() )
+    {
+        System.out.println( "FAILURE!" );
+        return false;
+    }
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar-attached/verify.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar/invoker.properties?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar/invoker.properties (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar/invoker.properties Sun Aug 10 13:49:08
2008
@@ -0,0 +1 @@
+invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:jar

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar/invoker.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar/invoker.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar/pom.xml?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar/pom.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar/pom.xml Sun Aug 10 13:49:08 2008
@@ -0,0 +1,46 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>test</groupId>
+  <artifactId>jar</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>Test for jar</name>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <version>@pom.version@</version>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

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

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

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/java/MyClass.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/java/MyClass.java?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/java/MyClass.java (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/java/MyClass.java Sun Aug
10 13:49:08 2008
@@ -0,0 +1,4 @@
+public class MyClass
+{
+
+}

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/java/MyClass.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/java/MyClass.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/resources/main.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/resources/main.properties?rev=684587&view=auto
==============================================================================
    (empty)

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/resources/main.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar/src/main/resources/main.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/java/MyTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/java/MyTest.java?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/java/MyTest.java (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/java/MyTest.java Sun Aug 10
13:49:08 2008
@@ -0,0 +1,4 @@
+public class MyTest
+{
+
+}

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/java/MyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/java/MyTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/resources/test.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/resources/test.properties?rev=684587&view=auto
==============================================================================
    (empty)

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/resources/test.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/jar/src/test/resources/test.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar/verify.bsh?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar/verify.bsh (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar/verify.bsh Sun Aug 10 13:49:08 2008
@@ -0,0 +1,53 @@
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import java.util.regex.*;
+
+try
+{
+    File jarFile = new File( basedir, "target/jar-1.0-SNAPSHOT-sources.jar" );
+    System.out.println( "Checking for existence of " + jarFile );
+    if ( !jarFile.isFile() )
+    {
+        System.out.println( "FAILURE!" );
+        return false;
+    }
+
+    JarFile jar = new JarFile( jarFile );
+
+    String[] includedEntries = {
+        "META-INF/MANIFEST.MF",
+        "MyClass.java",
+        "main.properties",
+    };
+    for ( String included : includedEntries )
+    {
+        System.out.println( "Checking for existence of " + included );
+        if ( jar.getEntry( included ) == null )
+        {
+            System.out.println( "FAILURE!" );
+            return false;
+        }
+    }
+
+    String[] excludedEntries = {
+        "MyTest.java",
+        "test.properties",
+    };
+    for ( String excluded : excludedEntries )
+    {
+        System.out.println( "Checking for absence of " + excluded );
+        if ( jar.getEntry( excluded ) != null )
+        {
+            System.out.println( "FAILURE!" );
+            return false;
+        }
+    }
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;

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

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

Added: maven/plugins/trunk/maven-source-plugin/src/it/settings.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/settings.xml?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/settings.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/settings.xml Sun Aug 10 13:49:08 2008
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings>
+  <profiles>
+    <profile>
+      <id>it-repo</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <repositories>
+        <repository>
+          <id>local.central</id>
+          <url>file://@localRepository@</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>local.central</id>
+          <url>file://@localRepository@</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+  </profiles>
+</settings>

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/settings.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/settings.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/test-jar/invoker.properties?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/test-jar/invoker.properties (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/test-jar/invoker.properties Sun Aug 10
13:49:08 2008
@@ -0,0 +1 @@
+invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:test-jar

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/invoker.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/invoker.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/test-jar/pom.xml?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/test-jar/pom.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/test-jar/pom.xml Sun Aug 10 13:49:08 2008
@@ -0,0 +1,46 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>test</groupId>
+  <artifactId>test-jar</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>Test for test-jar</name>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <version>@pom.version@</version>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/java/MyClass.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/java/MyClass.java?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/java/MyClass.java (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/java/MyClass.java Sun
Aug 10 13:49:08 2008
@@ -0,0 +1,4 @@
+public class MyClass
+{
+
+}

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/java/MyClass.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/java/MyClass.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/resources/main.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/resources/main.properties?rev=684587&view=auto
==============================================================================
    (empty)

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/resources/main.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/main/resources/main.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/java/MyTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/java/MyTest.java?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/java/MyTest.java (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/java/MyTest.java Sun
Aug 10 13:49:08 2008
@@ -0,0 +1,4 @@
+public class MyTest
+{
+
+}

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/java/MyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/java/MyTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/resources/test.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/resources/test.properties?rev=684587&view=auto
==============================================================================
    (empty)

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/resources/test.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/src/test/resources/test.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/test-jar/verify.bsh?rev=684587&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/test-jar/verify.bsh (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/test-jar/verify.bsh Sun Aug 10 13:49:08
2008
@@ -0,0 +1,53 @@
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import java.util.regex.*;
+
+try
+{
+    File jarFile = new File( basedir, "target/test-jar-1.0-SNAPSHOT-test-sources.jar" );
+    System.out.println( "Checking for existence of " + jarFile );
+    if ( !jarFile.isFile() )
+    {
+        System.out.println( "FAILURE!" );
+        return false;
+    }
+
+    JarFile jar = new JarFile( jarFile );
+
+    String[] includedEntries = {
+        "META-INF/MANIFEST.MF",
+        "MyTest.java",
+        "test.properties",
+    };
+    for ( String included : includedEntries )
+    {
+        System.out.println( "Checking for existence of " + included );
+        if ( jar.getEntry( included ) == null )
+        {
+            System.out.println( "FAILURE!" );
+            return false;
+        }
+    }
+
+    String[] excludedEntries = {
+        "MyClass.java",
+        "main.properties",
+    };
+    for ( String excluded : excludedEntries )
+    {
+        System.out.println( "Checking for absence of " + excluded );
+        if ( jar.getEntry( excluded ) != null )
+        {
+            System.out.println( "FAILURE!" );
+            return false;
+        }
+    }
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/test-jar/verify.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

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



Mime
View raw message