diff --git a/maven-plugins/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java b/maven-plugins/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java index 41fc90140b..bc6c6454ad 100644 --- a/maven-plugins/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java +++ b/maven-plugins/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java @@ -78,6 +78,19 @@ public class EclipsePluginTest testProject( "project-6", null ); } + public void testProject7() + throws Exception + { + testProject( "project-7", null ); + } + + // @todo testcase for MNG-1324 "System" dependencies path non correctly added to eclipse buildpath + // public void testProject8() + // throws Exception + // { + // testProject( "project-8", null ); + // } + private void testProject( String projectName, File outputDir ) throws Exception { @@ -90,13 +103,14 @@ public class EclipsePluginTest File repo = getTestFile( "src/test/repository" ); ArtifactRepositoryLayout localRepositoryLayout = (ArtifactRepositoryLayout) lookup( - ArtifactRepositoryLayout.ROLE, "legacy" ); + ArtifactRepositoryLayout.ROLE, + "legacy" ); - ArtifactRepository localRepository = new DefaultArtifactRepository( "local", "file://" + repo.getAbsolutePath(), + ArtifactRepository localRepository = new DefaultArtifactRepository( "local", + "file://" + repo.getAbsolutePath(), localRepositoryLayout ); - MavenProject project = builder - .buildWithDependencies( new File( basedir, "project.xml" ), localRepository, null ); + MavenProject project = builder.buildWithDependencies( new File( basedir, "pom.xml" ), localRepository, null ); File projectOutputDir = basedir; @@ -150,14 +164,14 @@ public class EclipsePluginTest plugin.execute(); - assertFileEquals( localRepository.getBasedir(), new File( basedir, "project" ), - new File( projectOutputDir, ".project" ) ); + assertFileEquals( localRepository.getBasedir(), new File( basedir, "project" ), new File( projectOutputDir, + ".project" ) ); - assertFileEquals( localRepository.getBasedir(), new File( basedir, "classpath" ), - new File( projectOutputDir, ".classpath" ) ); + assertFileEquals( localRepository.getBasedir(), new File( basedir, "classpath" ), new File( projectOutputDir, + ".classpath" ) ); - assertFileEquals( localRepository.getBasedir(), new File( basedir, "wtpmodules" ), - new File( projectOutputDir, ".wtpmodules" ) ); + assertFileEquals( localRepository.getBasedir(), new File( basedir, "wtpmodules" ), new File( projectOutputDir, + ".wtpmodules" ) ); if ( new File( basedir, "settings" ).exists() ) { @@ -184,8 +198,8 @@ public class EclipsePluginTest if ( actualLines.size() <= i ) { - fail( "Too few lines in the actual file. Was " + actualLines.size() + ", expected: " + - expectedLines.size() ); + fail( "Too few lines in the actual file. Was " + actualLines.size() + ", expected: " + + expectedLines.size() ); } String actual = actualLines.get( i ).toString(); @@ -213,8 +227,7 @@ public class EclipsePluginTest while ( ( line = reader.readLine() ) != null ) { - lines.add( - line );//StringUtils.replace( line, "#ArtifactRepositoryPath#", mavenRepo.replace( '\\', '/' ) ) ); + lines.add( line );//StringUtils.replace( line, "#ArtifactRepositoryPath#", mavenRepo.replace( '\\', '/' ) ) ); } return lines; diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-1/project.xml b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-1/pom.xml similarity index 100% rename from maven-plugins/maven-eclipse-plugin/src/test/projects/project-1/project.xml rename to maven-plugins/maven-eclipse-plugin/src/test/projects/project-1/pom.xml diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-2/project.xml b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-2/pom.xml similarity index 100% rename from maven-plugins/maven-eclipse-plugin/src/test/projects/project-2/project.xml rename to maven-plugins/maven-eclipse-plugin/src/test/projects/project-2/pom.xml diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-3/project.xml b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-3/pom.xml similarity index 100% rename from maven-plugins/maven-eclipse-plugin/src/test/projects/project-3/project.xml rename to maven-plugins/maven-eclipse-plugin/src/test/projects/project-3/pom.xml diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-4/project.xml b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-4/pom.xml similarity index 100% rename from maven-plugins/maven-eclipse-plugin/src/test/projects/project-4/project.xml rename to maven-plugins/maven-eclipse-plugin/src/test/projects/project-4/pom.xml diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-4/project b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-4/project index 86dec68c03..94dc9cef05 100644 --- a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-4/project +++ b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-4/project @@ -13,9 +13,9 @@ - project.xml + pom.xml 1 - ${basedir}/src/test/projects/project-4/project.xml + ${basedir}/src/test/projects/project-4/pom.xml src-main-java diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-5/project.xml b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-5/pom.xml similarity index 100% rename from maven-plugins/maven-eclipse-plugin/src/test/projects/project-5/project.xml rename to maven-plugins/maven-eclipse-plugin/src/test/projects/project-5/pom.xml diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-6/project.xml b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-6/pom.xml similarity index 100% rename from maven-plugins/maven-eclipse-plugin/src/test/projects/project-6/project.xml rename to maven-plugins/maven-eclipse-plugin/src/test/projects/project-6/pom.xml diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-7/classpath b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-7/classpath new file mode 100644 index 0000000000..5fe230b59a --- /dev/null +++ b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-7/classpath @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-7/pom.xml b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-7/pom.xml new file mode 100644 index 0000000000..82f70dd025 --- /dev/null +++ b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-7/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + war + eclipse + maven-eclipse-plugin-test-project-7 + 99.0 + Maven + + + maven + maven-core + 98.0 + + + maven + maven-core + tests + 98.0 + + + diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-7/project b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-7/project new file mode 100644 index 0000000000..ebbbc82d31 --- /dev/null +++ b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-7/project @@ -0,0 +1,14 @@ + + maven-eclipse-plugin-test-project-7 + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.jdt.core.javanature + + \ No newline at end of file diff --git a/maven-plugins/maven-eclipse-plugin/src/test/projects/project-7/wtpmodules b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-7/wtpmodules new file mode 100644 index 0000000000..1c3526c6fa --- /dev/null +++ b/maven-plugins/maven-eclipse-plugin/src/test/projects/project-7/wtpmodules @@ -0,0 +1,15 @@ + + + + 2.4 + + + + + uses + + + uses + + + \ No newline at end of file diff --git a/maven-plugins/maven-eclipse-plugin/src/test/repository/maven/jars/maven-core-98.0-tests.jar b/maven-plugins/maven-eclipse-plugin/src/test/repository/maven/jars/maven-core-98.0-tests.jar new file mode 100644 index 0000000000..e69de29bb2