diff --git a/maven-core-integration-tests/src/test/resources/it0097/plugin/pom.xml b/maven-core-integration-tests/src/test/resources/it0097/plugin/pom.xml new file mode 100644 index 0000000000..53e6651183 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/plugin/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + org.apache.maven.it0097 + 1 + maven-it0097-plugin + maven-plugin + + + + org.apache.maven + maven-plugin-api + 2.0 + + + diff --git a/maven-core-integration-tests/src/test/resources/it0097/plugin/src/main/java/org/apache/maven/it0096/It0096Mojo.java b/maven-core-integration-tests/src/test/resources/it0097/plugin/src/main/java/org/apache/maven/it0096/It0096Mojo.java new file mode 100644 index 0000000000..b3b879edcc --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/plugin/src/main/java/org/apache/maven/it0096/It0096Mojo.java @@ -0,0 +1,56 @@ +package org.apache.maven.it0096; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; + +/** + * @goal it0097 + */ +public class It0096Mojo extends AbstractMojo +{ + + /** + * @parameter default-value="${project.build.directory}" + * @required + * @readonly + */ + private File targetDirectory; + + public void execute() throws MojoExecutionException + { + targetDirectory.mkdirs(); + + File myFile = new File( targetDirectory, "it0097.txt" ); + + if ( myFile.exists() ) + { + throw new MojoExecutionException( "This mojo has already been run, or the project wasn't cleaned." ); + } + else + { + FileWriter writer = null; + try + { + writer = new FileWriter( myFile ); + writer.write( "test" ); + writer.close(); + } + catch ( IOException e ) + { + throw new MojoExecutionException( "Failed to write test file: " + myFile ); + } + finally + { + if ( writer != null ) + { + try{ writer.close(); } + catch( IOException e ) {} + } + } + } + } +} diff --git a/maven-core-integration-tests/src/test/resources/it0097/pom.xml b/maven-core-integration-tests/src/test/resources/it0097/pom.xml new file mode 100644 index 0000000000..82241c4295 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + org.apache.maven.it0097 + maven-it0097-launcher + Test that the implied relative path for the parent POM works, even two + levels deep. + 1 + pom + + + plugin + project/project-level2/project-level3 + project/relative-project-level2/relative-project-level3/ + + diff --git a/maven-core-integration-tests/src/test/resources/it0097/project/pom.xml b/maven-core-integration-tests/src/test/resources/it0097/project/pom.xml new file mode 100644 index 0000000000..399fb9a7c0 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/project/pom.xml @@ -0,0 +1,29 @@ + + 4.0.0 + org.apache.maven.it0097 + 1 + maven-it0097-project-level1 + pom + + project-level2 + + + + + org.apache.maven.it0097 + maven-it0097-plugin + 1 + + + it0097 + initialize + + it0097 + + + + + + + diff --git a/maven-core-integration-tests/src/test/resources/it0097/project/project-level2/pom.xml b/maven-core-integration-tests/src/test/resources/it0097/project/project-level2/pom.xml new file mode 100644 index 0000000000..d795bb7151 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/project/project-level2/pom.xml @@ -0,0 +1,17 @@ + + 4.0.0 + + org.apache.maven.it0097 + maven-it0097-project-level1 + 1 + + + maven-it0097-project-level2 + + pom + + project-level3 + ../project-sibling-level2 + + diff --git a/maven-core-integration-tests/src/test/resources/it0097/project/project-level2/project-level3/pom.xml b/maven-core-integration-tests/src/test/resources/it0097/project/project-level2/project-level3/pom.xml new file mode 100644 index 0000000000..117b883ae2 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/project/project-level2/project-level3/pom.xml @@ -0,0 +1,34 @@ + + + org.apache.maven.it0097 + maven-it0097-project-level2 + 1 + + 4.0.0 + maven-it0097-project-level3 + + + junit + junit + 3.8.1 + test + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + + diff --git a/maven-core-integration-tests/src/test/resources/it0097/project/project-level2/project-level3/src/main/java/com/stchome/mavenTest/App.java b/maven-core-integration-tests/src/test/resources/it0097/project/project-level2/project-level3/src/main/java/com/stchome/mavenTest/App.java new file mode 100644 index 0000000000..0e6d8e31a4 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/project/project-level2/project-level3/src/main/java/com/stchome/mavenTest/App.java @@ -0,0 +1,13 @@ +package com.stchome.mavenTest; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/maven-core-integration-tests/src/test/resources/it0097/project/project-level2/project-level3/src/test/java/com/stchome/mavenTest/AppTest.java b/maven-core-integration-tests/src/test/resources/it0097/project/project-level2/project-level3/src/test/java/com/stchome/mavenTest/AppTest.java new file mode 100644 index 0000000000..efb5aaa5b5 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/project/project-level2/project-level3/src/test/java/com/stchome/mavenTest/AppTest.java @@ -0,0 +1,38 @@ +package com.stchome.mavenTest; + +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 ); + } +} diff --git a/maven-core-integration-tests/src/test/resources/it0097/project/project-sibling-level2/pom.xml b/maven-core-integration-tests/src/test/resources/it0097/project/project-sibling-level2/pom.xml new file mode 100644 index 0000000000..05f13ee5dd --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/project/project-sibling-level2/pom.xml @@ -0,0 +1,35 @@ + + + org.apache.maven.it0097 + maven-it0097-project-level2 + 1 + ../project-level2 + + 4.0.0 + maven-it0097-project-sibling-level2 + + + junit + junit + 3.8.1 + test + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + + diff --git a/maven-core-integration-tests/src/test/resources/it0097/project/project-sibling-level2/src/main/java/com/stchome/mavenTest/App.java b/maven-core-integration-tests/src/test/resources/it0097/project/project-sibling-level2/src/main/java/com/stchome/mavenTest/App.java new file mode 100644 index 0000000000..0e6d8e31a4 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/project/project-sibling-level2/src/main/java/com/stchome/mavenTest/App.java @@ -0,0 +1,13 @@ +package com.stchome.mavenTest; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/maven-core-integration-tests/src/test/resources/it0097/project/project-sibling-level2/src/test/java/com/stchome/mavenTest/AppTest.java b/maven-core-integration-tests/src/test/resources/it0097/project/project-sibling-level2/src/test/java/com/stchome/mavenTest/AppTest.java new file mode 100644 index 0000000000..efb5aaa5b5 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/project/project-sibling-level2/src/test/java/com/stchome/mavenTest/AppTest.java @@ -0,0 +1,38 @@ +package com.stchome.mavenTest; + +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 ); + } +} diff --git a/maven-core-integration-tests/src/test/resources/it0097/project/relative-project-level2/pom.xml b/maven-core-integration-tests/src/test/resources/it0097/project/relative-project-level2/pom.xml new file mode 100644 index 0000000000..6047ddf32d --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/project/relative-project-level2/pom.xml @@ -0,0 +1,16 @@ + + 4.0.0 + + org.apache.maven.it0097 + maven-it0097-project-level1 + 1 + + + maven-it0097-relative-project-level2 + + pom + + relative-project-level3 + + diff --git a/maven-core-integration-tests/src/test/resources/it0097/project/relative-project-level2/relative-project-level3/pom.xml b/maven-core-integration-tests/src/test/resources/it0097/project/relative-project-level2/relative-project-level3/pom.xml new file mode 100644 index 0000000000..d89e87df55 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0097/project/relative-project-level2/relative-project-level3/pom.xml @@ -0,0 +1,16 @@ + + 4.0.0 + + org.apache.maven.it0097 + maven-it0097-relative-project-level2 + 1 + + + maven-it0097-relative-project-level3 + + pom + + ../../project-sibling-level2 + +