maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pg...@apache.org
Subject svn commit: r760671 - in /maven/plugins/trunk/maven-source-plugin: ./ src/it/jar-with-archive-config/ src/it/jar-with-archive-config/src/ src/it/jar-with-archive-config/src/main/ src/it/jar-with-archive-config/src/main/java/ src/it/jar-with-archive-con...
Date Tue, 31 Mar 2009 21:43:35 GMT
Author: pgier
Date: Tue Mar 31 21:43:34 2009
New Revision: 760671

URL: http://svn.apache.org/viewvc?rev=760671&view=rev
Log:
[MSOURCES-42] Use MavenArchiver and add parameter for archive configuration.  Update pom dependencies
and project stubs to get unit tests working.  Add IT for testing archive configuration.

Added:
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/invoker.properties
  (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/pom.xml   (with
props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/main/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/main/java/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/main/java/MyClass.java
  (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/main/resources/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/main/resources/main.properties
  (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/test/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/test/java/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/test/java/MyTest.java
  (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/test/resources/
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/test/resources/test.properties
  (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/verify.bsh   (with
props)
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/DefaultArtifactHandlerStub.java
  (with props)
Modified:
    maven/plugins/trunk/maven-source-plugin/pom.xml
    maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project001Stub.java
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project003Stub.java
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project005Stub.java
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project007Stub.java
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project009Stub.java
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/SourcePluginArtifactStub.java

Modified: maven/plugins/trunk/maven-source-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/pom.xml?rev=760671&r1=760670&r2=760671&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-source-plugin/pom.xml Tue Mar 31 21:43:34 2009
@@ -36,7 +36,7 @@
   <description>The Maven 2 Source Plugin creates a JAR archive of the source files
of the current project.</description>
 
   <prerequisites>
-    <maven>2.0.6</maven>
+    <maven>2.0.9</maven>
   </prerequisites>
 
   <scm>
@@ -53,32 +53,47 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-model</artifactId>
-      <version>2.0.6</version>
+      <version>2.0.9</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact</artifactId>
-      <version>2.0.6</version>
+      <version>2.0.9</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
-      <version>2.0.6</version>
+      <version>2.0.9</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
-      <version>2.0.6</version>
+      <version>2.0.9</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-archiver</artifactId>
+      <version>2.3</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-archiver</artifactId>
-      <version>1.0-alpha-7</version>
+      <version>1.0-alpha-9</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.codehaus.plexus</groupId>
+          <artifactId>plexus-container-default</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.codehaus.plexus</groupId>
+          <artifactId>plexus-component-api</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>1.5.6</version>
+      <version>1.5.8</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
@@ -87,9 +102,9 @@
     </dependency>
 
     <dependency>
-      <groupId>org.apache.maven.shared</groupId>
+      <groupId>org.apache.maven.plugin-testing</groupId>
       <artifactId>maven-plugin-testing-harness</artifactId>
-      <version>1.0-beta-1</version>
+      <version>1.2</version>
       <scope>test</scope>
     </dependency>
     <dependency>

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/invoker.properties?rev=760671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/invoker.properties
(added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/invoker.properties
Tue Mar 31 21:43:34 2009
@@ -0,0 +1 @@
+invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:jar

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

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

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/pom.xml?rev=760671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/pom.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/pom.xml Tue Mar
31 21:43:34 2009
@@ -0,0 +1,54 @@
+<?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>
+        <configuration>
+          <archive>
+            <manifest>
+              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+            </manifest>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

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

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

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/main/java/MyClass.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/main/java/MyClass.java?rev=760671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/main/java/MyClass.java
(added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/main/java/MyClass.java
Tue Mar 31 21:43:34 2009
@@ -0,0 +1,4 @@
+public class MyClass
+{
+
+}

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

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

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

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

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

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/test/java/MyTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/test/java/MyTest.java?rev=760671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/test/java/MyTest.java
(added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/src/test/java/MyTest.java
Tue Mar 31 21:43:34 2009
@@ -0,0 +1,4 @@
+public class MyTest
+{
+
+}

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

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

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

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

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

Added: maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/verify.bsh?rev=760671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/verify.bsh (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/jar-with-archive-config/verify.bsh Tue
Mar 31 21:43:34 2009
@@ -0,0 +1,62 @@
+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;
+        }
+    }
+    
+    System.out.println( "Checking manifest for attribute: Implementation-Version " );
+    Map manifestAttributes = jar.getManifest().getMainAttributes();
+    String implVersion = manifestAttributes.getValue( "Implementation-Version" );
+    if ( implVersion == 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-with-archive-config/verify.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

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

Modified: maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java?rev=760671&r1=760670&r2=760671&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java
(original)
+++ maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java
Tue Mar 31 21:43:34 2009
@@ -19,6 +19,9 @@
  * under the License.
  */
 
+import org.apache.maven.archiver.MavenArchiveConfiguration;
+import org.apache.maven.archiver.MavenArchiver;
+import org.apache.maven.artifact.DependencyResolutionRequiredException;
 import org.apache.maven.model.Resource;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -27,6 +30,7 @@
 import org.codehaus.plexus.archiver.Archiver;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.jar.JarArchiver;
+import org.codehaus.plexus.archiver.jar.ManifestException;
 import org.codehaus.plexus.util.FileUtils;
 
 import java.io.File;
@@ -47,6 +51,8 @@
 {
     private static final String[] DEFAULT_INCLUDES = new String[]{"**/*"};
 
+    private static final String[] DEFAULT_EXCLUDES = new String[]{};
+    
     /**
      * The Maven Project Object
      *
@@ -57,6 +63,42 @@
     protected MavenProject project;
 
     /**
+     * The Jar archiver.
+     *
+     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
+     */
+    private JarArchiver jarArchiver;
+
+    /**
+     * The archive configuration to use.
+     * See <a href="http://maven.apache.org/shared/maven-archiver/index.html">Maven
Archiver Reference</a>.
+     *
+     * @parameter
+     * @since 2.1
+     */
+    private MavenArchiveConfiguration archive = new MavenArchiveConfiguration();
+
+    /**
+     * Path to the default MANIFEST file to use. It will be used if
+     * <code>useDefaultManifestFile</code> is set to <code>true</code>.
+     *
+     * @parameter expression="${project.build.outputDirectory}/META-INF/MANIFEST.MF"
+     * @required
+     * @readonly
+     * @since 2.1
+     */
+    private File defaultManifestFile;
+
+    /**
+     * Set this to <code>true</code> to enable the use of the <code>defaultManifestFile</code>.
+     * <br/>
+     *
+     * @parameter default-value="false"
+     * @since 2.1
+     */
+    private boolean useDefaultManifestFile;
+
+    /**
      * Specifies whether or not to attach the artifact to the project
      *
      * @parameter expression="${attach}" default-value="true"
@@ -173,7 +215,7 @@
             return;
         }
 
-        Archiver archiver = createArchiver();
+        MavenArchiver archiver = createArchiver();
 
         for ( Iterator i = projects.iterator(); i.hasNext(); )
         {
@@ -184,14 +226,21 @@
                 continue;
             }
 
-            archiveProjectContent( subProject, archiver );
+            archiveProjectContent( subProject, archiver.getArchiver() );
         }
 
+        if ( useDefaultManifestFile && defaultManifestFile.exists() && archive.getManifestFile()
== null )
+        {
+            getLog().info( "Adding existing MANIFEST to archive. Found under: " + defaultManifestFile.getPath()
);
+            archive.setManifestFile( defaultManifestFile );
+        }
+        
         File outputFile = new File( outputDirectory, finalName + "-" + getClassifier() +
getExtension() );
         try
         {
-            archiver.setDestFile( outputFile );
-            archiver.createArchive();
+            archiver.setOutputFile( outputFile );
+            archive.setAddMavenDescriptor( false );
+            archiver.createArchive( project, archive );
         }
         catch ( IOException e )
         {
@@ -201,6 +250,14 @@
         {
             throw new MojoExecutionException( "Error creating source archive: " + e.getMessage(),
e );
         }
+        catch ( DependencyResolutionRequiredException e )
+        {
+            throw new MojoExecutionException( "Error creating source archive: " + e.getMessage(),
e );
+        }
+        catch ( ManifestException e )
+        {
+            throw new MojoExecutionException( "Error creating source archive: " + e.getMessage(),
e );
+        }
 
         if ( attach )
         {
@@ -293,11 +350,12 @@
         }
     }
 
-    protected Archiver createArchiver()
+    protected MavenArchiver createArchiver()
         throws MojoExecutionException
     {
-        Archiver archiver = new JarArchiver();
-
+        MavenArchiver archiver = new MavenArchiver();
+        archiver.setArchiver( jarArchiver );
+ 
         if ( project.getBuild() != null )
         {
             List resources = project.getBuild().getResources();
@@ -308,7 +366,7 @@
 
                 if ( r.getDirectory().endsWith( "maven-shared-archive-resources" ) )
                 {
-                    addDirectory( archiver, new File( r.getDirectory() ), DEFAULT_INCLUDES,
new String[]{} );
+                    addDirectory( archiver.getArchiver(), new File( r.getDirectory() ), DEFAULT_INCLUDES,
DEFAULT_EXCLUDES );
                 }
             }
         }

Added: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/DefaultArtifactHandlerStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/DefaultArtifactHandlerStub.java?rev=760671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/DefaultArtifactHandlerStub.java
(added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/DefaultArtifactHandlerStub.java
Tue Mar 31 21:43:34 2009
@@ -0,0 +1,46 @@
+package org.apache.maven.plugin.source.stubs;
+
+/*
+ * 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 org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+/**
+ * @author pgier
+ */
+public class DefaultArtifactHandlerStub
+    extends DefaultArtifactHandler
+{
+    private String language;
+
+    public String getLanguage()
+    {
+        if ( language == null )
+        {
+            language = "java";
+        }
+
+        return language;
+    }
+
+    public void setLanguage( String language )
+    {
+        this.language = language;
+    }
+}

Propchange: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/DefaultArtifactHandlerStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/DefaultArtifactHandlerStub.java
------------------------------------------------------------------------------
    svn:executable = *

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

Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project001Stub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project001Stub.java?rev=760671&r1=760670&r2=760671&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project001Stub.java
(original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project001Stub.java
Tue Mar 31 21:43:34 2009
@@ -77,8 +77,11 @@
             setResources( model.getBuild().getResources() );
             setTestResources( model.getBuild().getTestResources() );
 
-            Artifact artifact =
+            SourcePluginArtifactStub artifact =
                 new SourcePluginArtifactStub( getGroupId(), getArtifactId(), getVersion(),
getPackaging(), null );
+            artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );
+            artifact.setType( "jar" );
+            artifact.setBaseVersion( "1.0-SNAPSHOT" );
             setArtifact( artifact );
 
         }

Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project003Stub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project003Stub.java?rev=760671&r1=760670&r2=760671&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project003Stub.java
(original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project003Stub.java
Tue Mar 31 21:43:34 2009
@@ -77,8 +77,11 @@
             setResources( model.getBuild().getResources() );
             setTestResources( model.getBuild().getTestResources() );
 
-            Artifact artifact =
+            SourcePluginArtifactStub artifact =
                 new SourcePluginArtifactStub( getGroupId(), getArtifactId(), getVersion(),
getPackaging(), null );
+            artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );
+            artifact.setType( "jar" );
+            artifact.setBaseVersion( "1.0-SNAPSHOT" );
             setArtifact( artifact );
 
         }

Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project005Stub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project005Stub.java?rev=760671&r1=760670&r2=760671&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project005Stub.java
(original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project005Stub.java
Tue Mar 31 21:43:34 2009
@@ -64,8 +64,11 @@
             build.setDirectory( getBasedir() + "/target/test/unit/project-005/target" );
             setBuild( build );
 
-            Artifact artifact =
+            SourcePluginArtifactStub artifact =
                 new SourcePluginArtifactStub( getGroupId(), getArtifactId(), getVersion(),
getPackaging(), null );
+            artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );
+            artifact.setType( "jar" );
+            artifact.setBaseVersion( "1.0-SNAPSHOT" );
             setArtifact( artifact );
 
         }

Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project007Stub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project007Stub.java?rev=760671&r1=760670&r2=760671&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project007Stub.java
(original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project007Stub.java
Tue Mar 31 21:43:34 2009
@@ -77,8 +77,11 @@
             setResources( model.getBuild().getResources() );
             setTestResources( model.getBuild().getTestResources() );
 
-            Artifact artifact =
+            SourcePluginArtifactStub artifact =
                 new SourcePluginArtifactStub( getGroupId(), getArtifactId(), getVersion(),
getPackaging(), null );
+            artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );
+            artifact.setType( "jar" );
+            artifact.setBaseVersion( "1.0-SNAPSHOT" );
             setArtifact( artifact );
 
         }

Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project009Stub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project009Stub.java?rev=760671&r1=760670&r2=760671&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project009Stub.java
(original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project009Stub.java
Tue Mar 31 21:43:34 2009
@@ -78,8 +78,11 @@
             setResources( model.getBuild().getResources() );
             setTestResources( model.getBuild().getTestResources() );
 
-            Artifact artifact =
+            SourcePluginArtifactStub artifact =
                 new SourcePluginArtifactStub( getGroupId(), getArtifactId(), getVersion(),
getPackaging(), null );
+            artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );
+            artifact.setType( "jar" );
+            artifact.setBaseVersion( "1.0-SNAPSHOT" );
             setArtifact( artifact );
         }
         catch ( Exception e )

Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/SourcePluginArtifactStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/SourcePluginArtifactStub.java?rev=760671&r1=760670&r2=760671&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/SourcePluginArtifactStub.java
(original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/SourcePluginArtifactStub.java
Tue Mar 31 21:43:34 2009
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.plugin.testing.stubs.ArtifactStub;
 
 /**
@@ -38,6 +40,12 @@
 
     private String classifier;
 
+    private String baseVersion;
+    
+    private VersionRange versionRange;
+
+    private ArtifactHandler handler;
+
     public SourcePluginArtifactStub( String groupId, String artifactId, String version, String
type, String classifier )
     {
         this.groupId = groupId;
@@ -45,6 +53,7 @@
         this.version = version;
         this.type = type;
         this.classifier = classifier;
+        versionRange = VersionRange.createFromVersion( version );
     }
 
     public void setGroupId( String groupId )
@@ -116,4 +125,34 @@
         return id;
     }
 
+    public VersionRange getVersionRange()
+    {
+        return versionRange;
+    }
+
+    public void setVersionRange( VersionRange versionRange )
+    {
+        this.versionRange = versionRange;
+    }
+
+    public String getBaseVersion()
+    {
+        return baseVersion;
+    }
+
+    public void setBaseVersion( String baseVersion )
+    {
+        this.baseVersion = baseVersion;
+    }
+    
+    public ArtifactHandler getArtifactHandler()
+    {
+        return handler;
+    }
+
+    public void setArtifactHandler( ArtifactHandler handler )
+    {
+        this.handler = handler;
+    }
+
 }



Mime
View raw message