mirror of https://github.com/apache/maven.git
[MNG-2061] DistributionManagement properties don't get copied in cloned executionProject while lifecycle fork
Submitted by: jan ancajas Merged from: r573424 on maven-2.0.x branch git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@573426 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
99bd5ac68f
commit
f785811d57
|
@ -264,6 +264,16 @@ public class MavenProject
|
|||
{
|
||||
setManagedVersionMap( new ManagedVersionMap( project.getManagedVersionMap() ) );
|
||||
}
|
||||
|
||||
if ( project.releaseArtifactRepository != null )
|
||||
{
|
||||
releaseArtifactRepository = project.releaseArtifactRepository;
|
||||
}
|
||||
|
||||
if ( project.snapshotArtifactRepository != null )
|
||||
{
|
||||
snapshotArtifactRepository = project.snapshotArtifactRepository;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Find a way to use <relativePath/> here...it's tricky, because the moduleProject
|
||||
|
|
|
@ -146,4 +146,14 @@ public class MavenProjectTest
|
|||
|
||||
assertEquals( "..", pathAdjustment );
|
||||
}
|
||||
|
||||
public void testCopyConstructorWithDistributionManagement() throws Exception
|
||||
{
|
||||
|
||||
File f = getFileForClasspathResource( "distributionManagement-pom.xml" );
|
||||
MavenProject projectToClone = getProject( f );
|
||||
|
||||
MavenProject clonedProject = new MavenProject( projectToClone );
|
||||
assertNotNull( "clonedProject - distributionManagement", clonedProject.getDistributionManagementArtifactRepository() );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<!--
|
||||
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>maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<name>Maven</name>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>repo-id</id>
|
||||
<name>my snapshot repository</name>
|
||||
<url>file:///path/to/snapshot/repo</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>repo-id2</id>
|
||||
<name>my repository</name>
|
||||
<url>file:///path/to/repo</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</project>
|
Loading…
Reference in New Issue