[MNG-7244] Remove deprecated WARNING for usage of pom.X placeholders

This closes #139
This commit is contained in:
Giovanni van der Schelde 2022-02-01 15:02:17 +01:00 committed by Michael Osipov
parent a49c0a4a12
commit 0776e8efa8
14 changed files with 89 additions and 17 deletions

View File

@ -106,6 +106,7 @@ public class IntegrationTestSuite
// Tests that don't run stable and need to be fixed
// -------------------------------------------------------------------------------------------------------------
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
suite.addTestSuite( MavenITmng7244IgnorePomPrefixInExpressions.class );
suite.addTestSuite( MavenITmng7349RelocationWarningTest.class );
suite.addTestSuite( MavenITmng6326CoreExtensionsNotFoundTest.class );
suite.addTestSuite( MavenITmng5561PluginRelocationLosesConfigurationTest.class );

View File

@ -25,16 +25,18 @@ import java.io.File;
import java.util.Properties;
/**
* <a href="https://issues.apache.org/jira/browse/MNG-7244">MNG-7244</a> removes the deprecation of
* <code>pom.X</code>.
* See {@link MavenITmng7244IgnorePomPrefixInExpressions}.
*
* @author Benjamin Bentmann
*
*/
public class MavenIT0140InterpolationWithPomPrefixTest
extends AbstractMavenIntegrationTestCase
{
public MavenIT0140InterpolationWithPomPrefixTest()
{
super( ALL_MAVEN_VERSIONS );
super( "[2.0,4.0.0-alpha-1)" );
}
/**

View File

@ -28,6 +28,10 @@ import java.util.Properties;
/**
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-4421">MNG-4421</a>.
*
* But <a href="https://issues.apache.org/jira/browse/MNG-7244">MNG-7244</a> removes the deprecation of
* <code>pom.X</code>.
* See {@link MavenITmng7244IgnorePomPrefixInExpressions}.
*
* @author Benjamin Bentmann
*/
public class MavenITmng4421DeprecatedPomInterpolationExpressionsTest
@ -36,7 +40,7 @@ public class MavenITmng4421DeprecatedPomInterpolationExpressionsTest
public MavenITmng4421DeprecatedPomInterpolationExpressionsTest()
{
super( "[3.0-alpha-3,)" );
super( "[3.0-alpha-3,4.0.0-alpha-1)" );
}
/**

View File

@ -0,0 +1,57 @@
/*
* 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.
*/
package org.apache.maven.it;
import org.apache.maven.it.util.ResourceExtractor;
import java.io.File;
import java.io.IOException;
import java.util.List;
public class MavenITmng7244IgnorePomPrefixInExpressions extends AbstractMavenIntegrationTestCase
{
private static final String PROJECT_PATH = "/mng-7244-ignore-pom-prefix-in-expressions";
public MavenITmng7244IgnorePomPrefixInExpressions()
{
super( "[4.0.0-alpha-1,)" );
}
public void testIgnorePomPrefixInExpressions() throws IOException, VerificationException
{
final File projectDir = ResourceExtractor.simpleExtractResources( getClass(), PROJECT_PATH );
final Verifier verifier = newVerifier( projectDir.getAbsolutePath() );
verifier.executeGoal( "validate" );
verifyLogDoesNotContainUnexpectedWarning( verifier );
}
private void verifyLogDoesNotContainUnexpectedWarning( Verifier verifier ) throws IOException
{
List<String> loadedLines = verifier.loadLines( "log.txt", "UTF-8" );
for ( String line : loadedLines )
{
if ( line.startsWith( "[WARNING]" ) && line.contains( "The expression ${pom.version} is deprecated." ) )
{
fail( "Log contained unexpected deprecation warning" );
}
}
}
}

View File

@ -32,19 +32,16 @@ under the License.
<properties>
<test>
POM content (available with 3 prefixes):
POM content (available with 2 prefixes):
project.version: ${project.version}
pom.version: ${pom.version}
version: ${version}
basedir (available with 2 prefixes):
basedir: ${basedir}
project.basedir: ${project.basedir}
pom.basedir: ${pom.basedir}
baseUri (available with 2 prefixes):
project.baseUri: ${project.baseUri}
pom.baseUri: ${pom.baseUri}
build.timestamp (only if build start time defined):
build.timestamp: ${build.timestamp}

View File

@ -32,7 +32,7 @@ under the License.
<packaging>pom</packaging>
<name>child</name>
<description>${pom.parent.artifactId}, ${pom.artifactId}, ${parent.artifactId}, ${pom.artifactId}</description>
<description>${project.parent.artifactId}, ${project.artifactId}, ${parent.artifactId}, ${project.artifactId}</description>
<build>
<plugins>

View File

@ -12,7 +12,7 @@
<version>1.0</version>
<dependencies>
<dependency>
<groupId>${pom.groupId}</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>A</artifactId>
<version>[1.0,2.0)</version>
</dependency>

View File

@ -19,7 +19,7 @@
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>${pom.groupId}</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>B</artifactId>
<version>1.0</version>
</dependency>
@ -27,7 +27,7 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${pom.groupId}</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>A</artifactId>
<version>3.0</version>
</dependency>

View File

@ -10,7 +10,7 @@
<build>
<plugins>
<plugin>
<groupId>${pom.groupId}</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>plugin</artifactId>
<version>1.0</version>
<executions>

View File

@ -24,7 +24,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${pom.version}</version>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>

View File

@ -80,8 +80,7 @@ under the License.
<!-- duplicate dependency with different version (MNG-4005), last declaration wins -->
<groupId>org.apache.maven.its.mng4403</groupId>
<artifactId>a</artifactId>
<!-- deprecated expression prefix (MNG-4421) -->
<version>${pom.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<!-- dependency managed by duplicate declarations -->

View File

@ -1 +1 @@
7715ed576590b23bd48ffe59fb765592
745853997ed31ec0b494faefcaa5616f

View File

@ -1 +1 @@
e4ca48b3c2c97cbe74dc167a57338d62f13f0ce5
c75f5314c692293d24b5b4c1bdb78d1f4c920523

View File

@ -0,0 +1,12 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng7244</groupId>
<artifactId>deprecated-pom-placeholders-should-be-ignored</artifactId>
<version>1.0</version>
<properties>
<projectVersion>${pom.version}</projectVersion>
</properties>
</project>