Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-5359] Declared execution in PluginMgmt gets bound to lifecycle (… #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public static Test suite()
suite.addTestSuite( MavenITmng6330RelativePath.class );
suite.addTestSuite( MavenITmng6240PluginExtensionAetherProvider.class );
suite.addTestSuite( MavenITmng6223FindBasedir.class );
suite.addTestSuite( MavenITmng5359CleanPluginExecutionDeclarationInPluginMgmtTest.class );
suite.addTestSuite( MavenITmng6189SiteReportPluginsWarningTest.class );
suite.addTestSuite( MavenITmng6127PluginExecutionConfigurationInterferenceTest.class );
suite.addTestSuite( MavenITmng6057CheckReactorOrderTest.class );
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package org.apache.maven.it;

/*
* 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.it.util.ResourceExtractor;

import java.io.File;

/**
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-5359">MNG-5359</a>.
*
* @author Anders Hammar
*/
public class MavenITmng5359CleanPluginExecutionDeclarationInPluginMgmtTest
extends AbstractMavenIntegrationTestCase
{

public MavenITmng5359CleanPluginExecutionDeclarationInPluginMgmtTest()
{
// Might work with versions before 2.0.11, but not verified
super( "[2.0.11,3.0-alpha-1),[3.4.0,)" );
}

public void testit()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5359" );

Verifier verifier = newVerifier( testDir.getAbsolutePath(), "remote" );

verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteArtifacts( "org.apache.maven.its.mng5359" );

verifier.executeGoal( "install" ); // will fail if clean plugin is executed
verifier.verifyErrorFreeLog();
verifier.resetStreams();

verifier.assertArtifactPresent( "org.apache.maven.its.mng5359", "test", "0.1-SNAPSHOT", "jar" );
}
}
74 changes: 74 additions & 0 deletions core-it-suite/src/test/resources/mng-5359/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?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.mng5359</groupId>
<artifactId>test</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Maven Integration Test :: MNG-5359</name>
<description>
Verifies that an execution of maven-clean-plugin declared in pluginManagement doesn't make it bound to the build lifecycle.
</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>auto-clean</id>
<phase>package</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.apache.maven.its.mng5359;

/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}