You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sn...@apache.org on 2007/02/04 18:15:13 UTC
svn commit: r503445 - in /maven/plugins/trunk/maven-source-plugin: ./
src/main/java/org/apache/maven/plugin/source/
src/test/java/org/apache/maven/plugin/source/
src/test/java/org/apache/maven/plugin/source/stubs/
src/test/resources/projects/ src/test/...
Author: snicoll
Date: Sun Feb 4 09:15:08 2007
New Revision: 503445
URL: http://svn.apache.org/viewvc?view=rev&rev=503445
Log:
MSOURCES-6: custom includes/excludes are now taken into account; refactored test cases; fix regression bug which generated the source archive for a project with POM packaging.
Added:
maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/AbstractSourcePluginTestCase.java
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/pom.xml
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/java/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/java/foo/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/java/foo/project001/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/java/foo/project001/App.java
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/resources/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/resources/default-configuration.properties
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/pom.xml
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/java/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/java/foo/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/java/foo/project002/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/java/foo/project002/App.java
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/resources/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/resources/default-configuration.properties
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/java/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/java/foo/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/java/foo/project002/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/java/foo/project002/AppTest.java
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/resources/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/resources/test-default-configuration.properties
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/pom.xml
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/java/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/java/foo/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/java/foo/project003/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/java/foo/project003/App.java
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/.cvsignore
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/default-configuration.properties
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/excluded-file.txt
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/pom.xml
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/java/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/java/foo/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/java/foo/project004/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/java/foo/project004/App.java
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/resources/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/resources/default-configuration.properties
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/java/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/java/foo/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/java/foo/project004/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/java/foo/project004/AppTest.java
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/.cvsignore
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/excluded-file.txt
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/test-default-configuration.properties
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-005/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-005/pom.xml
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-006/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-006/pom.xml
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/pom.xml
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/java/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/java/foo/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/java/foo/project007/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/java/foo/project007/App.java
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/resources/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/resources/default-configuration.properties
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/resources/templates/
maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/resources/templates/configuration-template.properties
Removed:
maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/
maven/plugins/trunk/maven-source-plugin/src/test/resources/unit/
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/SourceJarMojoTest.java
maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/TestSourceJarMojoTest.java
Modified: maven/plugins/trunk/maven-source-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/pom.xml?view=diff&rev=503445&r1=503444&r2=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-source-plugin/pom.xml Sun Feb 4 09:15:08 2007
@@ -58,9 +58,24 @@
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-plugin-testing-harness</artifactId>
- <version>1.0-beta-1</version>
- </dependency>
+ <artifactId>maven-verifier</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <!-- We need this otherwhise surefire picks up our fake test classes -->
+ <exclude>projects/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
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?view=diff&rev=503445&r1=503444&r2=503445
==============================================================================
--- 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 Sun Feb 4 09:15:08 2007
@@ -70,7 +70,9 @@
*/
private boolean attach = true;
- /** @component */
+ /**
+ * @component
+ */
private MavenProjectHelper projectHelper;
/**
@@ -101,10 +103,14 @@
//
//MAPI: how to make this backward compatible
- /** @parameter expression="${aggregate}" default-value="true" */
+ /**
+ * @parameter expression="${aggregate}" default-value="true"
+ */
protected boolean aggregate;
- /** @parameter expression="${reactorProjects}" */
+ /**
+ * @parameter expression="${reactorProjects}"
+ */
protected List reactorProjects;
protected abstract String getClassifier();
@@ -113,7 +119,9 @@
protected abstract List getResources( MavenProject project );
- /** @see org.apache.maven.plugin.AbstractMojo#execute() */
+ /**
+ * @see org.apache.maven.plugin.AbstractMojo#execute()
+ */
public void execute()
throws MojoExecutionException
{
@@ -132,7 +140,7 @@
protected void packageSources( List projects )
throws MojoExecutionException
{
- if ( "pom".equals( packaging ) && !aggregate )
+ if ( "pom".equals( packaging ) )
{
getLog().info( "NOT adding sources to attached artifacts for packaging: \'" + packaging + "\'." );
}
@@ -177,12 +185,15 @@
{
projectHelper.attachArtifact( project, "java-source", getClassifier(), outputFile );
}
+ else
+ {
+ getLog().info( "NOT adding java-sources to attached artifacts list." );
+ }
}
}
}
- protected void archiveProjectContent( MavenProject project,
- Archiver archiver )
+ protected void archiveProjectContent( MavenProject project, Archiver archiver )
throws MojoExecutionException
{
for ( Iterator i = getSources( project ).iterator(); i.hasNext(); )
@@ -222,7 +233,7 @@
String[] excludes;
- if ( resourceIncludes == null || resourceIncludes.size() == 0 )
+ if ( resourceExcludes == null || resourceExcludes.size() == 0 )
{
excludes = FileUtils.getDefaultExcludes();
}
@@ -242,8 +253,7 @@
* @param outputFile the artifact file to be attached
* @param classifier
*/
- protected void attachArtifact( File outputFile,
- String classifier )
+ protected void attachArtifact( File outputFile, String classifier )
{
}
@@ -270,10 +280,7 @@
return archiver;
}
- protected void addDirectory( Archiver archiver,
- File sourceDirectory,
- String[] includes,
- String[] excludes )
+ protected void addDirectory( Archiver archiver, File sourceDirectory, String[] includes, String[] excludes )
throws MojoExecutionException
{
try
Added: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/AbstractSourcePluginTestCase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/AbstractSourcePluginTestCase.java?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/AbstractSourcePluginTestCase.java (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/AbstractSourcePluginTestCase.java Sun Feb 4 09:15:08 2007
@@ -0,0 +1,258 @@
+package org.apache.maven.plugin.source;
+
+import junit.framework.TestCase;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Properties;
+import java.util.Enumeration;
+
+import java.util.zip.ZipEntry;
+
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.VerificationException;
+import org.apache.maven.it.util.ResourceExtractor;
+import org.codehaus.plexus.archiver.zip.ZipFile;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author Stephane Nicoll
+ */
+public abstract class AbstractSourcePluginTestCase
+ extends TestCase
+{
+
+ protected final String FINAL_NAME_PREFIX = "maven-source-plugin-test-";
+
+ protected final String FINAL_NAME_SUFFIX = "-99.0";
+
+ /**
+ * The base directory.
+ */
+ private File basedir;
+
+ /**
+ * Execute the souce plugin for the specified project.
+ *
+ * @param projectName the name of the project
+ * @param properties extra properties to be used by the embedder
+ * @param expectNoError whether an exception is expected or not
+ * @return the base directory of the project
+ * @throws Exception if an error occured
+ */
+ protected File executeMojo( final String projectName, final Properties properties, boolean expectNoError )
+ throws Exception
+ {
+ File testDir = getTestDir( projectName );
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+
+ // Turn On debug logs
+ //verifier.getCliOptions().add( "-X" );
+
+ // On linux and macOSX, an exception is thrown if a build failure occurs underneath
+ try
+ {
+ verifier.executeGoal( "package" );
+ }
+ catch ( VerificationException e )
+ {
+ //@TODO needs to be handled nicely in the verifier
+ if ( expectNoError || e.getMessage().indexOf( "Exit code was non-zero" ) == -1 )
+ {
+ throw e;
+ }
+ }
+
+ // If no error is expected make sure that error logs are free
+ if ( expectNoError )
+ {
+ verifier.verifyErrorFreeLog();
+ }
+ verifier.resetStreams();
+ return testDir;
+ }
+
+
+ /**
+ * Execute the source plugin for the specified project.
+ *
+ * @param projectName the name of the project
+ * @param properties extra properties to be used by the embedder
+ * @return the base directory of the project
+ * @throws Exception if an error occured
+ */
+ protected File executeMojo( final String projectName, final Properties properties )
+ throws Exception
+ {
+ return executeMojo( projectName, properties, true );
+ }
+
+ /**
+ * Executes the specified projects and asserts the given artifacts.
+ *
+ * @param projectName the project to test
+ * @param expectSourceArchive if a source archive is expected
+ * @param expectTestSourceArchive if a test source archive is expected
+ * @param expectedSourceFiles the expected files in the source archive, if any
+ * @param expectedTestSourceFiles the expected files in the test source archive, if any
+ * @return the base directory of the project
+ * @throws Exception if any error occurs
+ */
+ protected File doTestProject( final String projectName, boolean expectSourceArchive,
+ boolean expectTestSourceArchive, final String[] expectedSourceFiles,
+ final String[] expectedTestSourceFiles )
+ throws Exception
+ {
+ final File baseDir = executeMojo( projectName, new Properties() );
+
+ if ( expectSourceArchive )
+ {
+ assertSourceArchive( baseDir, projectName );
+ assertJarContent( getSourceArchive( baseDir, projectName ), expectedSourceFiles );
+ }
+
+ if ( expectTestSourceArchive )
+ {
+ assertTestSourceArchive( baseDir, projectName );
+ assertJarContent( getTestSourceArchive( baseDir, projectName ), expectedTestSourceFiles );
+ }
+
+ return baseDir;
+ }
+
+ /**
+ * Executes the specified projects and asserts the given artifacts for a source archive.
+ *
+ * @param projectName the project to test
+ * @param expectedSourceFiles the expected files in the source archive, if any
+ * @return the base directory of the project
+ * @throws Exception if any error occurs
+ */
+ protected File doTestProjectWithSourceArchive( final String projectName, final String[] expectedSourceFiles )
+ throws Exception
+ {
+ return doTestProject( projectName, true, false, expectedSourceFiles, null );
+ }
+
+ /**
+ * Executes the specified projects and asserts the given artifacts for a test source archive.
+ *
+ * @param projectName the project to test
+ * @param expectedTestSourceFiles the expected files in the test source archive, if any
+ * @return the base directory of the project
+ * @throws Exception if any error occurs
+ */
+ protected File doTestProjectWithTestSourceArchive( final String projectName,
+ final String[] expectedTestSourceFiles )
+ throws Exception
+ {
+ return doTestProject( projectName, false, true, null, expectedTestSourceFiles );
+ }
+
+
+ protected void assertSourceArchive( final File baseDir, final String projectName )
+ {
+ final File expectedFile = getSourceArchive( baseDir, projectName );
+ assertTrue( "Source archive does not exist["+expectedFile.getAbsolutePath()+"]", expectedFile.exists() );
+ }
+
+ protected void assertTestSourceArchive( final File baseDir, final String projectName )
+ {
+ final File expectedFile = getTestSourceArchive( baseDir, projectName );
+ assertTrue( "Test source archive does not exist["+expectedFile.getAbsolutePath()+"]", expectedFile.exists() );
+ }
+
+ protected File getTargetDirectory( final File basedir )
+ {
+ return new File( basedir, "target" );
+ }
+
+ protected File getSourceArchive( final File baseDir, final String projectName )
+ {
+ return new File( getTargetDirectory( baseDir ), buildFinalSourceName( projectName ) + ".jar" );
+ }
+
+ protected File getTestSourceArchive( final File baseDir, final String projectName )
+ {
+ return new File( getTargetDirectory( baseDir ), buildFinalTestSourceName( projectName ) + ".jar" );
+ }
+
+ protected String buildFinalSourceName( final String projectName )
+ {
+ return FINAL_NAME_PREFIX + projectName + FINAL_NAME_SUFFIX + "-sources";
+ }
+
+ protected String buildFinalTestSourceName( final String projectName )
+ {
+ return FINAL_NAME_PREFIX + projectName + FINAL_NAME_SUFFIX + "-test-sources";
+ }
+
+ protected File getTestDir( String projectName )
+ throws IOException
+ {
+ return ResourceExtractor.simpleExtractResources( getClass(), "/projects/" + projectName );
+ }
+
+ protected File getBasedir()
+ {
+ if ( basedir != null )
+ {
+ return basedir;
+ }
+
+ final String basedirString = System.getProperty( "basedir" );
+ if ( basedirString == null )
+ {
+ basedir = new File( "" );
+ }
+ else
+ {
+ basedir = new File( basedirString );
+ }
+ return basedir;
+ }
+
+ protected void assertJarContent( final File jarFile, final String[] expectedFiles )
+ throws IOException
+ {
+
+ ZipFile jar = new ZipFile( jarFile );
+ Enumeration entries = jar.getEntries();
+
+ if ( expectedFiles.length == 0 )
+ {
+ assertFalse( "Jar file should not contain any entry", entries.hasMoreElements() );
+ }
+ else
+ {
+ assertTrue( entries.hasMoreElements() );
+ for ( int i = 0; i < expectedFiles.length; i++ )
+ {
+ String expectedFile = expectedFiles[i];
+ ZipEntry entry = (ZipEntry) entries.nextElement();
+ assertEquals( expectedFile, entry.getName() );
+ }
+
+ // Now we are done, assert that there is no more element
+ assertFalse( "Jar file contains more elements than expected", entries.hasMoreElements() );
+ }
+ }
+}
Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/SourceJarMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/SourceJarMojoTest.java?view=diff&rev=503445&r1=503444&r2=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/SourceJarMojoTest.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/SourceJarMojoTest.java Sun Feb 4 09:15:08 2007
@@ -19,183 +19,54 @@
* under the License.
*/
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.codehaus.plexus.archiver.zip.ZipEntry;
-import org.codehaus.plexus.archiver.zip.ZipFile;
-import org.codehaus.plexus.util.FileUtils;
-
import java.io.File;
-import java.util.Enumeration;
+import java.util.Properties;
/**
* @author <a href="mailto:oching@exist.com">Maria Odea Ching</a>
*/
public class SourceJarMojoTest
- extends AbstractMojoTestCase
+ extends AbstractSourcePluginTestCase
{
- protected void setUp()
- throws Exception
- {
- // required for mojo lookups to work
- super.setUp();
-
- }
-
- public void testDefaultConfiguration()
- throws Exception
- {
- File testPom =
- new File( getBasedir(), "src/test/resources/unit/default-configuration/default-configuration-config.xml" );
-
- try
- {
- SourceJarMojo mojo = (SourceJarMojo) lookupMojo( "jar", testPom );
-
- mojo.execute();
- }
- catch ( Exception e )
- {
- fail( "Cannot execute mojo!" );
-
- e.printStackTrace();
- }
-
- //check if the jar file exists
- File sourceJar =
- new File( getBasedir(), "target/test/unit/default-configuration/target/default-configuration-sources.jar" );
-
- assertTrue( FileUtils.fileExists( sourceJar.getAbsolutePath() ) );
-
- ZipFile jar = new ZipFile( sourceJar );
- Enumeration entries = jar.getEntries();
- assertTrue( entries.hasMoreElements() );
-
- if ( entries.hasMoreElements() )
- {
- ZipEntry entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "default-configuration.properties" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "def/configuration/App.java" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "def/configuration/" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "def/" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "META-INF/MANIFEST.MF" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "META-INF/" );
- }
-
- }
- public void testCustomConfiguration()
+ public void testProject001()
throws Exception
{
+ doTestProjectWithSourceArchive( "project-001", new String[]{"default-configuration.properties",
+ "foo/project001/App.java", "foo/project001/", "foo/", "META-INF/MANIFEST.MF", "META-INF/"
- File testPom =
- new File( getBasedir(), "src/test/resources/unit/custom-configuration/custom-configuration-config.xml" );
-
- try
- {
- SourceJarMojo mojo = (SourceJarMojo) lookupMojo( "jar", testPom );
-
- mojo.execute();
- }
- catch ( Exception e )
- {
- e.printStackTrace();
- }
-
- //check if the jar file exists
- File sourceJar =
- new File( getBasedir(), "target/test/unit/custom-configuration/target/custom-configuration-sources.jar" );
-
- assertTrue( FileUtils.fileExists( sourceJar.getAbsolutePath() ) );
-
- //verify the contents of the jar file
- ZipFile jar = new ZipFile( sourceJar );
- Enumeration entries = jar.getEntries();
- assertTrue( entries.hasMoreElements() );
-
- if ( entries.hasMoreElements() )
- {
- ZipEntry entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "custom-configuration.properties" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "custom/configuration/App.java" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "custom/configuration/" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "custom/" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "META-INF/MANIFEST.MF" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "META-INF/" );
- }
-
-
+ } );
}
- public void testInvalidPackaging()
+ public void testProject003()
throws Exception
{
- File testPom =
- new File( getBasedir(), "src/test/resources/unit/invalid-packaging/invalid-packaging-config.xml" );
-
- try
- {
- SourceJarMojo mojo = (SourceJarMojo) lookupMojo( "jar", testPom );
- mojo.execute();
- }
- catch ( Exception e )
- {
- e.printStackTrace();
- }
-
- File sourceJar =
- new File( getBasedir(), "target/test/unit/invalid-packaging/target/invalid-packaging-sources.jar" );
- assertFalse( FileUtils.fileExists( sourceJar.getAbsolutePath() ) );
+ doTestProjectWithSourceArchive( "project-003", new String[]{"default-configuration.properties",
+ "foo/project003/App.java", "foo/project003/", "foo/", "META-INF/MANIFEST.MF", "META-INF/"
+ } );
}
- public void testGetterMethods()
+ public void testProject005()
throws Exception
{
- File testPom =
- new File( getBasedir(), "src/test/resources/unit/custom-configuration/custom-configuration-config.xml" );
-
- try
- {
- SourceJarMojo mojo = (SourceJarMojo) lookupMojo( "jar", testPom );
-
- mojo.execute();
-
- //assertNotNull( mojo.getPackaging() );
- //assertNotNull( mojo.getProject() );
- //assertNotNull( mojo.getExecutedProject() );
- }
- catch ( Exception e )
- {
- e.printStackTrace();
- }
+ final File baseDir = executeMojo( "project-005", new Properties() );
+ // Now make sure that no archive got created
+ final File expectedFile = getSourceArchive( baseDir, "project-005" );
+ assertFalse( "Source archive should not have been created[" + expectedFile.getAbsolutePath() + "]",
+ expectedFile.exists() );
}
- protected void tearDown()
+ public void testProject007()
throws Exception
{
+ doTestProjectWithSourceArchive( "project-007", new String[]{"templates/configuration-template.properties",
+ "foo/project007/App.java", "templates/", "foo/project007/", "foo/", "META-INF/MANIFEST.MF", "META-INF/"
+ } );
}
+
}
Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/TestSourceJarMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/TestSourceJarMojoTest.java?view=diff&rev=503445&r1=503444&r2=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/TestSourceJarMojoTest.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/TestSourceJarMojoTest.java Sun Feb 4 09:15:08 2007
@@ -19,156 +19,43 @@
* under the License.
*/
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.codehaus.plexus.archiver.zip.ZipEntry;
-import org.codehaus.plexus.archiver.zip.ZipFile;
-import org.codehaus.plexus.util.FileUtils;
-
import java.io.File;
-import java.util.Enumeration;
+import java.util.Properties;
/**
* @author <a href="mailto:oching@exist.com">Maria Odea Ching</a>
*/
public class TestSourceJarMojoTest
- extends AbstractMojoTestCase
+ extends AbstractSourcePluginTestCase
{
- protected void setUp()
+ public void testProject002()
throws Exception
{
- // required for mojo lookups to work
- super.setUp();
-
- }
-
-
- public void testDefaultConfiguration()
- throws Exception
- {
- File testPom =
- new File( getBasedir(), "src/test/resources/unit/default-configuration/default-configuration-config.xml" );
-
- try
- {
- TestSourceJarMojo mojo = (TestSourceJarMojo) lookupMojo( "test-jar", testPom );
- mojo.execute();
- }
- catch ( Exception e )
- {
- fail( "Cannot execute mojo." );
-
- e.printStackTrace();
- }
-
- //check if the jar file exists
- File sourceJar = new File( getBasedir(),
- "target/test/unit/default-configuration/target/default-configuration-test-sources.jar" );
-
- assertTrue( FileUtils.fileExists( sourceJar.getAbsolutePath() ) );
-
- ZipFile jar = new ZipFile( sourceJar );
- Enumeration entries = jar.getEntries();
- assertTrue( entries.hasMoreElements() );
-
- if ( entries.hasMoreElements() )
- {
- ZipEntry entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "test-default-configuration.properties" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "def/configuration/AppTest.java" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "def/configuration/" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "def/" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "META-INF/MANIFEST.MF" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "META-INF/" );
- }
+ doTestProjectWithTestSourceArchive( "project-002", new String[]{"test-default-configuration.properties",
+ "foo/project002/AppTest.java", "foo/project002/", "foo/", "META-INF/MANIFEST.MF", "META-INF/"
+ } );
}
- public void testCustomConfiguration()
+ public void testProject004()
throws Exception
{
- File testPom =
- new File( getBasedir(), "src/test/resources/unit/custom-configuration/custom-configuration-config.xml" );
-
- try
- {
- TestSourceJarMojo mojo = (TestSourceJarMojo) lookupMojo( "test-jar", testPom );
- mojo.execute();
- }
- catch ( Exception e )
- {
- e.printStackTrace();
- }
-
- //check if the jar file exists
- File sourceJar = new File( getBasedir(),
- "target/test/unit/custom-configuration/target/custom-configuration-test-sources.jar" );
- assertTrue( FileUtils.fileExists( sourceJar.getAbsolutePath() ) );
-
- //verify the contents of the jar file
- ZipFile jar = new ZipFile( sourceJar );
- Enumeration entries = jar.getEntries();
- assertTrue( entries.hasMoreElements() );
-
- if ( entries.hasMoreElements() )
- {
- ZipEntry entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "test-custom-configuration.properties" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "custom/configuration/AppTest.java" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "custom/configuration/" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "custom/" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "META-INF/MANIFEST.MF" );
-
- entry = (ZipEntry) entries.nextElement();
- assertEquals( entry.getName(), "META-INF/" );
- }
-
+ doTestProjectWithTestSourceArchive( "project-004", new String[]{"test-default-configuration.properties",
+ "foo/project004/AppTest.java", "foo/project004/", "foo/", "META-INF/MANIFEST.MF", "META-INF/"
+ } );
}
- public void testInvalidPackaging()
+ public void testProject006()
throws Exception
{
- File testPom =
- new File( getBasedir(), "src/test/resources/unit/invalid-packaging/invalid-packaging-config.xml" );
-
- try
- {
- TestSourceJarMojo mojo = (TestSourceJarMojo) lookupMojo( "test-jar", testPom );
- mojo.execute();
- }
- catch ( Exception e )
- {
- e.printStackTrace();
- }
-
- File sourceJar =
- new File( getBasedir(), "target/test/unit/invalid-packaging/target/invalid-packaging-test-sources.jar" );
- assertFalse( FileUtils.fileExists( sourceJar.getAbsolutePath() ) );
+ final File baseDir = executeMojo( "project-006", new Properties() );
+ // Now make sure that no archive got created
+ final File expectedFile = getTestSourceArchive( baseDir, "project-006" );
+ assertFalse( "Test source archive should not have been created[" + expectedFile.getAbsolutePath() + "]",
+ expectedFile.exists() );
}
- protected void tearDown()
- throws Exception
- {
-
- }
}
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/pom.xml?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/pom.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/pom.xml Sun Feb 4 09:15:08 2007
@@ -0,0 +1,53 @@
+<?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>source</groupId>
+ <artifactId>maven-source-plugin-test-project-001</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/java/foo/project001/App.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/java/foo/project001/App.java?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/java/foo/project001/App.java (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/java/foo/project001/App.java Sun Feb 4 09:15:08 2007
@@ -0,0 +1,32 @@
+package foo.project001;
+
+/*
+ * 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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/resources/default-configuration.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/resources/default-configuration.properties?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/resources/default-configuration.properties (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-001/src/main/resources/default-configuration.properties Sun Feb 4 09:15:08 2007
@@ -0,0 +1,16 @@
+# 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.
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/pom.xml?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/pom.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/pom.xml Sun Feb 4 09:15:08 2007
@@ -0,0 +1,53 @@
+<?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>source</groupId>
+ <artifactId>maven-source-plugin-test-project-002</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-test-sources</id>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/java/foo/project002/App.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/java/foo/project002/App.java?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/java/foo/project002/App.java (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/java/foo/project002/App.java Sun Feb 4 09:15:08 2007
@@ -0,0 +1,32 @@
+package foo.project002;
+
+/*
+ * 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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/resources/default-configuration.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/resources/default-configuration.properties?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/resources/default-configuration.properties (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/main/resources/default-configuration.properties Sun Feb 4 09:15:08 2007
@@ -0,0 +1,16 @@
+# 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.
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/java/foo/project002/AppTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/java/foo/project002/AppTest.java?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/java/foo/project002/AppTest.java (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/java/foo/project002/AppTest.java Sun Feb 4 09:15:08 2007
@@ -0,0 +1,57 @@
+package foo.project002;
+
+/*
+ * 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 junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/resources/test-default-configuration.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/resources/test-default-configuration.properties?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/resources/test-default-configuration.properties (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-002/src/test/resources/test-default-configuration.properties Sun Feb 4 09:15:08 2007
@@ -0,0 +1,16 @@
+# 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.
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/pom.xml?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/pom.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/pom.xml Sun Feb 4 09:15:08 2007
@@ -0,0 +1,61 @@
+<?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>source</groupId>
+ <artifactId>maven-source-plugin-test-project-003</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <excludes>
+ <exclude>excluded-file.txt</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/java/foo/project003/App.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/java/foo/project003/App.java?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/java/foo/project003/App.java (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/java/foo/project003/App.java Sun Feb 4 09:15:08 2007
@@ -0,0 +1,32 @@
+package foo.project003;
+
+/*
+ * 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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/.cvsignore
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/.cvsignore?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/.cvsignore (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/.cvsignore Sun Feb 4 09:15:08 2007
@@ -0,0 +1 @@
+## we don't care about this one since it's handled by default excludes (well at least it should).
\ No newline at end of file
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/default-configuration.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/default-configuration.properties?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/default-configuration.properties (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/default-configuration.properties Sun Feb 4 09:15:08 2007
@@ -0,0 +1,16 @@
+# 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.
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/excluded-file.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/excluded-file.txt?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/excluded-file.txt (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-003/src/main/resources/excluded-file.txt Sun Feb 4 09:15:08 2007
@@ -0,0 +1 @@
+This file is excluded by the custom configuration, so shouldn't end up in the end product
\ No newline at end of file
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/pom.xml?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/pom.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/pom.xml Sun Feb 4 09:15:08 2007
@@ -0,0 +1,61 @@
+<?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>source</groupId>
+ <artifactId>maven-source-plugin-test-project-004</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <excludes>
+ <exclude>excluded-file.txt</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-test-sources</id>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/java/foo/project004/App.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/java/foo/project004/App.java?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/java/foo/project004/App.java (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/java/foo/project004/App.java Sun Feb 4 09:15:08 2007
@@ -0,0 +1,32 @@
+package foo.project004;
+
+/*
+ * 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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/resources/default-configuration.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/resources/default-configuration.properties?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/resources/default-configuration.properties (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/main/resources/default-configuration.properties Sun Feb 4 09:15:08 2007
@@ -0,0 +1,16 @@
+# 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.
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/java/foo/project004/AppTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/java/foo/project004/AppTest.java?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/java/foo/project004/AppTest.java (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/java/foo/project004/AppTest.java Sun Feb 4 09:15:08 2007
@@ -0,0 +1,57 @@
+package foo.project004;
+
+/*
+ * 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 junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/.cvsignore
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/.cvsignore?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/.cvsignore (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/.cvsignore Sun Feb 4 09:15:08 2007
@@ -0,0 +1 @@
+## we don't care about this one since it's handled by default excludes (well at least it should).
\ No newline at end of file
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/excluded-file.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/excluded-file.txt?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/excluded-file.txt (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/excluded-file.txt Sun Feb 4 09:15:08 2007
@@ -0,0 +1 @@
+This file is excluded by the custom configuration, so shouldn't end up in the end product
\ No newline at end of file
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/test-default-configuration.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/test-default-configuration.properties?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/test-default-configuration.properties (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-004/src/test/resources/test-default-configuration.properties Sun Feb 4 09:15:08 2007
@@ -0,0 +1,16 @@
+# 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.
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-005/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-005/pom.xml?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-005/pom.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-005/pom.xml Sun Feb 4 09:15:08 2007
@@ -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>source</groupId>
+ <artifactId>maven-source-plugin-test-project-005</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <!-- POM packaging, no archive should be created -->
+ <packaging>pom</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-006/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-006/pom.xml?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-006/pom.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-006/pom.xml Sun Feb 4 09:15:08 2007
@@ -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>source</groupId>
+ <artifactId>maven-source-plugin-test-project-006</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <!-- POM packaging, no archive should be created -->
+ <packaging>pom</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-test-sources</id>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/pom.xml?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/pom.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/pom.xml Sun Feb 4 09:15:08 2007
@@ -0,0 +1,61 @@
+<?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>source</groupId>
+ <artifactId>maven-source-plugin-test-project-007</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>templates/**</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/java/foo/project007/App.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/java/foo/project007/App.java?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/java/foo/project007/App.java (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/java/foo/project007/App.java Sun Feb 4 09:15:08 2007
@@ -0,0 +1,32 @@
+package foo.project007;
+
+/*
+ * 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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/resources/default-configuration.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/resources/default-configuration.properties?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/resources/default-configuration.properties (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/resources/default-configuration.properties Sun Feb 4 09:15:08 2007
@@ -0,0 +1,16 @@
+# 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.
Added: maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/resources/templates/configuration-template.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/resources/templates/configuration-template.properties?view=auto&rev=503445
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/resources/templates/configuration-template.properties (added)
+++ maven/plugins/trunk/maven-source-plugin/src/test/resources/projects/project-007/src/main/resources/templates/configuration-template.properties Sun Feb 4 09:15:08 2007
@@ -0,0 +1,16 @@
+# 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.