mirror of https://github.com/apache/maven.git
o Deleted maven-it-plugin-file which has been superseded by the maven-it-plugin-log-file
git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@742735 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c89a649d74
commit
e54f41964d
|
@ -53,12 +53,13 @@ public class MavenITmng0377PluginLookupFromPrefixTest
|
|||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
List cliOptions = new ArrayList();
|
||||
cliOptions.add( "--settings settings.xml" );
|
||||
cliOptions.add( "--settings" );
|
||||
cliOptions.add( "settings.xml" );
|
||||
verifier.setCliOptions( cliOptions );
|
||||
Properties systemProperties = new Properties();
|
||||
systemProperties.put( "maven.pathname", "target/file.txt" );
|
||||
systemProperties.put( "log.logFile", "target/file.txt" );
|
||||
verifier.setSystemProperties( systemProperties );
|
||||
verifier.executeGoal( "itfile:file" );
|
||||
verifier.executeGoal( "itlog-file:reset" );
|
||||
verifier.assertFilePresent( "target/file.txt" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.apache.maven.it.Verifier;
|
|||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-469">MNG-469</a>.
|
||||
|
@ -50,10 +51,12 @@ public class MavenITmng0469ReportConfigTest
|
|||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-file:2.1-SNAPSHOT:file" );
|
||||
verifier.assertFilePresent( "target/reporting.txt" );
|
||||
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-configuration:2.1-SNAPSHOT:config" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
Properties props = verifier.loadProperties( "target/config.properties" );
|
||||
assertEquals( "not-the-default-value", props.getProperty( "defaultParam" ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,8 +70,9 @@ public class MavenITmng0469ReportConfigTest
|
|||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-file:2.1-SNAPSHOT:file" );
|
||||
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-configuration:2.1-SNAPSHOT:config" );
|
||||
verifier.assertFilePresent( "target/build.txt" );
|
||||
verifier.assertFileNotPresent( "target/reporting.txt" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public class MavenITmng0496IgnoreUnknownPluginParametersTest
|
|||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-file:2.1-SNAPSHOT:file" );
|
||||
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-log-file:2.1-SNAPSHOT:reset" );
|
||||
verifier.assertFilePresent( "target/file.txt" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
|
|
@ -57,7 +57,7 @@ public class MavenITmng3808ReportInheritenceOrderingTest
|
|||
|
||||
verifier.assertFilePresent( "target/model.properties" );
|
||||
Properties props = verifier.loadProperties( "target/model.properties" );
|
||||
assertEquals( "maven-it-plugin-file", props.getProperty( "project.reporting.plugins.0.artifactId" ) );
|
||||
assertEquals( "maven-it-plugin-log-file", props.getProperty( "project.reporting.plugins.0.artifactId" ) );
|
||||
assertEquals( "maven-it-plugin-expression", props.getProperty( "project.reporting.plugins.1.artifactId" ) );
|
||||
assertEquals( "maven-it-plugin-configuration", props.getProperty( "project.reporting.plugins.2.artifactId" ) );
|
||||
}
|
||||
|
|
|
@ -141,12 +141,6 @@ under the License.
|
|||
<version>${itPluginVersion}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-file</artifactId>
|
||||
<version>${itPluginVersion}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-fork</artifactId>
|
||||
|
|
|
@ -27,7 +27,7 @@ under the License.
|
|||
<version>1.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Maven Integration Test :: it0024</name>
|
||||
<name>Maven Integration Test :: it0024</name>
|
||||
<description>
|
||||
Test usage of <executions/> inside a plugin rather than <goals/>
|
||||
that are directly inside the plugin.
|
||||
|
@ -37,17 +37,17 @@ under the License.
|
|||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-file</artifactId>
|
||||
<artifactId>maven-it-plugin-log-file</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test</id>
|
||||
<phase>initialize</phase>
|
||||
<configuration>
|
||||
<pathname>target/plugin-exec-configuration.txt</pathname>
|
||||
<logFile>target/plugin-exec-configuration.txt</logFile>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>file</goal>
|
||||
<goal>reset</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
|
|
|
@ -27,7 +27,7 @@ under the License.
|
|||
<version>1.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-469</name>
|
||||
<name>Maven Integration Test :: MNG-469</name>
|
||||
<description>
|
||||
Test that reporting configuration applies to build plugins, too.
|
||||
</description>
|
||||
|
@ -36,11 +36,12 @@ under the License.
|
|||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-file</artifactId>
|
||||
<artifactId>maven-it-plugin-configuration</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<configuration>
|
||||
<propertiesFile>target/config.properties</propertiesFile>
|
||||
<!-- should override default value when plugin is invoked during build lifecycle -->
|
||||
<pathname>target/reporting.txt</pathname>
|
||||
<defaultParam>not-the-default-value</defaultParam>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
|
|
@ -27,7 +27,7 @@ under the License.
|
|||
<version>1.1</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-469</name>
|
||||
<name>Maven Integration Test :: MNG-469</name>
|
||||
<description>
|
||||
Test that reporting configuration does not override build configuration during build lifecycle.
|
||||
</description>
|
||||
|
@ -36,11 +36,11 @@ under the License.
|
|||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-file</artifactId>
|
||||
<artifactId>maven-it-plugin-configuration</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<configuration>
|
||||
<!-- should be dominant when plugin is invoked during build lifecycle -->
|
||||
<pathname>target/build.txt</pathname>
|
||||
<propertiesFile>target/build.txt</propertiesFile>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -50,11 +50,11 @@ under the License.
|
|||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-file</artifactId>
|
||||
<artifactId>maven-it-plugin-configuration</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<configuration>
|
||||
<!-- should not override value from <build> configuration when plugin is invoked during build lifecycle -->
|
||||
<pathname>target/reporting.txt</pathname>
|
||||
<propertiesFile>target/reporting.txt</propertiesFile>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
|
|
@ -27,7 +27,7 @@ under the License.
|
|||
<version>1.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Maven Integration Test :: it0028</name>
|
||||
<name>Maven Integration Test :: it0028</name>
|
||||
<description>
|
||||
Test that unused configuration parameters from the POM don't cause the
|
||||
mojo to fail...they will show up as warnings in the -X output instead.
|
||||
|
@ -37,9 +37,10 @@ under the License.
|
|||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-file</artifactId>
|
||||
<artifactId>maven-it-plugin-log-file</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<configuration>
|
||||
<logFile>target/file.txt</logFile>
|
||||
<unused>something</unused>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
|
|
@ -39,17 +39,17 @@ under the License.
|
|||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-file</artifactId>
|
||||
<artifactId>maven-it-plugin-log-file</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>exec1</id>
|
||||
<phase>initialize</phase>
|
||||
<goals>
|
||||
<goal>file</goal>
|
||||
<goal>reset</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<pathname>target/unexpected.txt</pathname>
|
||||
<logFile>target/unexpected.txt</logFile>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
|
|
@ -27,7 +27,7 @@ under the License.
|
|||
<version>0.1</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-3719</name>
|
||||
<name>Maven Integration Test :: MNG-3719</name>
|
||||
<description>
|
||||
Test the plugins are executeed in the order given in the POM.
|
||||
</description>
|
||||
|
@ -40,17 +40,17 @@ under the License.
|
|||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-file</artifactId>
|
||||
<artifactId>maven-it-plugin-log-file</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>step 1</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>file</goal>
|
||||
<goal>reset</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<pathname>target/model.properties</pathname>
|
||||
<logFile>target/model.properties</logFile>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
@ -77,17 +77,17 @@ under the License.
|
|||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-file</artifactId>
|
||||
<artifactId>maven-it-plugin-log-file</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>step 3</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>file</goal>
|
||||
<goal>reset</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<pathname>target/model.properties</pathname>
|
||||
<logFile>target/model.properties</logFile>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
|
|
@ -62,7 +62,7 @@ under the License.
|
|||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-file</artifactId>
|
||||
<artifactId>maven-it-plugin-log-file</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
<?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 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>
|
||||
<artifactId>maven-it-plugins</artifactId>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-it-plugin-file</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<name>Maven Integration Test Plugin :: File</name>
|
||||
<description>
|
||||
A test plugin that creates a file with some configured name in the current directory. It is similar to the Touch
|
||||
Plugin but by design less complex. The primary purpose is to check for proper configuration of the goal by Maven.
|
||||
</description>
|
||||
<inceptionYear>2008</inceptionYear>
|
||||
|
||||
<properties>
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,81 +0,0 @@
|
|||
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 org.apache.maven.plugin.MojoFailureException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Creates a text file in the current directory.
|
||||
*
|
||||
* @goal file
|
||||
* @phase generate-resources
|
||||
*
|
||||
* @author Benjamin Bentmann
|
||||
* @version $Id$
|
||||
*/
|
||||
public class FileMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* The path to the output file, relative to the current working directory.
|
||||
*
|
||||
* @parameter expression="${maven.pathname}" default-value="target/file.txt" alias="outputFile"
|
||||
*/
|
||||
private String pathname;
|
||||
|
||||
/**
|
||||
* Runs this mojo.
|
||||
*
|
||||
* @throws MojoExecutionException If the output file could not be created.
|
||||
* @throws MojoFailureException If the output file has not been set.
|
||||
*/
|
||||
public void execute()
|
||||
throws MojoExecutionException, MojoFailureException
|
||||
{
|
||||
getLog().info( "[MAVEN-CORE-IT-LOG] Using output file path: " + pathname );
|
||||
|
||||
if ( pathname == null || pathname.length() <= 0 )
|
||||
{
|
||||
throw new MojoFailureException( "Path name for output file has not been specified" );
|
||||
}
|
||||
|
||||
File outputFile = new File( pathname ).getAbsoluteFile();
|
||||
|
||||
getLog().info( "[MAVEN-CORE-IT-LOG] Creating output file: " + outputFile );
|
||||
|
||||
try
|
||||
{
|
||||
outputFile.getParentFile().mkdirs();
|
||||
outputFile.createNewFile();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Output file could not be created: " + pathname, e );
|
||||
}
|
||||
|
||||
getLog().info( "[MAVEN-CORE-IT-LOG] Created output file: " + outputFile );
|
||||
}
|
||||
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
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 org.apache.maven.plugin.MojoFailureException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Creates some text files in the current directory.
|
||||
*
|
||||
* @goal files
|
||||
* @phase generate-resources
|
||||
*
|
||||
* @author Benjamin Bentmann
|
||||
* @version $Id$
|
||||
*/
|
||||
public class FilesMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* The paths to the output files, relative to the current working directory.
|
||||
*
|
||||
* @parameter
|
||||
*/
|
||||
private String[] pathnames;
|
||||
|
||||
/**
|
||||
* Runs this mojo.
|
||||
*
|
||||
* @throws MojoExecutionException If the output file could not be created.
|
||||
* @throws MojoFailureException If the output file has not been set.
|
||||
*/
|
||||
public void execute()
|
||||
throws MojoExecutionException, MojoFailureException
|
||||
{
|
||||
if ( pathnames == null || pathnames.length <= 0 )
|
||||
{
|
||||
getLog().info( "[MAVEN-CORE-IT-LOG] Skipping - no pathnames specified" );
|
||||
return;
|
||||
}
|
||||
|
||||
for ( int i = 0; i < pathnames.length; i++ )
|
||||
{
|
||||
String pathname = pathnames[i];
|
||||
|
||||
getLog().info( "[MAVEN-CORE-IT-LOG] Using output file path: " + pathname );
|
||||
|
||||
if ( pathname == null || pathname.length() <= 0 )
|
||||
{
|
||||
throw new MojoFailureException( "Path name for output file has not been specified" );
|
||||
}
|
||||
|
||||
File outputFile = new File( pathname ).getAbsoluteFile();
|
||||
|
||||
getLog().info( "[MAVEN-CORE-IT-LOG] Creating output file: " + outputFile );
|
||||
|
||||
try
|
||||
{
|
||||
outputFile.getParentFile().mkdirs();
|
||||
outputFile.createNewFile();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Output file could not be created: " + pathname, e );
|
||||
}
|
||||
|
||||
getLog().info( "[MAVEN-CORE-IT-LOG] Created output file: " + outputFile );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -42,7 +42,6 @@ under the License.
|
|||
<module>maven-it-plugin-core-stubs</module>
|
||||
<module>maven-it-plugin-dependency-resolution</module>
|
||||
<module>maven-it-plugin-expression</module>
|
||||
<module>maven-it-plugin-file</module>
|
||||
<module>maven-it-plugin-fork</module>
|
||||
<module>maven-it-plugin-log-file</module>
|
||||
<module>maven-it-plugin-no-project</module>
|
||||
|
|
Loading…
Reference in New Issue