o Migrated core IT 0013 over to its corresponding plugin project

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@698148 13f79535-47bb-0310-9956-ffa450edef68
master
Benjamin Bentmann 2008-09-23 12:00:54 +00:00
parent 3abda526a2
commit 916118cb05
6 changed files with 256 additions and 0 deletions

View File

@ -263,5 +263,51 @@
</plugins>
</reporting>
</profile>
<profile>
<id>run-its</id>
<!-- TODO: Remove once maven-invoker-plugin:1.3 has been released -->
<pluginRepositories>
<pluginRepository>
<id>apache.snapshots</id>
<name>Apache Snapshot Repository</name>
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>1.3-SNAPSHOT</version>
<configuration>
<debug>true</debug>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<pomExcludes>
<!-- TODO: Investigate whether this is a core IT or a plugin IT. In the latter case, migrate it into the automated build -->
<pomExclude>plugin-report-failure-it/*</pomExclude>
</pomExcludes>
<preBuildHookScript>setup.bsh</preBuildHookScript>
<postBuildHookScript>verify.bsh</postBuildHookScript>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<settingsFile>src/it/settings.xml</settingsFile>
<goals>
<goal>verify</goal>
</goals>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,2 @@
invoker.goals.1 = install
invoker.goals.2 = org.apache.maven.its.it0013:maven-it-it0013:1.0:it0013

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.it0013</groupId>
<artifactId>maven-it-it0013</artifactId>
<version>1.0</version>
<packaging>maven-plugin</packaging>
<name>Maven Integration Test :: it0013</name>
<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>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>@project.version@</version>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,67 @@
package org.apache.maven.plugin.coreit;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.IOException;
/**
* Touches a test file.
*
* @goal it0013
*/
public class CoreIt0013Mojo
extends AbstractMojo
{
/**
* @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, "touch.txt" );
try
{
touch.createNewFile();
}
catch ( IOException e )
{
throw new MojoExecutionException( "Error writing verification file.", e );
}
}
}

View File

@ -0,0 +1,21 @@
import java.io.*;
import java.util.*;
import java.util.regex.*;
try
{
File file = new File( basedir, "target/touch.txt" );
System.out.println( "Checking for existence of generated touch file: " + file );
if ( !file.isFile() )
{
System.out.println( "FAILED!" );
return false;
}
}
catch( Throwable t )
{
t.printStackTrace();
return false;
}
return true;

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<settings>
<profiles>
<profile>
<id>it-repo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>local.central</id>
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>apache.snapshots</id>
<name>Apache Snapshot Repository</name>
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>local.central</id>
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>