mirror of https://github.com/apache/maven.git
[MNG-4430] [regression] Presence of distribution management status in POM of local project does not cause validation error
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@833465 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4093717ff1
commit
bd2ec16785
|
@ -323,6 +323,11 @@ public class DefaultModelValidator
|
||||||
DistributionManagement distMgmt = model.getDistributionManagement();
|
DistributionManagement distMgmt = model.getDistributionManagement();
|
||||||
if ( distMgmt != null )
|
if ( distMgmt != null )
|
||||||
{
|
{
|
||||||
|
if ( distMgmt.getStatus() != null )
|
||||||
|
{
|
||||||
|
addViolation( problems, false, "'distributionManagement.status' must not be specified" );
|
||||||
|
}
|
||||||
|
|
||||||
validateRepositoryLayout( problems, distMgmt.getRepository(), "distributionManagement.repository",
|
validateRepositoryLayout( problems, distMgmt.getRepository(), "distributionManagement.repository",
|
||||||
request );
|
request );
|
||||||
validateRepositoryLayout( problems, distMgmt.getSnapshotRepository(),
|
validateRepositoryLayout( problems, distMgmt.getSnapshotRepository(),
|
||||||
|
|
|
@ -380,4 +380,14 @@ public class DefaultModelValidatorTest
|
||||||
assertTrue( result.getErrors().get( 0 ).contains( "test:mip" ) );
|
assertTrue( result.getErrors().get( 0 ).contains( "test:mip" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testDistributionManagementStatus()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
SimpleProblemCollector result = validate( "distribution-management-status.xml" );
|
||||||
|
|
||||||
|
assertViolations( result, 1, 0 );
|
||||||
|
|
||||||
|
assertTrue( result.getErrors().get( 0 ).contains( "distributionManagement.status" ) );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
<!--
|
||||||
|
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>foo</groupId>
|
||||||
|
<artifactId>bar</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
|
||||||
|
<distributionManagement>
|
||||||
|
<status>generated</status>
|
||||||
|
</distributionManagement>
|
||||||
|
</project>
|
Loading…
Reference in New Issue