PR: MNG-761

fallback to deployment repository for snapshots when there is no snapshot repository


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@240175 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-08-26 07:26:03 +00:00
parent 4e6c969942
commit 294199b388
7 changed files with 59 additions and 22 deletions

View File

@ -175,6 +175,9 @@ it0061: Verify that deployment of artifacts to a legacy-layout repository
results in a groupId directory of 'the.full.group.id' instead of
'the/full/group/id'.
it0062: Test that a deployment of a snapshot falls back to a non-snapshot repository if no snapshot repository is
specified.
-------------------------------------------------------------------------------
- generated sources

View File

@ -1,3 +1,4 @@
it0062
it0061
it0060
it0059

View File

@ -0,0 +1,3 @@
target/classes/org/apache/maven/it0062/Person.class
target/maven-core-it0062-1.0-SNAPSHOT.jar
target/test-repo/org/apache/maven/maven-core-it0062/1.0-SNAPSHOT/maven-core-it0062-1.0-SNAPSHOT.version.txt

View File

@ -0,0 +1 @@
deploy

View File

@ -0,0 +1,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core-it0062</artifactId>
<version>1.0-SNAPSHOT</version>
<distributionManagement>
<repository>
<id>repo</id>
<url>file://localhost/${project.basedir}/target/test-repo</url>
</repository>
</distributionManagement>
</project>

View File

@ -0,0 +1,16 @@
package org.apache.maven.it0062;
public class Person
{
private String name;
public void setName( String name )
{
this.name = name;
}
public String getName()
{
return name;
}
}

View File

@ -181,12 +181,12 @@ public class MavenProject
this.profileProperties = new Properties( project.profileProperties );
this.model = ModelUtils.cloneModel( project.model );
if ( project.originalModel != null )
{
this.originalModel = ModelUtils.cloneModel( project.originalModel );
}
this.snapshotDeploymentVersion = project.snapshotDeploymentVersion;
this.snapshotDeploymentBuildNumber = project.snapshotDeploymentBuildNumber;
@ -825,7 +825,7 @@ public class MavenProject
public void setBuild( Build build )
{
this.buildOverlay = new BuildOverlay( build );
model.setBuild( build );
}
@ -835,10 +835,10 @@ public class MavenProject
{
buildOverlay = new BuildOverlay( model.getBuild() );
}
return buildOverlay;
}
public List getResources()
{
return getBuild().getResources();
@ -951,22 +951,22 @@ public class MavenProject
{
this.extensionArtifacts = extensionArtifacts;
}
public Set getExtensionArtifacts()
{
return this.extensionArtifacts;
}
public Map getExtensionArtifactMap()
{
if ( extensionArtifactMap == null )
{
extensionArtifactMap = ArtifactUtils.artifactMapByVersionlessId( getExtensionArtifacts() );
}
return extensionArtifactMap;
}
public void setParentArtifact( Artifact parentArtifact )
{
this.parentArtifact = parentArtifact;
@ -1062,7 +1062,8 @@ public class MavenProject
public ArtifactRepository getDistributionManagementArtifactRepository()
{
return getArtifact().isSnapshot() ? snapshotArtifactRepository : releaseArtifactRepository;
return getArtifact().isSnapshot() && snapshotArtifactRepository != null ? snapshotArtifactRepository
: releaseArtifactRepository;
}
public List getPluginRepositories()
@ -1330,27 +1331,27 @@ public class MavenProject
public void assembleProfilePropertiesInheritance()
{
Stack propertyStack = new Stack();
MavenProject current = this;
while( current != null )
while ( current != null )
{
Properties toAdd = current.profileProperties;
if ( toAdd != null && !toAdd.isEmpty() )
{
propertyStack.push( toAdd );
}
current = current.getParent();
}
Properties newProfilesProperties = new Properties();
while( !propertyStack.isEmpty() )
while ( !propertyStack.isEmpty() )
{
newProfilesProperties.putAll( (Properties) propertyStack.pop() );
}
this.profileProperties = newProfilesProperties;
}
@ -1362,7 +1363,7 @@ public class MavenProject
{
this.snapshotDeploymentVersion = deploymentVersion;
}
public String getSnapshotDeploymentVersion()
{
if ( snapshotDeploymentVersion == null )
@ -1374,15 +1375,15 @@ public class MavenProject
return snapshotDeploymentVersion;
}
}
public void setSnapshotDeploymentBuildNumber( int deploymentBuildNumber )
{
this.snapshotDeploymentBuildNumber = deploymentBuildNumber;
}
public int getSnapshotDeploymentBuildNumber()
{
return snapshotDeploymentBuildNumber;
}
}