o adding IT it0013

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@465788 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2006-10-19 20:41:44 +00:00
parent 0395ecee13
commit 430856e077
2 changed files with 103 additions and 0 deletions

View File

@ -0,0 +1,33 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-it0013-plugin</artifactId>
<description>Test plugin-plugin, which tests maven-plugin-tools-api and
maven-plugin-tools-java. This will generate a plugin descriptor from
java-based mojo sources, install the plugin, and then use it.</description>
<packaging>maven-plugin</packaging>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0-beta-1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>central</id>
<name>Test Repository</name>
<url>file:/tmp/testRepo</url>
</repository>
</distributionManagement>
</project>

View File

@ -0,0 +1,70 @@
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 it0013
*
* @description touches a test file
*
*/
public class CoreIt0013Mojo
extends AbstractMojo
{
private static final int DELETE_RETRY_SLEEP_MILLIS = 10;
/**
* @parameter expression="${project.build.directory}"
* @required
*/
private String outputDirectory;
public void execute()
throws MojoExecutionException
{
getLog().info( "outputDirectory = " + outputDirectory );
File f = new File( outputDirectory );
if ( !f.exists() )
{
f.mkdirs();
}
File touch = new File( f, "it0013-verify" );
try
{
FileWriter w = new FileWriter( touch );
w.write( "it0013-verify" );
w.close();
}
catch ( IOException e )
{
throw new MojoExecutionException( "Error writing verification file.", e );
}
}
}