o adding IT it0097

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@465870 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2006-10-19 20:50:50 +00:00
parent aae9c6f243
commit 1f509eacf7
13 changed files with 335 additions and 0 deletions

View File

@ -0,0 +1,15 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.it0097</groupId>
<version>1</version>
<artifactId>maven-it0097-plugin</artifactId>
<packaging>maven-plugin</packaging>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</project>

View File

@ -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 ) {}
}
}
}
}
}

View File

@ -0,0 +1,15 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.it0097</groupId>
<artifactId>maven-it0097-launcher</artifactId>
<description>Test that the implied relative path for the parent POM works, even two
levels deep.</description>
<version>1</version>
<packaging>pom</packaging>
<modules>
<module>plugin</module>
<module>project/project-level2/project-level3</module>
<module>project/relative-project-level2/relative-project-level3/</module>
</modules>
</project>

View File

@ -0,0 +1,29 @@
<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>org.apache.maven.it0097</groupId>
<version>1</version>
<artifactId>maven-it0097-project-level1</artifactId>
<packaging>pom</packaging>
<modules>
<module>project-level2</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.it0097</groupId>
<artifactId>maven-it0097-plugin</artifactId>
<version>1</version>
<executions>
<execution>
<id>it0097</id>
<phase>initialize</phase>
<goals>
<goal>it0097</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,17 @@
<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>
<parent>
<groupId>org.apache.maven.it0097</groupId>
<artifactId>maven-it0097-project-level1</artifactId>
<version>1</version>
</parent>
<artifactId>maven-it0097-project-level2</artifactId>
<packaging>pom</packaging>
<modules>
<module>project-level3</module>
<module>../project-sibling-level2</module>
</modules>
</project>

View File

@ -0,0 +1,34 @@
<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">
<parent>
<groupId>org.apache.maven.it0097</groupId>
<artifactId>maven-it0097-project-level2</artifactId>
<version>1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-it0097-project-level3</artifactId>
<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-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,13 @@
package com.stchome.mavenTest;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

View File

@ -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 );
}
}

View File

@ -0,0 +1,35 @@
<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">
<parent>
<groupId>org.apache.maven.it0097</groupId>
<artifactId>maven-it0097-project-level2</artifactId>
<version>1</version>
<relativePath>../project-level2</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-it0097-project-sibling-level2</artifactId>
<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-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,13 @@
package com.stchome.mavenTest;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

View File

@ -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 );
}
}

View File

@ -0,0 +1,16 @@
<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>
<parent>
<groupId>org.apache.maven.it0097</groupId>
<artifactId>maven-it0097-project-level1</artifactId>
<version>1</version>
</parent>
<artifactId>maven-it0097-relative-project-level2</artifactId>
<packaging>pom</packaging>
<modules>
<module>relative-project-level3</module>
</modules>
</project>

View File

@ -0,0 +1,16 @@
<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>
<parent>
<groupId>org.apache.maven.it0097</groupId>
<artifactId>maven-it0097-relative-project-level2</artifactId>
<version>1</version>
</parent>
<artifactId>maven-it0097-relative-project-level3</artifactId>
<packaging>pom</packaging>
<modules>
<module>../../project-sibling-level2</module>
</modules>
</project>