You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ba...@apache.org on 2009/05/29 05:41:16 UTC
svn commit: r779829 - in /maven/plugins/trunk/maven-eclipse-plugin/src:
main/java/org/apache/maven/plugin/eclipse/
main/java/org/apache/maven/plugin/eclipse/writers/ site/apt/
test/java/org/apache/maven/plugin/eclipse/
test/java/org/apache/maven/plugin...
Author: baerrach
Date: Fri May 29 03:41:15 2009
New Revision: 779829
URL: http://svn.apache.org/viewvc?rev=779829&view=rev
Log:
[MECLIPSE-551] regression - Resources are excluded if resource dir equals source dir
EclipseSourceDir
- includes and excludes are now lists of Strings instead of a String separated by the | character.
- added get*AsString methods which return the eclipse formatted pattern for include and exclude.
- added unit testing.
EclipsePlugin
- Moved generation of a String for the eclipse include/exclude patterns to EclipseSourceDir.
- In extractResourceDirs() the resources directories were added to the set without checking the result of the add() method.
This meant that when a resource path matched a source path the resource path was silently ignored.
Now the source directory is merged with the resource and since Eclipse doesnt have a concept of "main", "test", "resource"
any include/exclude patterns are removed.
IT project-25
This IT also uses src/main/java as a resource directory
- update classpath to include src/main/resources as the pom references this value
- added dummy file to src/main/resources so that it would be included in the .classpath
Added:
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipseSourceDirTest.java (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-25/src/main/resources/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-25/src/main/resources/dummy.txt (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.5.1.txt (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.6.txt (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.classpath (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.project (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.settings/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.settings/org.eclipse.jdt.core.prefs
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/pom.xml (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.html (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.java (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/WicketApplication.java (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/resources/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/resources/log4j.properties (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/webapp/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/webapp/WEB-INF/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/webapp/WEB-INF/web.xml (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/Start.java (with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/TestHomePage.java (with props)
Modified:
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseSourceDir.java
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java
maven/plugins/trunk/maven-eclipse-plugin/src/site/apt/index.apt
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/EclipsePluginIT.java
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-25/expected/.classpath
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java?rev=779829&r1=779828&r2=779829&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java Fri May 29 03:41:15 2009
@@ -144,9 +144,9 @@
// warning, order is important for binary search
public static final String[] WTP_SUPPORTED_VERSIONS = new String[] { "1.0", "1.5", "2.0", "R7", "none" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- private static final String ASPECTJ_FILE_PATTERN = "**/*.aj";
+ public static final String ASPECTJ_FILE_PATTERN = "**/*.aj";
- private static final String JAVA_FILE_PATTERN = "**/*.java";
+ public static final String JAVA_FILE_PATTERN = "**/*.java";
/**
* Constant for 'artifactId' element in POM.xml.
@@ -1524,9 +1524,6 @@
String output )
throws MojoExecutionException
{
- String includePattern = StringUtils.join( sourceIncludes.iterator(), "|" );
- String excludePattern = StringUtils.join( sourceExcludes.iterator(), "|" );
-
for ( Iterator it = sourceRoots.iterator(); it.hasNext(); )
{
@@ -1538,7 +1535,7 @@
IdeUtils.toRelativeAndFixSeparator( projectBaseDir, sourceRootFile,
!projectBaseDir.equals( basedir ) );
- directories.add( new EclipseSourceDir( sourceRoot, output, false, test, includePattern, excludePattern, false ) );
+ directories.add( new EclipseSourceDir( sourceRoot, output, false, test, sourceIncludes, sourceExcludes, false ) );
}
}
}
@@ -1553,13 +1550,10 @@
getLog().debug( "Processing resource dir: " + resource.getDirectory() );
- String includePattern = StringUtils.join( resource.getIncludes().iterator(), "|" );
-
List excludes = new ArrayList( resource.getExcludes() );
// automatically exclude java files: eclipse doesn't have the concept of resource directory so it will
// try to compile any java file found in maven resource dirs
excludes.add( JAVA_FILE_PATTERN );
- String excludePattern = StringUtils.join( excludes.iterator(), "|" );
// TODO: figure out how to merge if the same dir is specified twice
// with different in/exclude patterns.
@@ -1572,7 +1566,7 @@
continue;
}
- String resourceDir =
+ String resourcePath =
IdeUtils.toRelativeAndFixSeparator( workspaceProjectBaseDir, resourceDirectory,
!workspaceProjectBaseDir.equals( basedir ) );
String thisOutput = output;
@@ -1600,13 +1594,37 @@
thisOutput = IdeUtils.toRelativeAndFixSeparator( workspaceProjectBaseDir, outputFile, false );
}
- getLog().debug(
- "Adding eclipse source dir: { " + resourceDir + ", " + thisOutput + ", true, " + test
- + ", " + includePattern + ", " + excludePattern + " }." );
+ EclipseSourceDir resourceDir = new EclipseSourceDir( resourcePath, thisOutput, true, test, resource.getIncludes(), excludes,
+ resource.isFiltering() );
- directories.add( new EclipseSourceDir( resourceDir, thisOutput, true, test, includePattern, excludePattern,
- resource.isFiltering() ) );
+ if (!directories.add( resourceDir )) {
+ EclipseSourceDir originalDir = (EclipseSourceDir) get(directories, resourceDir);
+ getLog().info(
+ "Resource directory's path matches an existing source directory. Resources will be merged with the source directory "
+ + originalDir.getPath() );
+ originalDir.merge( resourceDir );
+ }
+ }
+ }
+
+ /**
+ * java.util.Set doesn't have a get() method that returns the matching object.
+ * Since we use objects that are different by conceptually "equal" based
+ * on the path we need to locate the original object out of the Set.
+ *
+ * @param set the set to iterate over looking for the specified object
+ * @param o the object to locate in the set
+ * @return the object from the set, or null if not found in the set
+ */
+ private Object get(Set set, Object o) {
+ Iterator iter = set.iterator();
+ while ( iter.hasNext() ) {
+ Object item = iter.next();
+ if (o.equals( item )) {
+ return item;
+ }
}
+ return null;
}
private void extractAspectDirs( Set directories, MavenProject project, File basedir, File projectBaseDir,
@@ -1616,9 +1634,6 @@
Xpp3Dom configuration = getAspectjConfiguration( project );
if ( configuration != null )
{
- String includePattern = StringUtils.join( sourceIncludes.iterator(), "|" );
- String excludePattern = StringUtils.join( sourceExcludes.iterator(), "|" );
-
String aspectDirectory = DEFAULT_ASPECT_DIRECTORY;
Xpp3Dom aspectDirectoryElement = configuration.getChild( ASPECT_DIRECTORY );
if ( aspectDirectoryElement != null )
@@ -1633,7 +1648,7 @@
IdeUtils.toRelativeAndFixSeparator( projectBaseDir, aspectDirectoryFile,
!projectBaseDir.equals( basedir ) );
- directories.add( new EclipseSourceDir( sourceRoot, null, false, false, includePattern, excludePattern, false ) );
+ directories.add( new EclipseSourceDir( sourceRoot, null, false, false, sourceIncludes, sourceExcludes, false ) );
}
String testAspectDirectory = DEFAULT_TEST_ASPECT_DIRECTORY;
@@ -1650,7 +1665,7 @@
IdeUtils.toRelativeAndFixSeparator( projectBaseDir, testAspectDirectoryFile,
!projectBaseDir.equals( basedir ) );
- directories.add( new EclipseSourceDir( sourceRoot, testOutput, false, true, includePattern, excludePattern, false ) );
+ directories.add( new EclipseSourceDir( sourceRoot, testOutput, false, true, sourceIncludes, sourceExcludes, false ) );
}
}
}
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseSourceDir.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseSourceDir.java?rev=779829&r1=779828&r2=779829&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseSourceDir.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseSourceDir.java Fri May 29 03:41:15 2009
@@ -18,11 +18,19 @@
*/
package org.apache.maven.plugin.eclipse;
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+
+import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.ide.IdeUtils;
+import org.codehaus.plexus.util.StringUtils;
/**
* Represent an eclipse source dir. Eclipse has no "main", "test" or "resource" concepts, so two source dirs with the
* same path are equal.
+ * <p>
+ * source directories should always have a null output value.
*
* @author <a href="mailto:fgiust@users.sourceforge.net">Fabrizio Giustina</a>
* @version $Id$
@@ -30,13 +38,24 @@
public class EclipseSourceDir
implements Comparable
{
+ private static final String PATTERN_SEPARATOR = "|";
+
private String path;
+ /**
+ * source directories should always have a null output value.
+ */
private String output;
- private String include;
+ /**
+ * List<String>
+ */
+ private List include;
- private String exclude;
+ /**
+ * List<String>
+ */
+ private List exclude;
private boolean isResource;
@@ -44,24 +63,34 @@
private boolean filtering;
- public EclipseSourceDir( String path, String output, boolean isResource, boolean test, String include,
- String exclude, boolean filtering )
+ /**
+ * @param path the eclipse source directory
+ * @param output path output directory
+ * @param isResource true if the directory only contains resources, false if a compilation directory
+ * @param test true if is a test directory, false otherwise
+ * @param include a string in the eclipse pattern format for the include filter
+ * @param exclude a string in the eclipse pattern format for the exclude filter
+ * @param filtering true if filtering should be applied, false otherwise. Note: Filtering will only be applied if
+ * this become a "special directory" by being nested within the default output directory.
+ */
+ public EclipseSourceDir( String path, String output, boolean isResource, boolean test, List include, List exclude,
+ boolean filtering )
{
setPath( path );
this.output = output;
this.isResource = isResource;
this.test = test;
- this.include = include;
- this.exclude = exclude;
+ setInclude( include );
+ setExclude( exclude );
this.filtering = filtering;
}
/**
* Getter for <code>exclude</code>.
*
- * @return Returns the exclude.
+ * @return Returns the exclude. Never null.
*/
- public String getExclude()
+ public List getExclude()
{
return this.exclude;
}
@@ -71,17 +100,21 @@
*
* @param exclude The exclude to set.
*/
- public void setExclude( String exclude )
+ public void setExclude( List exclude )
{
- this.exclude = exclude;
+ this.exclude = new ArrayList();
+ if ( exclude != null )
+ {
+ this.exclude.addAll( exclude );
+ }
}
/**
* Getter for <code>include</code>.
*
- * @return Returns the include.
- */
- public String getInclude()
+ * @return Returns the include. Never null.
+ */
+ public List getInclude()
{
return this.include;
}
@@ -91,13 +124,35 @@
*
* @param include The include to set.
*/
- public void setInclude( String include )
+ public void setInclude( List include )
+ {
+ this.include = new ArrayList();
+ if ( include != null )
+ {
+ this.include.addAll( include );
+ }
+ }
+
+ /**
+ * @return Returns the exclude as a string pattern suitable for eclipse
+ */
+ public String getExcludeAsString()
+ {
+ return StringUtils.join( exclude.iterator(), PATTERN_SEPARATOR );
+ }
+
+ /**
+ * @return Returns the include as a string pattern suitable for eclipse
+ */
+ public String getIncludeAsString()
{
- this.include = include;
+ return StringUtils.join( include.iterator(), PATTERN_SEPARATOR );
}
/**
* Getter for <code>output</code>.
+ * <p>
+ * source directories should always have a null output value.
*
* @return Returns the output.
*/
@@ -216,4 +271,67 @@
buffer.append( "filtering=" ).append( filtering );
return buffer.toString();
}
+
+ /**
+ * Merge with the provided directory.
+ * <p>
+ * If one directory is a source and the other is a resource directory then the result will be a source directory and
+ * any includes or excludes will be removed since Eclipse has no "main", "test" or "resource" concepts. The output
+ * directory will be the source directories value.
+ * <p>
+ * If the two directories are the same resources type (i.e isResource is equal) then the result will be the same
+ * resource type with the includes from each merged together (duplicates will be removed), similarly for the
+ * excludes. No effort is made to ensure that the includes and excludes are disjointed sets. Please fix your pom
+ * instead.
+ * <p>
+ * No support for cases where the test, or filtering values are not identical.
+ *
+ * @param mergeWith the directory to merge with
+ * @throws MojoExecutionException test or filtering values are not identical, or isResource true and output are not identical
+ */
+ public void merge( EclipseSourceDir mergeWith )
+ throws MojoExecutionException
+ {
+ if ( test != mergeWith.test )
+ {
+ throw new MojoExecutionException( "Request to merge when 'test' is not identical. Original=" + toString()
+ + ", merging with=" + mergeWith.toString() );
+ }
+ if ( filtering != mergeWith.filtering )
+ {
+ throw new MojoExecutionException( "Request to merge when 'filtering' is not identical. Original="
+ + toString() + ", merging with=" + mergeWith.toString() );
+ }
+
+ if ( isResource != mergeWith.isResource )
+ {
+ if ( isResource )
+ {
+ // the output directory is set to the source directory's value
+ output = mergeWith.output;
+ }
+ isResource = false;
+ setInclude( null );
+ setExclude( null );
+
+ }
+ else
+ {
+ if ( !StringUtils.equals( output, mergeWith.output ) )
+ {
+ throw new MojoExecutionException( "Request to merge when 'output' is not identical. Original="
+ + toString() + ", merging with=" + mergeWith.toString() );
+ }
+
+ LinkedHashSet includesAsSet = new LinkedHashSet();
+ includesAsSet.addAll( include );
+ includesAsSet.addAll( mergeWith.include );
+ include = new ArrayList( includesAsSet );
+
+ LinkedHashSet excludesAsSet = new LinkedHashSet();
+ excludesAsSet.addAll( exclude );
+ excludesAsSet.addAll( mergeWith.exclude );
+ exclude = new ArrayList( excludesAsSet );
+ }
+ }
}
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java?rev=779829&r1=779828&r2=779829&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java Fri May 29 03:41:15 2009
@@ -244,13 +244,13 @@
writer.addAttribute( ATTR_OUTPUT, dir.getOutput() );
}
- String includes = dir.getInclude();
+ String includes = dir.getIncludeAsString();
if ( StringUtils.isNotEmpty( includes ) )
{
writer.addAttribute( ATTR_INCLUDING, includes );
}
- String excludes = dir.getExclude();
+ String excludes = dir.getExcludeAsString();
if ( StringUtils.isNotEmpty( excludes ) )
{
writer.addAttribute( ATTR_EXCLUDING, excludes );
@@ -295,13 +295,13 @@
buildXmlPrinter.startElement( "fileset" );
buildXmlPrinter.addAttribute( "dir", dir.getPath() );
- if ( dir.getInclude() != null )
+ if ( dir.getIncludeAsString() != null )
{
- buildXmlPrinter.addAttribute( "includes", dir.getInclude() );
+ buildXmlPrinter.addAttribute( "includes", dir.getIncludeAsString() );
}
- if ( dir.getExclude() != null )
+ if ( dir.getExcludeAsString() != null )
{
- buildXmlPrinter.addAttribute( "excludes", dir.getExclude() );
+ buildXmlPrinter.addAttribute( "excludes", dir.getExcludeAsString() );
}
buildXmlPrinter.endElement();
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/site/apt/index.apt?rev=779829&r1=779828&r2=779829&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/site/apt/index.apt (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/site/apt/index.apt Fri May 29 03:41:15 2009
@@ -11,6 +11,9 @@
The Eclipse Plugin is used to generate Eclipse IDE files (*.classpath,
*.wtpmodules and the .settings folder) for use with a project.
+
+ Note: Starting at version 2.6 the generated .classpath now includes "**/*.java" for source directories
+ and excludes "**/*.java" for resource directories. See {{{http://jira.codehaus.org/browse/MECLIPSE-443}MECLIPSE-443}}.
* Goals Overview
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipseSourceDirTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipseSourceDirTest.java?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipseSourceDirTest.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipseSourceDirTest.java Fri May 29 03:41:15 2009
@@ -0,0 +1,107 @@
+/*
+ * 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.
+ */
+package org.apache.maven.plugin.eclipse;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+/**
+ * Test class for EclipseSourceDir
+ *
+ * @author <a href="mailto:baerrach@apache.org">Barrie Treloar</a>
+ * @version $Id$
+ */
+public class EclipseSourceDirTest
+ extends TestCase
+{
+ private EclipseSourceDir testFixture_src_main_java() {
+ List includes = new ArrayList();
+ includes.add( EclipsePlugin.JAVA_FILE_PATTERN );
+ return new EclipseSourceDir( "/src/main/java", null, false, false, includes, null, false );
+ }
+
+ private EclipseSourceDir testFixture_src_main_resources() {
+ List excludes = new ArrayList();
+ excludes.add( EclipsePlugin.JAVA_FILE_PATTERN );
+ return new EclipseSourceDir( "/src/main/resources", "target/classes", true, false, null, excludes, false );
+ }
+
+ private EclipseSourceDir testFixture_src_test_java() {
+ List includes = new ArrayList();
+ includes.add( EclipsePlugin.JAVA_FILE_PATTERN );
+ return new EclipseSourceDir( "/src/test/java", "target/test-classes", false, true, includes, null, false );
+ }
+
+ private EclipseSourceDir testFixture_src_test_resources() {
+ List excludes = new ArrayList();
+ excludes.add( EclipsePlugin.JAVA_FILE_PATTERN );
+ return new EclipseSourceDir( "/src/test/resources", "target/test-classes", true, true, null, excludes, false );
+ }
+
+ /**
+ * A merge with a source directory and a resource directory results in:
+ * <ul>
+ * <li>source directory
+ * <li>includes is empty
+ * <li>excludes is empty
+ * </ul>
+ * @throws Exception
+ */
+ public void testMerge_src_main_java_with_src_main_resources() throws Exception
+ {
+ EclipseSourceDir src_main_java = testFixture_src_main_java();
+ EclipseSourceDir src_main_resources = testFixture_src_main_resources();
+
+ src_main_java.merge( src_main_resources );
+ assertEquals( "source /src/main/java: output=null, include=[], exclude=[], test=false, filtering=false", src_main_java.toString());
+
+ }
+
+ public void testToString_src_main_java()
+ {
+ EclipseSourceDir objectUnderTest = testFixture_src_main_java();
+
+ assertEquals( "source /src/main/java: output=null, include=[**/*.java], exclude=[], test=false, filtering=false", objectUnderTest.toString());
+ }
+
+ public void testToString_src_main_resources()
+ {
+ EclipseSourceDir objectUnderTest = testFixture_src_main_resources();
+
+ assertEquals( "resource /src/main/resources: output=target/classes, include=[], exclude=[**/*.java], test=false, filtering=false", objectUnderTest.toString());
+ }
+
+ public void testToString_src_test_java()
+ {
+ EclipseSourceDir objectUnderTest = testFixture_src_test_java();
+
+ assertEquals( "source /src/test/java: output=target/test-classes, include=[**/*.java], exclude=[], test=true, filtering=false", objectUnderTest.toString());
+ }
+
+ public void testToString_src_test_resources()
+ {
+ EclipseSourceDir objectUnderTest = testFixture_src_test_resources();
+
+ assertEquals( "resource /src/test/resources: output=target/test-classes, include=[], exclude=[**/*.java], test=true, filtering=false", objectUnderTest.toString());
+ }
+
+
+}
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipseSourceDirTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipseSourceDirTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/EclipsePluginIT.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/EclipsePluginIT.java?rev=779829&r1=779828&r2=779829&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/EclipsePluginIT.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/EclipsePluginIT.java Fri May 29 03:41:15 2009
@@ -640,6 +640,17 @@
{
testProject( "project-52-MECLIPSE-104" );
}
+
+ /**
+ * [MECLIPSE-551] Source directory and resource directory are the same
+ *
+ * @throws Exception
+ */
+ public void testProject53MECLIPS551()
+ throws Exception
+ {
+ testProject( "project-53-MECLIPSE-551" );
+ }
public void testJeeSimple()
throws Exception
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-25/expected/.classpath
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-25/expected/.classpath?rev=779829&r1=779828&r2=779829&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-25/expected/.classpath (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-25/expected/.classpath Fri May 29 03:41:15 2009
@@ -1,5 +1,6 @@
<classpath>
- <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources" excluding="*.txt|**/*.java"/>
<classpathentry kind="src" path="." including="plugin.*|*.bmp|icons/*.*" excluding="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-25/src/main/resources/dummy.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-25/src/main/resources/dummy.txt?rev=779829&view=auto
==============================================================================
(empty)
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-25/src/main/resources/dummy.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-25/src/main/resources/dummy.txt
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.5.1.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.5.1.txt?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.5.1.txt (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.5.1.txt Fri May 29 03:41:15 2009
@@ -0,0 +1,22 @@
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty/6.1.4/jetty-6.1.4.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty/6.1.4/jetty-6.1.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-management/6.1.4/jetty-management-6.1.4.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty-management/6.1.4/jetty-management-6.1.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-util/6.1.4/jetty-util-6.1.4.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty-util/6.1.4/jetty-util-6.1.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.2/junit-3.8.2.jar" sourcepath="M2_REPO/junit/junit/3.8.2/junit-3.8.2-sources.jar">
+ <attributes>
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/PD79199/.m2/repository/junit/junit/3.8.2/junit-3.8.2-javadoc.jar!/" name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/mx4j/mx4j/3.0.1/mx4j-3.0.1.jar" sourcepath="M2_REPO/mx4j/mx4j/3.0.1/mx4j-3.0.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/mx4j/mx4j-tools/3.0.1/mx4j-tools-3.0.1.jar" sourcepath="M2_REPO/mx4j/mx4j-tools/3.0.1/mx4j-tools-3.0.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/servlet-api-2.5/6.1.4/servlet-api-2.5-6.1.4.jar" sourcepath="M2_REPO/org/mortbay/jetty/servlet-api-2.5/6.1.4/servlet-api-2.5-6.1.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.4.2/slf4j-log4j12-1.4.2.jar" sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.4.2/slf4j-log4j12-1.4.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/wicket/wicket/1.4-rc4/wicket-1.4-rc4.jar" sourcepath="M2_REPO/org/apache/wicket/wicket/1.4-rc4/wicket-1.4-rc4-sources.jar"/>
+</classpath>
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.5.1.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.5.1.txt
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.6.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.6.txt?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.6.txt (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.6.txt Fri May 29 03:41:15 2009
@@ -0,0 +1,22 @@
+<classpath>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
+ <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty/6.1.4/jetty-6.1.4.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty/6.1.4/jetty-6.1.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-management/6.1.4/jetty-management-6.1.4.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty-management/6.1.4/jetty-management-6.1.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-util/6.1.4/jetty-util-6.1.4.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty-util/6.1.4/jetty-util-6.1.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.2/junit-3.8.2.jar" sourcepath="M2_REPO/junit/junit/3.8.2/junit-3.8.2-sources.jar">
+ <attributes>
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/PD79199/.m2/repository/junit/junit/3.8.2/junit-3.8.2-javadoc.jar!/" name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/mx4j/mx4j/3.0.1/mx4j-3.0.1.jar" sourcepath="M2_REPO/mx4j/mx4j/3.0.1/mx4j-3.0.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/mx4j/mx4j-tools/3.0.1/mx4j-tools-3.0.1.jar" sourcepath="M2_REPO/mx4j/mx4j-tools/3.0.1/mx4j-tools-3.0.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/servlet-api-2.5/6.1.4/servlet-api-2.5-6.1.4.jar" sourcepath="M2_REPO/org/mortbay/jetty/servlet-api-2.5/6.1.4/servlet-api-2.5-6.1.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.4.2/slf4j-log4j12-1.4.2.jar" sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.4.2/slf4j-log4j12-1.4.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/wicket/wicket/1.4-rc4/wicket-1.4-rc4.jar" sourcepath="M2_REPO/org/apache/wicket/wicket/1.4-rc4/wicket-1.4-rc4-sources.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.6.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/.classpath.2.6.txt
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.classpath
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.classpath?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.classpath (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.classpath Fri May 29 03:41:15 2009
@@ -0,0 +1,18 @@
+<classpath>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty/6.1.4/jetty-6.1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-management/6.1.4/jetty-management-6.1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-util/6.1.4/jetty-util-6.1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.2/junit-3.8.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar"/>
+ <classpathentry kind="var" path="M2_REPO/mx4j/mx4j/3.0.1/mx4j-3.0.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/mx4j/mx4j-tools/3.0.1/mx4j-tools-3.0.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/servlet-api-2.5/6.1.4/servlet-api-2.5-6.1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.4.2/slf4j-log4j12-1.4.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/wicket/wicket/1.4-rc4/wicket-1.4-rc4.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.classpath
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.classpath
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.project
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.project?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.project (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.project Fri May 29 03:41:15 2009
@@ -0,0 +1,13 @@
+<projectDescription>
+ <name>maven-eclipse-plugin-test-project-53</name>
+ <comment>Test MECLIPSE-551</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.project
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.project
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.settings/org.eclipse.jdt.core.prefs?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.settings/org.eclipse.jdt.core.prefs (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/expected/.settings/org.eclipse.jdt.core.prefs Fri May 29 03:41:15 2009
@@ -0,0 +1,5 @@
+#Wed May 27 18:17:31 CST 2009
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/pom.xml?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/pom.xml (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/pom.xml Fri May 29 03:41:15 2009
@@ -0,0 +1,135 @@
+<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>eclipse</groupId>
+ <artifactId>maven-eclipse-plugin-test-project-53</artifactId>
+ <packaging>war</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <!-- TODO project name -->
+ <name>Test MECLIPSE-551</name>
+ <description>Test MECLIPSE-551</description>
+ <!--
+ TODO <organization> <name>company name</name> <url>company url</url>
+ </organization>
+ -->
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+ <dependencies>
+ <!-- WICKET DEPENDENCIES -->
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket</artifactId>
+ <version>${wicket.version}</version>
+ </dependency>
+ <!--
+ OPTIONAL <dependency> <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-extensions</artifactId>
+ <version>${wicket.version}</version> </dependency>
+ -->
+
+ <!-- LOGGING DEPENDENCIES - LOG4J -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.4.2</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+
+ <!-- JUNIT DEPENDENCY FOR TESTING -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- JETTY DEPENDENCIES FOR TESTING -->
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-management</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <resources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <optimize>true</optimize>
+ <debug>true</debug>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.4rc0</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>test</version>
+ <configuration>
+ <workspace>${basedir}/../../eclipse/workspaceDoesNotExist</workspace>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <wicket.version>1.4-rc4</wicket.version>
+ <jetty.version>6.1.4</jetty.version>
+ </properties>
+ </project>
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.html
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.html?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.html (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.html Fri May 29 03:41:15 2009
@@ -0,0 +1,11 @@
+<html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" >
+ <head>
+ <title>Wicket Quickstart Archetype Homepage</title>
+ </head>
+ <body>
+ <strong>Wicket Quickstart Archetype Homepage</strong>
+ <br/><br/>
+ <span wicket:id="message">message will be here</span>
+ </body>
+</html>
+
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.html
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.java?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.java Fri May 29 03:41:15 2009
@@ -0,0 +1,29 @@
+package com.mycompany;
+
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.WebPage;
+
+/**
+ * Homepage
+ */
+public class HomePage extends WebPage {
+
+ private static final long serialVersionUID = 1L;
+
+ // TODO Add any page properties or variables here
+
+ /**
+ * Constructor that is invoked when page is invoked without a session.
+ *
+ * @param parameters
+ * Page parameters
+ */
+ public HomePage(final PageParameters parameters) {
+
+ // Add the simplest type of label
+ add(new Label("message", "If you see this message wicket is properly configured and running"));
+
+ // TODO Add your page's components here
+ }
+}
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/HomePage.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/WicketApplication.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/WicketApplication.java?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/WicketApplication.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/WicketApplication.java Fri May 29 03:41:15 2009
@@ -0,0 +1,27 @@
+package com.mycompany;
+
+import org.apache.wicket.protocol.http.WebApplication;
+
+/**
+ * Application object for your web application. If you want to run this application without deploying, run the Start class.
+ *
+ * @see com.mycompany.Start#main(String[])
+ */
+public class WicketApplication extends WebApplication
+{
+ /**
+ * Constructor
+ */
+ public WicketApplication()
+ {
+ }
+
+ /**
+ * @see org.apache.wicket.Application#getHomePage()
+ */
+ public Class<HomePage> getHomePage()
+ {
+ return HomePage.class;
+ }
+
+}
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/WicketApplication.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/java/com/mycompany/WicketApplication.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/resources/log4j.properties?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/resources/log4j.properties (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/resources/log4j.properties Fri May 29 03:41:15 2009
@@ -0,0 +1,12 @@
+log4j.appender.Stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.Stdout.layout.conversionPattern=%-5p - %-26.26c{1} - %m\n
+
+log4j.rootLogger=INFO,Stdout
+
+log4j.logger.org.apache.wicket=INFO
+log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO
+log4j.logger.org.apache.wicket.version=INFO
+log4j.logger.org.apache.wicket.RequestCycle=INFO
+
+
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/resources/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/resources/log4j.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/webapp/WEB-INF/web.xml?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/webapp/WEB-INF/web.xml (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/webapp/WEB-INF/web.xml Fri May 29 03:41:15 2009
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <display-name>myproject</display-name>
+
+ <!--
+ There are three means to configure Wickets configuration mode and they are
+ tested in the order given.
+ 1) A system property: -Dwicket.configuration
+ 2) servlet specific <init-param>
+ 3) context specific <context-param>
+ The value might be either "development" (reloading when templates change)
+ or "deployment". If no configuration is found, "development" is the default.
+ -->
+
+ <filter>
+ <filter-name>wicket.myproject</filter-name>
+ <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ <init-param>
+ <param-name>applicationClassName</param-name>
+ <param-value>com.mycompany.WicketApplication</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>wicket.myproject</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+
+</web-app>
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/Start.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/Start.java?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/Start.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/Start.java Fri May 29 03:41:15 2009
@@ -0,0 +1,48 @@
+package com.mycompany;
+
+import org.mortbay.jetty.Connector;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.bio.SocketConnector;
+import org.mortbay.jetty.webapp.WebAppContext;
+
+public class Start {
+
+ public static void main(String[] args) throws Exception {
+ Server server = new Server();
+ SocketConnector connector = new SocketConnector();
+
+ // Set some timeout options to make debugging easier.
+ connector.setMaxIdleTime(1000 * 60 * 60);
+ connector.setSoLingerTime(-1);
+ connector.setPort(8080);
+ server.setConnectors(new Connector[] { connector });
+
+ WebAppContext bb = new WebAppContext();
+ bb.setServer(server);
+ bb.setContextPath("/");
+ bb.setWar("src/main/webapp");
+
+ // START JMX SERVER
+ // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
+ // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer);
+ // server.getContainer().addEventListener(mBeanContainer);
+ // mBeanContainer.start();
+
+ server.addHandler(bb);
+
+ try {
+ System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP");
+ server.start();
+ System.in.read();
+ System.out.println(">>> STOPPING EMBEDDED JETTY SERVER");
+ // while (System.in.available() == 0) {
+ // Thread.sleep(5000);
+ // }
+ server.stop();
+ server.join();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(100);
+ }
+ }
+}
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/Start.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/Start.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/TestHomePage.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/TestHomePage.java?rev=779829&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/TestHomePage.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/TestHomePage.java Fri May 29 03:41:15 2009
@@ -0,0 +1,30 @@
+package com.mycompany;
+
+import junit.framework.TestCase;
+import org.apache.wicket.util.tester.WicketTester;
+
+/**
+ * Simple test using the WicketTester
+ */
+public class TestHomePage extends TestCase
+{
+ private WicketTester tester;
+
+ @Override
+ public void setUp()
+ {
+ tester = new WicketTester(new WicketApplication());
+ }
+
+ public void testRenderMyPage()
+ {
+ //start and render the test page
+ tester.startPage(HomePage.class);
+
+ //assert rendered page class
+ tester.assertRenderedPage(HomePage.class);
+
+ //assert rendered label component
+ tester.assertLabel("message", "If you see this message wicket is properly configured and running");
+ }
+}
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/TestHomePage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-53-MECLIPSE-551/src/test/java/com/mycompany/TestHomePage.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision