rolling back accidental commit.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@384106 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2006-03-08 03:26:16 +00:00
parent fcb42e22ba
commit 063474e205
11 changed files with 8 additions and 188 deletions

View File

@ -2,7 +2,7 @@
<files>
<file>
<location>target/effective-pom.xml</location>
<contains>scp://host/path/parent/sub1</contains>
<contains>scp://host/path/sub1</contains>
</file>
<file>
<location>target/effective-pom.xml</location>

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.it</groupId>
<artifactId>maven-core-it1020</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>maven-core-it1020-child</artifactId>
<dependencies>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,9 +0,0 @@
package org.apache.maven.it1019;
import org.jaxen.Context;
public class TestClass
{
private Context context;
}

View File

@ -1 +0,0 @@
compile

View File

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.it</groupId>
<artifactId>maven-core-it1020</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>child</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1-beta-2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<exclusions>
<exclusion>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.0.5</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@ -1 +0,0 @@
compile

View File

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.it</groupId>
<artifactId>maven-core-it1019</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1-beta-2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<exclusions>
<exclusion>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.0.5</version>
</dependency>
</dependencies>
</project>

View File

@ -1,9 +0,0 @@
package org.apache.maven.it1019;
import org.jaxen.Context;
public class TestClass
{
private Context context;
}

View File

@ -336,8 +336,6 @@ public static Set createArtifacts( ArtifactFactory artifactFactory, List depende
artifact.setFile( new File( d.getSystemPath() ) );
}
ArtifactFilter artifactFilter = dependencyFilter;
if ( artifact != null && ( dependencyFilter == null || dependencyFilter.include( artifact ) ) )
{
if ( d.getExclusions() != null && !d.getExclusions().isEmpty() )
@ -356,15 +354,15 @@ public static Set createArtifacts( ArtifactFactory artifactFactory, List depende
AndArtifactFilter filter = new AndArtifactFilter();
filter.add( dependencyFilter );
filter.add( newFilter );
artifactFilter = filter;
dependencyFilter = filter;
}
else
{
artifactFilter = newFilter;
dependencyFilter = newFilter;
}
}
artifact.setDependencyFilter( artifactFilter );
artifact.setDependencyFilter( dependencyFilter );
if ( project != null )
{

View File

@ -108,7 +108,7 @@ private void assembleModelInheritance( Model child, Model parent, String childPa
}
}
assembleDistributionInheritence( child, parent, appendPaths );
assembleDistributionInheritence( child, parent, childPathAdjustment, appendPaths );
// issueManagement
if ( child.getIssueManagement() == null )
@ -399,7 +399,8 @@ private void assembleScmInheritance( Model child, Model parent, String childPath
}
}
private void assembleDistributionInheritence( Model child, Model parent, boolean appendPaths )
private void assembleDistributionInheritence( Model child, Model parent, String childPathAdjustment,
boolean appendPaths )
{
if ( parent.getDistributionManagement() != null )
{
@ -431,7 +432,7 @@ private void assembleDistributionInheritence( Model child, Model parent, boolean
if ( site.getUrl() != null )
{
site.setUrl(
appendPath( site.getUrl(), child.getArtifactId(), null, appendPaths ) );
appendPath( site.getUrl(), child.getArtifactId(), childPathAdjustment, appendPaths ) );
}
}
}

View File

@ -10,7 +10,6 @@
import org.apache.maven.project.injection.ModelDefaultsInjector;
import org.codehaus.plexus.PlexusTestCase;
import java.util.Arrays;
import java.util.Map;
public class MavenMetadataSourceTest
@ -108,55 +107,4 @@ public void testShouldUseInjectedTestScopeFromDependencyManagement()
assertEquals( "default scope NOT back-propagated to dependency.", Artifact.SCOPE_TEST, dep.getScope() );
}
public void testExcludeDoesNotAffectAllDependencies()
throws Exception
{
String groupId = "org.apache.maven";
String artifactId = "maven-model";
String version = "1.0";
Dependency dep1 = new Dependency();
dep1.setGroupId( groupId );
dep1.setArtifactId( artifactId + "1" );
dep1.setVersion( version );
dep1.setExclusions( Arrays.asList( new String[] { "exclude1:exclude1" } ) );
Model model = new Model();
model.addDependency( dep1 );
Dependency dep2 = new Dependency();
dep2.setGroupId( groupId );
dep2.setArtifactId( artifactId + "2" );
dep1.setVersion( version );
model.addDependency( dep2 );
MavenProject project = new MavenProject( model );
ModelDefaultsInjector injector = (ModelDefaultsInjector) lookup( ModelDefaultsInjector.ROLE );
injector.injectDefaults( model );
ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
project.setArtifacts( project.createArtifacts( factory, null, null ) );
String key = ArtifactUtils.versionlessKey( groupId, artifactId );
Map artifactMap = project.getArtifactMap();
assertNotNull( "artifact-map should not be null.", artifactMap );
assertEquals( "artifact-map should contain 1 element.", 1, artifactMap.size() );
Artifact artifact = (Artifact) artifactMap.get( key );
assertNotNull( "dependency artifact not found in map.", artifact );
assertEquals( "dependency artifact has wrong scope.", Artifact.SCOPE_TEST, artifact.getScope() );
//check for back-propagation of default scope.
assertEquals( "default scope NOT back-propagated to dependency.", Artifact.SCOPE_TEST, dep1.getScope() );
}
}