Author: kenney
Date: Fri Sep 2 12:15:27 2005
New Revision: 267278
URL: http://svn.apache.org/viewcvs?rev=267278&view=rev
Log:
Fixed IndexOutOfBouds when <sourceDirectory></sourceDirectory> is specified.
Modified:
maven/components/trunk/maven-plugins/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseWriter.java
Modified:
maven/components/trunk/maven-plugins/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseWriter.java
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseWriter.java?rev=267278&r1=267277&r2=267278&view=diff
==============================================================================
---
maven/components/trunk/maven-plugins/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseWriter.java
(original)
+++
maven/components/trunk/maven-plugins/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseWriter.java
Fri Sep 2 12:15:27 2005
@@ -76,7 +76,7 @@
Map eclipseSourceRoots = new HashMap();
Collection referencedProjects = writeEclipseClasspath(
- projectBaseDir, outputDir, project, executedProject,
reactorProjects, eclipseSourceRoots
+ projectBaseDir, outputDir, project, executedProject,
reactorProjects, eclipseSourceRoots
);
writeEclipseProject( projectBaseDir, outputDir, project,
executedProject, referencedProjects, eclipseSourceRoots );
@@ -362,10 +362,10 @@
String eclipseSourceRoot = toRelative( projectBaseDir,
sourceRoot );
// Don't add the same sourceroots twice. No include/exclude
- // patterns possible in maven for (test|script|)source
directories.
+ // patterns possible in maven for (test|script|)source
directories.
if ( addedSourceRoots.containsKey( eclipseSourceRoot ) )
{
- continue;
+ continue;
}
writer.startElement( "classpathentry" );
@@ -409,7 +409,7 @@
if ( !StringUtils.isEmpty( resource.getTargetPath() ) )
{
- output = resource.getTargetPath();
+ output = resource.getTargetPath();
}
File resourceDirectory = new File( resource.getDirectory() );
@@ -427,7 +427,7 @@
// that, even with mutual exclusive include/exclude patterns.
if ( addedSourceRoots.containsKey( eclipseResourceDir ) )
{
- continue;
+ continue;
}
if ( ! projectBaseDir.equals( basedir ) )
@@ -665,7 +665,11 @@
{
String relative;
- if ( absolutePath.startsWith( basedir.getAbsolutePath() ) )
+ if ( absolutePath.equals( basedir.getAbsolutePath() ) )
+ {
+ relative = ".";
+ }
+ else if ( absolutePath.startsWith( basedir.getAbsolutePath() ) )
{
relative = absolutePath.substring(
basedir.getAbsolutePath().length() + 1 );
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]