From b6bcbd36afc8194769c298521a2b8f96c469c41e Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Thu, 19 Oct 2006 20:44:34 +0000 Subject: [PATCH] o adding IT it0042 git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@465816 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/resources/it0042/pom.xml | 16 ++++ .../resources/it0042/test-component-a/pom.xml | 14 ++++ .../test-component-a/src/main/java/A.java | 3 + .../resources/it0042/test-component-b/pom.xml | 22 ++++++ .../test-component-b/src/main/java/B.java | 5 ++ .../resources/it0042/test-component-c/pom.xml | 42 ++++++++++ .../test-component-c/src/main/java/C.java | 5 ++ .../src/main/webapp/WEB-INF/web.xml | 5 ++ .../test/resources/it0042/test-plugin/pom.xml | 21 +++++ .../maven/plugin/coreit/CoreItMojo.java | 77 +++++++++++++++++++ 10 files changed, 210 insertions(+) create mode 100644 maven-core-integration-tests/src/test/resources/it0042/pom.xml create mode 100644 maven-core-integration-tests/src/test/resources/it0042/test-component-a/pom.xml create mode 100644 maven-core-integration-tests/src/test/resources/it0042/test-component-a/src/main/java/A.java create mode 100644 maven-core-integration-tests/src/test/resources/it0042/test-component-b/pom.xml create mode 100644 maven-core-integration-tests/src/test/resources/it0042/test-component-b/src/main/java/B.java create mode 100644 maven-core-integration-tests/src/test/resources/it0042/test-component-c/pom.xml create mode 100644 maven-core-integration-tests/src/test/resources/it0042/test-component-c/src/main/java/C.java create mode 100644 maven-core-integration-tests/src/test/resources/it0042/test-component-c/src/main/webapp/WEB-INF/web.xml create mode 100644 maven-core-integration-tests/src/test/resources/it0042/test-plugin/pom.xml create mode 100644 maven-core-integration-tests/src/test/resources/it0042/test-plugin/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java diff --git a/maven-core-integration-tests/src/test/resources/it0042/pom.xml b/maven-core-integration-tests/src/test/resources/it0042/pom.xml new file mode 100644 index 0000000000..de966ab080 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0042/pom.xml @@ -0,0 +1,16 @@ + + 4.0.0 + test + test-components + Test that the reactor can establish the artifact location of known projects for dependencies + 0.1 + Test Components + pom + + + test-component-c + test-component-b + test-component-a + test-plugin + + diff --git a/maven-core-integration-tests/src/test/resources/it0042/test-component-a/pom.xml b/maven-core-integration-tests/src/test/resources/it0042/test-component-a/pom.xml new file mode 100644 index 0000000000..2e6df5cfcb --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0042/test-component-a/pom.xml @@ -0,0 +1,14 @@ + + 4.0.0 + + test-components + test + 0.1 + + + test + test-component-a + 0.1 + Test Component A + jar + diff --git a/maven-core-integration-tests/src/test/resources/it0042/test-component-a/src/main/java/A.java b/maven-core-integration-tests/src/test/resources/it0042/test-component-a/src/main/java/A.java new file mode 100644 index 0000000000..73e270dbea --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0042/test-component-a/src/main/java/A.java @@ -0,0 +1,3 @@ +public class A { +} + diff --git a/maven-core-integration-tests/src/test/resources/it0042/test-component-b/pom.xml b/maven-core-integration-tests/src/test/resources/it0042/test-component-b/pom.xml new file mode 100644 index 0000000000..64745ad784 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0042/test-component-b/pom.xml @@ -0,0 +1,22 @@ + + 4.0.0 + + test-components + test + 0.1 + + + test + test-component-b + 0.1 + Test Component B + jar + + + + test + test-component-a + 0.1 + + + diff --git a/maven-core-integration-tests/src/test/resources/it0042/test-component-b/src/main/java/B.java b/maven-core-integration-tests/src/test/resources/it0042/test-component-b/src/main/java/B.java new file mode 100644 index 0000000000..c288d4d8b7 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0042/test-component-b/src/main/java/B.java @@ -0,0 +1,5 @@ +public class B + extends A +{ +} + diff --git a/maven-core-integration-tests/src/test/resources/it0042/test-component-c/pom.xml b/maven-core-integration-tests/src/test/resources/it0042/test-component-c/pom.xml new file mode 100644 index 0000000000..cd92b86a65 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0042/test-component-c/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + + test-components + test + 0.1 + + + test + test-component-c + 0.1 + Test Component C + war + + + + test + test-component-b + 0.1 + + + + + + + test + it0042-test-plugin + 0.1 + + my-test + + + + + test + + + + + + + diff --git a/maven-core-integration-tests/src/test/resources/it0042/test-component-c/src/main/java/C.java b/maven-core-integration-tests/src/test/resources/it0042/test-component-c/src/main/java/C.java new file mode 100644 index 0000000000..f7546a58a7 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0042/test-component-c/src/main/java/C.java @@ -0,0 +1,5 @@ +public class C + extends A +{ +} + diff --git a/maven-core-integration-tests/src/test/resources/it0042/test-component-c/src/main/webapp/WEB-INF/web.xml b/maven-core-integration-tests/src/test/resources/it0042/test-component-c/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..92bb2e9825 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0042/test-component-c/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/maven-core-integration-tests/src/test/resources/it0042/test-plugin/pom.xml b/maven-core-integration-tests/src/test/resources/it0042/test-plugin/pom.xml new file mode 100644 index 0000000000..c9791155a5 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0042/test-plugin/pom.xml @@ -0,0 +1,21 @@ + + 4.0.0 + + test-components + test + 0.1 + + + test + it0042-test-plugin + maven-plugin + 0.1 + Test Plugin + + + org.apache.maven + maven-plugin-api + 2.0-beta-1 + + + diff --git a/maven-core-integration-tests/src/test/resources/it0042/test-plugin/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java b/maven-core-integration-tests/src/test/resources/it0042/test-plugin/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java new file mode 100644 index 0000000000..ad958a7e66 --- /dev/null +++ b/maven-core-integration-tests/src/test/resources/it0042/test-plugin/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java @@ -0,0 +1,77 @@ +package org.apache.maven.plugin.coreit; + +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +/** + * @goal test + * + * @phase process-sources + * + * @description Goal which cleans the build + */ +public class CoreItMojo + extends AbstractMojo +{ + /** + * @parameter expression="${project.build.directory}" + * @required + */ + private String outputDirectory; + + /** + * @parameter + * @required + */ + private String value; + + public void execute() + throws MojoExecutionException + { + touch( new File( outputDirectory ), value ); + } + + private static void touch( File dir, String file ) + throws MojoExecutionException + { + try + { + if ( !dir.exists() ) + { + dir.mkdirs(); + } + + File touch = new File( dir, file ); + + FileWriter w = new FileWriter( touch ); + + w.write( file ); + + w.close(); + } + catch ( IOException e ) + { + throw new MojoExecutionException( "Error touching file", e ); + } + } +}