Author: brianf
Date: Tue Oct 16 17:49:21 2007
New Revision: 585307
URL: http://svn.apache.org/viewvc?rev=585307&view=rev
Log:
MNG2045 applying patch from Paul Gier to fix test jar dependencies from sibling
projects.
Modified:
maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Modified:
maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
URL:
http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/MavenProject.java?rev=585307&r1=585306&r2=585307&view=diff
==============================================================================
---
maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
(original)
+++
maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Tue Oct 16 17:49:21 2007
@@ -1681,11 +1681,26 @@
{
String refId = getProjectReferenceId( a.getGroupId(),
a.getArtifactId(), a.getVersion() );
MavenProject project = (MavenProject) projectReferences.get( refId );
+
+ boolean projectDirFound = false;
if ( project != null )
{
- list.add( project.getBuild().getOutputDirectory() );
+ if (a.getType().equals("test-jar"))
+ {
+ File testOutputDir = new File(
project.getBuild().getTestOutputDirectory() );
+ if ( testOutputDir.exists() )
+ {
+ list.add( testOutputDir.getAbsolutePath() );
+ projectDirFound = true;
+ }
+ }
+ else
+ {
+ list.add( project.getBuild().getOutputDirectory() );
+ projectDirFound = true;
+ }
}
- else
+ if ( ! projectDirFound )
{
File file = a.getFile();
if ( file == null )
@@ -1695,4 +1710,5 @@
list.add( file.getPath() );
}
}
+
}