[MNG-7404] Drop support for prefixless expressions

Most IT's that used e.g. ${version} are now
disabled from Maven 4.0.0-alpha-1 onward.
The others have been updated not to use
'prefixless' expressions anymore.

Closes #141.
This commit is contained in:
Maarten Mulders 2022-03-15 12:10:27 +01:00
parent cbafd073be
commit c6af9d259d
7 changed files with 74 additions and 5 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( MavenITmng7404IgnorePrefixlessExpressionsTest.class );
suite.addTestSuite( MavenITmng5222MojoDeprecatedTest.class );
suite.addTestSuite( MavenITmng7390SelectModuleOutsideCwdTest.class );
suite.addTestSuite( MavenITmng7244IgnorePomPrefixInExpressions.class );

View File

@ -54,7 +54,7 @@ public class MavenITmng2124PomInterpolationWithParentValuesTest
verifier.resetStreams();
Properties props = verifier.loadProperties( "target/parent.properties" );
assertEquals( "parent, child, parent, child", props.getProperty( "project.description" ) );
assertEquals( "parent, child", props.getProperty( "project.description" ) );
}
}

View File

@ -25,8 +25,6 @@ import java.io.File;
/**
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-2339">MNG-2339</a>.
*
*
*/
public class MavenITmng2339BadProjectInterpolationTest
extends AbstractMavenIntegrationTestCase
@ -57,6 +55,7 @@ public class MavenITmng2339BadProjectInterpolationTest
public void testitMNG2339b()
throws Exception
{
requiresMavenVersion( "(2.0.8,4.0.0-alpha-1)" );
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2339/b" );
Verifier verifier;

View File

@ -36,7 +36,7 @@ public class MavenITmng3831PomInterpolationTest
public MavenITmng3831PomInterpolationTest()
{
super( "(,2.0.2),(2.0.2,)" );
super( "(,2.0.2),(2.0.2,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 MavenITmng7404IgnorePrefixlessExpressionsTest extends AbstractMavenIntegrationTestCase
{
private static final String PROJECT_PATH = "/mng-7404-ignore-prefixless-expressions";
public MavenITmng7404IgnorePrefixlessExpressionsTest()
{
super( "[4.0.0-alpha-1,)" );
}
public void testIgnorePrefixlessExpressions() 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 ${version} is deprecated." ) )
{
fail( "Log contained unexpected deprecation warning" );
}
}
}
}

View File

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

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.mng7404</groupId>
<artifactId>prefixless-placeholders-should-be-ignored</artifactId>
<version>1.0</version>
<properties>
<projectVersion>${version}</projectVersion>
</properties>
</project>