[MNG-6330] Parents relativePath not verified anymore

This commit is contained in:
rfscholte 2017-12-29 10:42:01 +01:00
parent 3027889a08
commit 1e09c00cd8
6 changed files with 150 additions and 1 deletions

View File

@ -88,7 +88,7 @@ under the License.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<version>4.12</version>
<!-- NOTE: Use compile scope for transitivity. -->
</dependency>
<dependency>

View File

@ -106,6 +106,7 @@ public class IntegrationTestSuite
// -------------------------------------------------------------------------------------------------------------
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
suite.addTestSuite( MavenITmng6330RelativePath.class );
suite.addTestSuite( MavenITmng6240PluginExtensionAetherProvider.class );
suite.addTestSuite( MavenITmng6223FindBasedir.class );
suite.addTestSuite( MavenITmng6189SiteReportPluginsWarningTest.class );

View File

@ -0,0 +1,59 @@
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 static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.containsString;
import java.io.File;
import org.apache.maven.it.util.ResourceExtractor;
/**
* MNG-6030 reintroduced ReactorModelCache, but this ignores invalid relativePaths of parents
*
* @author Robert Scholte
*/
public class MavenITmng6330RelativePath
extends AbstractMavenIntegrationTestCase
{
public MavenITmng6330RelativePath()
{
super( "(,3.5.0),(3.5.2,)" );
}
public void testRelativePath() throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6330-relative-path" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
verifier.setForkJvm( true );
try
{
verifier.executeGoal( "validate");
fail( "Should fail due to non-resolvable parent" );
}
catch ( VerificationException e )
{
assertThat( e.getMessage(), containsString("Non-resolvable parent POM") );
}
}
}

View File

@ -0,0 +1,31 @@
<!--
~ 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.mng6330</groupId>
<artifactId>project</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>subproject1</module> <!-- caches parent -->
<module>sub/subproject2</module>
</modules>
</project>

View File

@ -0,0 +1,28 @@
<!--
~ 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>
<parent>
<groupId>org.apache.maven.its.mng6330</groupId>
<artifactId>project</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>subproject2</artifactId>
</project>

View File

@ -0,0 +1,30 @@
<!--
~ 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>
<parent>
<groupId>org.apache.maven.its.mng6330</groupId>
<artifactId>project</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>subproject1</artifactId>
<version>2.0-SNAPSHOT</version>
</project>