mirror of https://github.com/apache/maven.git
Resolving: MNG-766.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@239464 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0ef80f1227
commit
252b151052
|
@ -159,6 +159,8 @@ it0055: Test that source includes/excludes with in the compiler plugin config.
|
|||
it0056: Test that multiple executions of the compile goal with different
|
||||
includes/excludes will succeed.
|
||||
|
||||
it0057: Verify that scope == 'provided' dependencies are available to tests.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
- generated sources
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
it0057
|
||||
it0056
|
||||
it0055
|
||||
it0054
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
target/classes/org/apache/maven/it0001/Person.class
|
||||
target/test-classes/org/apache/maven/it0001/PersonTest.class
|
||||
target/maven-core-it0057-1.0.jar
|
||||
target/maven-core-it0057-1.0.jar!/it0001.properties
|
|
@ -0,0 +1 @@
|
|||
package
|
|
@ -0,0 +1,15 @@
|
|||
<model>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core-it0057</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</model>
|
|
@ -0,0 +1,16 @@
|
|||
package org.apache.maven.it0001;
|
||||
|
||||
public class Person
|
||||
{
|
||||
private String name;
|
||||
|
||||
public void setName( String name )
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
name = jason
|
|
@ -0,0 +1,16 @@
|
|||
package org.apache.maven.it0001;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class PersonTest
|
||||
extends TestCase
|
||||
{
|
||||
public void testPerson()
|
||||
{
|
||||
Person person = new Person();
|
||||
|
||||
person.setName( "foo" );
|
||||
|
||||
assertEquals( "foo", person.getName() );
|
||||
}
|
||||
}
|
|
@ -445,16 +445,18 @@ public class MavenProject
|
|||
if ( isAddedToClasspath( a ) )
|
||||
{
|
||||
// TODO: let the scope handler deal with this
|
||||
if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) ||
|
||||
Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
|
||||
// NOTE: [jc] scope == 'test' is the widest possible scope, so we don't really need to perform
|
||||
// this check...
|
||||
// if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) ||
|
||||
// Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
|
||||
// {
|
||||
// }
|
||||
File file = a.getFile();
|
||||
if ( file == null )
|
||||
{
|
||||
File file = a.getFile();
|
||||
if ( file == null )
|
||||
{
|
||||
throw new DependencyResolutionRequiredException( a );
|
||||
}
|
||||
list.add( file.getPath() );
|
||||
throw new DependencyResolutionRequiredException( a );
|
||||
}
|
||||
list.add( file.getPath() );
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
@ -472,11 +474,15 @@ public class MavenProject
|
|||
if ( isAddedToClasspath( a ) )
|
||||
{
|
||||
// TODO: let the scope handler deal with this
|
||||
if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) ||
|
||||
Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
|
||||
{
|
||||
list.add( a );
|
||||
}
|
||||
// NOTE: [jc] scope == 'test' is the widest possible scope, so we don't really need to perform
|
||||
// this check...
|
||||
// if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) ||
|
||||
// Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
|
||||
// {
|
||||
// list.add( a );
|
||||
// }
|
||||
|
||||
list.add( a );
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
@ -498,20 +504,23 @@ public class MavenProject
|
|||
Artifact a = (Artifact) i.next();
|
||||
|
||||
// TODO: let the scope handler deal with this
|
||||
if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) ||
|
||||
Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
|
||||
{
|
||||
Dependency dependency = new Dependency();
|
||||
// NOTE: [jc] scope == 'test' is the widest possible scope, so we don't really need to perform
|
||||
// this check...
|
||||
// if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) ||
|
||||
// Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
|
||||
// {
|
||||
// }
|
||||
|
||||
Dependency dependency = new Dependency();
|
||||
|
||||
dependency.setArtifactId( a.getArtifactId() );
|
||||
dependency.setGroupId( a.getGroupId() );
|
||||
dependency.setVersion( a.getVersion() );
|
||||
dependency.setScope( a.getScope() );
|
||||
dependency.setType( a.getType() );
|
||||
dependency.setClassifier( a.getClassifier() );
|
||||
dependency.setArtifactId( a.getArtifactId() );
|
||||
dependency.setGroupId( a.getGroupId() );
|
||||
dependency.setVersion( a.getVersion() );
|
||||
dependency.setScope( a.getScope() );
|
||||
dependency.setType( a.getType() );
|
||||
dependency.setClassifier( a.getClassifier() );
|
||||
|
||||
list.add( dependency );
|
||||
}
|
||||
list.add( dependency );
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue