Index: src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java
===================================================================
--- src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java	(revision 597583)
+++ src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java	(working copy)
@@ -19,6 +19,7 @@
 package org.apache.maven.plugin.eclipse;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
@@ -426,6 +427,51 @@
         testProject( "project-37" );
     }
 
+    public void testProject38and39()
+        throws Exception
+    {
+        TempEclipseWorkspace workspace13 = new TempEclipseWorkspace( "eclipseWithDefault13", true );
+        TempEclipseWorkspace workspace15 = new TempEclipseWorkspace( "eclipseWithDefault15", false );
+        doTestProject38and39( "project-38", workspace13, "" ,null);
+        doTestProject38and39( "project-38", workspace15, "JVM 1.3" ,null);
+        String jre131 = new java.io.File( "target/test-classes/eclipse/dummyJDK/1.3.1/bin/javac" ).getCanonicalPath();
+        doTestProject38and39( "project-39", workspace13, "JVM 1.3.1" ,jre131);
+        doTestProject38and39( "project-39", workspace15, "JVM 1.3.1" ,jre131);
+    }
+
+    public void doTestProject38and39( String project, TempEclipseWorkspace workspace, String expectedJRE ,String jreExec )
+        throws Exception
+    {
+        Properties properties = new Properties();
+        properties.setProperty( "eclipse.workspaceToConnect", workspace.workspaceLocation.getCanonicalPath() );
+        if (jreExec != null) {
+            properties.setProperty( "maven.compiler.executable", jreExec );
+        }
+        testProject( project, properties, "clean", "eclipse" );
+
+        Xpp3Dom classpath =
+            Xpp3DomBuilder.build( new FileReader( getTestFile( "target/test-classes/projects/"+project+"/.classpath" ) ) );
+
+        boolean foundDirectCompileAsProject = false;
+        String foundJRE = "";
+
+        Xpp3Dom[] classpathentries = classpath.getChildren( "classpathentry" );
+        for ( int index = 0; index < classpathentries.length; index++ )
+        {
+            if ( "/direct-compile".equals( classpathentries[index].getAttribute( "path" ) ) )
+            {
+                foundDirectCompileAsProject = true;
+            }
+            String path = classpathentries[index].getAttribute( "path" );
+            if ( "con".equals( classpathentries[index].getAttribute( "kind" ) ) && path.lastIndexOf( '/' ) > 0 )
+            {
+                foundJRE = path.substring( path.lastIndexOf( '/' ) + 1 );
+            }
+        }
+        assertTrue( foundDirectCompileAsProject );
+        assertEquals( expectedJRE, foundJRE );
+    }
+
     public void testJeeSimple()
         throws Exception
     {
Index: src/test/java/org/apache/maven/plugin/eclipse/TempEclipseWorkspace.java
===================================================================
--- src/test/java/org/apache/maven/plugin/eclipse/TempEclipseWorkspace.java	(revision 0)
+++ src/test/java/org/apache/maven/plugin/eclipse/TempEclipseWorkspace.java	(revision 0)
@@ -0,0 +1,78 @@
+package org.apache.maven.plugin.eclipse;
+
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.eclipse.core.internal.localstore.ILocalStoreConstants;
+
+public class TempEclipseWorkspace
+{
+
+    File workspaceLocation;
+
+    public TempEclipseWorkspace( String testWorkspaceName, boolean usePathToProject )
+        throws Exception
+    {
+
+        File eclipseLocation = new java.io.File( "target/test-classes/eclipse" ).getCanonicalFile();
+
+        File jdkLocation = new File( eclipseLocation, "dummyJDK" );
+
+        this.workspaceLocation = new File( eclipseLocation, testWorkspaceName + "/workspace" ).getCanonicalFile();
+
+        File localizedIndicator = new File( this.workspaceLocation, ".localized" );
+        if ( !localizedIndicator.exists() )
+        {
+            File propertyfile =
+                new File( workspaceLocation,
+                          ".metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs" );
+
+            preparePropertyFile( jdkLocation, propertyfile );
+
+            String projectLocation;
+            if ( usePathToProject )
+            {
+                projectLocation = "URI//file:" + ( new File( workspaceLocation, "direct-compile" ).getCanonicalPath() );
+            }
+            else
+            {
+                projectLocation = "";
+            }
+            FileOutputStream location =
+                new FileOutputStream(
+                                      new File( workspaceLocation,
+                                                ".metadata/.plugins/org.eclipse.core.resources/.projects/direct-compile/.location" ) );
+            DataOutputStream dataOutputStream = new DataOutputStream( location );
+            dataOutputStream.write( ILocalStoreConstants.BEGIN_CHUNK );
+            dataOutputStream.writeUTF( projectLocation );
+            dataOutputStream.write( ILocalStoreConstants.END_CHUNK );
+            dataOutputStream.close();
+            location.close();
+            localizedIndicator.createNewFile();
+        }
+
+    }
+
+    private static void preparePropertyFile( File jdkLocation, File propertyfile )
+        throws IOException, FileNotFoundException
+    {
+        Properties properties = new Properties();
+        properties.load( new FileInputStream( propertyfile ) );
+        properties.setProperty(
+                                "org.eclipse.jdt.launching.PREF_VM_XML",
+                                properties.getProperty( "org.eclipse.jdt.launching.PREF_VM_XML" ).replaceAll(
+                                                                                                              "__replace_with_test_dir__",
+                                                                                                              jdkLocation.getCanonicalPath() ) );
+        properties.store( new FileOutputStream( propertyfile ), "" );
+    }
+
+    public File getWorkspaceLocation()
+    {
+        return workspaceLocation;
+    }
+}
Index: src/test/resources/eclipse/dummyJDK/1.3.1/jre/lib/rt.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: src/test/resources/eclipse/dummyJDK/1.3.1/jre/lib/rt.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: src/test/resources/eclipse/dummyJDK/1.3.1/bin/javac
===================================================================
--- src/test/resources/eclipse/dummyJDK/1.3.1/bin/javac	(revision 0)
+++ src/test/resources/eclipse/dummyJDK/1.3.1/bin/javac	(revision 0)
@@ -0,0 +1 @@
+dummy javacompiler
\ No newline at end of file
Index: src/test/resources/eclipse/dummyJDK/1.5.0/jre/lib/rt.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: src/test/resources/eclipse/dummyJDK/1.5.0/jre/lib/rt.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: src/test/resources/eclipse/dummyJDK/1.5.0/bin/javac
===================================================================
--- src/test/resources/eclipse/dummyJDK/1.5.0/bin/javac	(revision 0)
+++ src/test/resources/eclipse/dummyJDK/1.5.0/bin/javac	(revision 0)
@@ -0,0 +1 @@
+dummy javacompiler
\ No newline at end of file
Index: src/test/resources/eclipse/dummyJDK/1.3/jre/lib/rt.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: src/test/resources/eclipse/dummyJDK/1.3/jre/lib/rt.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: src/test/resources/eclipse/dummyJDK/1.3/bin/javac
===================================================================
--- src/test/resources/eclipse/dummyJDK/1.3/bin/javac	(revision 0)
+++ src/test/resources/eclipse/dummyJDK/1.3/bin/javac	(revision 0)
@@ -0,0 +1 @@
+dummy javacompiler
\ No newline at end of file
Index: src/test/resources/eclipse/dummyJDK/1.4.2/jre/lib/rt.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: src/test/resources/eclipse/dummyJDK/1.4.2/jre/lib/rt.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: src/test/resources/eclipse/dummyJDK/1.4.2/bin/javac
===================================================================
--- src/test/resources/eclipse/dummyJDK/1.4.2/bin/javac	(revision 0)
+++ src/test/resources/eclipse/dummyJDK/1.4.2/bin/javac	(revision 0)
@@ -0,0 +1 @@
+dummy javacompiler
\ No newline at end of file
Index: src/test/resources/eclipse/dummyJDK/1.4/jre/lib/rt.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: src/test/resources/eclipse/dummyJDK/1.4/jre/lib/rt.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: src/test/resources/eclipse/dummyJDK/1.4/bin/javac
===================================================================
--- src/test/resources/eclipse/dummyJDK/1.4/bin/javac	(revision 0)
+++ src/test/resources/eclipse/dummyJDK/1.4/bin/javac	(revision 0)
@@ -0,0 +1 @@
+dummy javacompiler
\ No newline at end of file
Index: src/test/resources/eclipse/dummyJDK/1.5/jre/lib/rt.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: src/test/resources/eclipse/dummyJDK/1.5/jre/lib/rt.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: src/test/resources/eclipse/dummyJDK/1.5/bin/javac
===================================================================
--- src/test/resources/eclipse/dummyJDK/1.5/bin/javac	(revision 0)
+++ src/test/resources/eclipse/dummyJDK/1.5/bin/javac	(revision 0)
@@ -0,0 +1 @@
+dummy javacompiler
\ No newline at end of file
Index: src/test/resources/eclipse/eclipseWithDefault13/workspace/direct-compile/.project
===================================================================
--- src/test/resources/eclipse/eclipseWithDefault13/workspace/direct-compile/.project	(revision 0)
+++ src/test/resources/eclipse/eclipseWithDefault13/workspace/direct-compile/.project	(revision 0)
@@ -0,0 +1,9 @@
+<projectDescription>
+  <name>direct-compile</name>
+  <comment/>
+  <projects/>
+  <buildSpec>
+  </buildSpec>
+  <natures>
+  </natures>
+</projectDescription>
\ No newline at end of file
Index: src/test/resources/eclipse/eclipseWithDefault13/workspace/direct-compile/pom.xml
===================================================================
--- src/test/resources/eclipse/eclipseWithDefault13/workspace/direct-compile/pom.xml	(revision 0)
+++ src/test/resources/eclipse/eclipseWithDefault13/workspace/direct-compile/pom.xml	(revision 0)
@@ -0,0 +1,35 @@
+<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>eclipsetest</groupId>
+  <artifactId>direct-compile</artifactId>
+  <version>1.0</version>
+  <distributionManagement>
+    <status>verified</status>
+  </distributionManagement>
+  <dependencies>
+    <dependency>
+      <groupId>eclipsetest</groupId>
+      <artifactId>deps-direct-compile</artifactId>
+      <version>1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>eclipsetest</groupId>
+      <artifactId>deps-direct-test</artifactId>
+      <version>1.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>eclipsetest</groupId>
+      <artifactId>deps-direct-provided</artifactId>
+      <version>1.0</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>eclipsetest</groupId>
+      <artifactId>deps-direct-optional</artifactId>
+      <version>1.0</version>
+      <optional>true</optional>
+    </dependency>
+  </dependencies>
+</project>
Index: src/test/resources/eclipse/eclipseWithDefault13/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs
===================================================================
--- src/test/resources/eclipse/eclipseWithDefault13/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs	(revision 0)
+++ src/test/resources/eclipse/eclipseWithDefault13/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs	(revision 0)
@@ -0,0 +1,3 @@
+#Wed Jun 06 22:20:38 CEST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.launching.PREF_VM_XML=<?xml version\="1.0" encoding\="UTF-8"?>\n<vmSettings defaultVM\="52,org.eclipse.jdt.internal.launching.macosx.MacOSXType5,1.3" defaultVMConnector\="">\n<vmType id\="org.eclipse.jdt.internal.launching.macosx.MacOSXType">\n<vm id\="1.3" javadocURL\="http\://java.sun.com/j2se/1.3/docs/api/" name\="JVM 1.3" path\="__replace_with_test_dir__/1.3"/>\n<vm id\="1.3.1" javadocURL\="http\://java.sun.com/j2se/1.3/docs/api/" name\="JVM 1.3.1" path\="__replace_with_test_dir__/1.3.1"/>\n<vm id\="1.4" javadocURL\="http\://java.sun.com/j2se/1.4.2/docs/api/" name\="JVM 1.4" path\="__replace_with_test_dir__/1.4"/>\n<vm id\="1.4.2" javadocURL\="http\://java.sun.com/j2se/1.4.2/docs/api/" name\="JVM 1.4.2" path\="__replace_with_test_dir__/1.4.2"/>\n<vm id\="1.5" javadocURL\="http\://java.sun.com/j2se/1.5.0/docs/api/" name\="JVM 1.5" path\="__replace_with_test_dir__/1.5"/>\n<vm id\="1.5.0" javadocURL\="http\://java.sun.com/j2se/1.5.0/docs/api/" name\="JVM 1.5.0 (MacOS X Default)" path\="__replace_with_test_dir__/1.5.0"/>\n</vmType>\n</vmSettings>\n
Index: src/test/resources/eclipse/eclipseWithDefault13/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/direct-compile/.location
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: src/test/resources/eclipse/eclipseWithDefault13/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/direct-compile/.location
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: src/test/resources/eclipse/eclipseWithDefault15/workspace/direct-compile/.project
===================================================================
--- src/test/resources/eclipse/eclipseWithDefault15/workspace/direct-compile/.project	(revision 0)
+++ src/test/resources/eclipse/eclipseWithDefault15/workspace/direct-compile/.project	(revision 0)
@@ -0,0 +1,9 @@
+<projectDescription>
+  <name>direct-compile</name>
+  <comment/>
+  <projects/>
+  <buildSpec>
+  </buildSpec>
+  <natures>
+  </natures>
+</projectDescription>
\ No newline at end of file
Index: src/test/resources/eclipse/eclipseWithDefault15/workspace/direct-compile/pom.xml
===================================================================
--- src/test/resources/eclipse/eclipseWithDefault15/workspace/direct-compile/pom.xml	(revision 0)
+++ src/test/resources/eclipse/eclipseWithDefault15/workspace/direct-compile/pom.xml	(revision 0)
@@ -0,0 +1,35 @@
+<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>eclipsetest</groupId>
+  <artifactId>direct-compile</artifactId>
+  <version>1.0</version>
+  <distributionManagement>
+    <status>verified</status>
+  </distributionManagement>
+  <dependencies>
+    <dependency>
+      <groupId>eclipsetest</groupId>
+      <artifactId>deps-direct-compile</artifactId>
+      <version>1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>eclipsetest</groupId>
+      <artifactId>deps-direct-test</artifactId>
+      <version>1.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>eclipsetest</groupId>
+      <artifactId>deps-direct-provided</artifactId>
+      <version>1.0</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>eclipsetest</groupId>
+      <artifactId>deps-direct-optional</artifactId>
+      <version>1.0</version>
+      <optional>true</optional>
+    </dependency>
+  </dependencies>
+</project>
Index: src/test/resources/eclipse/eclipseWithDefault15/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs
===================================================================
--- src/test/resources/eclipse/eclipseWithDefault15/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs	(revision 0)
+++ src/test/resources/eclipse/eclipseWithDefault15/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs	(revision 0)
@@ -0,0 +1,3 @@
+#Wed Jun 06 22:20:38 CEST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.launching.PREF_VM_XML=<?xml version\="1.0" encoding\="UTF-8"?>\n<vmSettings defaultVM\="52,org.eclipse.jdt.internal.launching.macosx.MacOSXType5,1.5" defaultVMConnector\="">\n<vmType id\="org.eclipse.jdt.internal.launching.macosx.MacOSXType">\n<vm id\="1.3" javadocURL\="http\://java.sun.com/j2se/1.3/docs/api/" name\="JVM 1.3" path\="__replace_with_test_dir__/1.3"/>\n<vm id\="1.3.1" javadocURL\="http\://java.sun.com/j2se/1.3/docs/api/" name\="JVM 1.3.1" path\="__replace_with_test_dir__/1.3.1"/>\n<vm id\="1.4" javadocURL\="http\://java.sun.com/j2se/1.4.2/docs/api/" name\="JVM 1.4" path\="__replace_with_test_dir__/1.4"/>\n<vm id\="1.4.2" javadocURL\="http\://java.sun.com/j2se/1.4.2/docs/api/" name\="JVM 1.4.2" path\="__replace_with_test_dir__/1.4.2"/>\n<vm id\="1.5" javadocURL\="http\://java.sun.com/j2se/1.5.0/docs/api/" name\="JVM 1.5" path\="__replace_with_test_dir__/1.5"/>\n<vm id\="1.5.0" javadocURL\="http\://java.sun.com/j2se/1.5.0/docs/api/" name\="JVM 1.5.0 (MacOS X Default)" path\="__replace_with_test_dir__/1.5.0"/>\n</vmType>\n</vmSettings>\n
Index: src/test/resources/eclipse/eclipseWithDefault15/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/direct-compile/.location
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: src/test/resources/eclipse/eclipseWithDefault15/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/direct-compile/.location
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: src/test/resources/projects/project-38/expected/.project
===================================================================
--- src/test/resources/projects/project-38/expected/.project	(revision 0)
+++ src/test/resources/projects/project-38/expected/.project	(revision 0)
@@ -0,0 +1,15 @@
+<projectDescription>
+  <name>maven-eclipse-plugin-test-project-38</name>
+  <comment/>
+  <projects>
+    <project>direct-compile</project>
+  </projects>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file
Index: src/test/resources/projects/project-38/src/main/java/DummyClass.txt
===================================================================
--- src/test/resources/projects/project-38/src/main/java/DummyClass.txt	(revision 0)
+++ src/test/resources/projects/project-38/src/main/java/DummyClass.txt	(revision 0)
@@ -0,0 +1,7 @@
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id: DummyClass.txt 359507 2005-12-28 13:14:19Z fgiust $
+ */
+public class DummyClass
+{
+}
Index: src/test/resources/projects/project-38/pom.xml
===================================================================
--- src/test/resources/projects/project-38/pom.xml	(revision 0)
+++ src/test/resources/projects/project-38/pom.xml	(revision 0)
@@ -0,0 +1,34 @@
+<?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>eclipse</groupId>
+	<artifactId>maven-eclipse-plugin-test-project-38</artifactId>
+	<version>99.0</version>
+	<name>Maven</name>
+	<dependencies>
+		<dependency>
+			<groupId>eclipsetest</groupId>
+			<artifactId>direct-compile</artifactId>
+			<version>1.0</version>
+		</dependency>
+	</dependencies>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-eclipse-plugin</artifactId>
+				<version>test</version>
+				<configuration></configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.3</source>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>
Index: src/test/resources/projects/project-39/expected/.project
===================================================================
--- src/test/resources/projects/project-39/expected/.project	(revision 0)
+++ src/test/resources/projects/project-39/expected/.project	(revision 0)
@@ -0,0 +1,15 @@
+<projectDescription>
+  <name>maven-eclipse-plugin-test-project-39</name>
+  <comment/>
+  <projects>
+    <project>direct-compile</project>
+  </projects>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file
Index: src/test/resources/projects/project-39/src/main/java/DummyClass.txt
===================================================================
--- src/test/resources/projects/project-39/src/main/java/DummyClass.txt	(revision 0)
+++ src/test/resources/projects/project-39/src/main/java/DummyClass.txt	(revision 0)
@@ -0,0 +1,7 @@
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id: DummyClass.txt 359507 2005-12-28 13:14:19Z fgiust $
+ */
+public class DummyClass
+{
+}
Index: src/test/resources/projects/project-39/pom.xml
===================================================================
--- src/test/resources/projects/project-39/pom.xml	(revision 0)
+++ src/test/resources/projects/project-39/pom.xml	(revision 0)
@@ -0,0 +1,28 @@
+<?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>eclipse</groupId>
+	<artifactId>maven-eclipse-plugin-test-project-39</artifactId>
+	<version>99.0</version>
+	<name>Maven</name>
+	<dependencies>
+		<dependency>
+			<groupId>eclipsetest</groupId>
+			<artifactId>direct-compile</artifactId>
+			<version>1.0</version>
+		</dependency>
+	</dependencies>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-eclipse-plugin</artifactId>
+				<version>test</version>
+				<configuration>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>
Index: src/main/java/org/apache/maven/plugin/ide/IdeUtils.java
===================================================================
--- src/main/java/org/apache/maven/plugin/ide/IdeUtils.java	(revision 597583)
+++ src/main/java/org/apache/maven/plugin/ide/IdeUtils.java	(working copy)
@@ -266,7 +266,10 @@
         return (Xpp3Dom[]) configurationDomList.toArray( new Xpp3Dom[configurationDomList.size()] );
     }
 
-    public static String getProjectName( String template, IdeDependency dep )
+    /**
+     * Use {@link IdeDependency#getEclipseProjectName()} instead.
+     */
+    protected static String getProjectName( String template, IdeDependency dep )
     {
         return getProjectName( template, dep.getGroupId(), dep.getArtifactId(), dep.getVersion() );
     }
@@ -288,7 +291,7 @@
         return getProjectName( template, project.getGroupId(), project.getArtifactId(), project.getVersion() );
     }
 
-    public static String getProjectName( IdeDependency dep, boolean addVersionToProjectName )
+    private static String getProjectName( IdeDependency dep, boolean addVersionToProjectName )
     {
         return getProjectName( addVersionToProjectName ? PROJECT_NAME_WITH_VERSION_TEMPLATE
                         : PROJECT_NAME_DEFAULT_TEMPLATE, dep );
Index: src/main/java/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.java
===================================================================
--- src/main/java/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.java	(revision 597583)
+++ src/main/java/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.java	(working copy)
@@ -204,6 +204,32 @@
     private Logger logger;
 
     /**
+     * This eclipse workspace is read and all artefacts detected there will be 
+     * connected as eclipse projects and will not be linked to the jars in the 
+     * local repository. Requirment is that it was created with the simular wtp 
+     * settings as the reactor projects, but the project name template my differ.
+     * The pom's in the workspace projects may not contain variables in the 
+     * artefactId, groupId and version tags. 
+     * 
+     * @parameter expression="${eclipse.workspaceToConnect}"
+     */
+    protected String workspace;
+
+    /**
+     * Limit the use of project references to the current workspaceToConnect.
+     * No project refrences will be created to projects in the reactor when they
+     * are not available in the workspace.
+     * 
+     * @parameter expression="${eclipse.limitProjectReferencesToWorkspace}" default-value="false"
+     */
+    protected boolean limitProjectReferencesToWorkspace;
+
+    /**
+     * Cached workspace projects. 
+     */
+    protected IdeDependency[] workspaceArtefacts;
+    
+    /**
      * Getter for <code>artifactMetadataSource</code>.
      * 
      * @return Returns the artifactMetadataSource.
@@ -570,9 +596,9 @@
                         int dependencyDepth = node.getDepth();
                         Artifact art = node.getArtifact();
                         boolean isReactorProject = getUseProjectReferences() && isAvailableAsAReactorProject( art );
-
+                        boolean isWorkspaceProject = getUseProjectReferences() && isAvailableAsAWorkspaceProject( art );
                         // don't resolve jars for reactor projects
-                        if ( !isReactorProject )
+                        if ( !isReactorProject || (limitProjectReferencesToWorkspace && !isWorkspaceProject ) )
                         {
                             try
                             {
@@ -653,9 +679,13 @@
 
                             isOsgiBundle = osgiSymbolicName != null;
 
+                            boolean useProjectReference = (isReactorProject && !limitProjectReferencesToWorkspace) || // default
+                                (limitProjectReferencesToWorkspace && isWorkspaceProject) || // limitProjectReferencesToWorkspace
+                                (!isReactorProject && isWorkspaceProject); //default + workspace projects
+
                             IdeDependency dep =
                                 new IdeDependency( art.getGroupId(), art.getArtifactId(), art.getVersion(),
-                                                   art.getClassifier(), isReactorProject,
+                                                   art.getClassifier(), useProjectReference,
                                                    Artifact.SCOPE_TEST.equals( art.getScope() ),
                                                    Artifact.SCOPE_SYSTEM.equals( art.getScope() ),
                                                    Artifact.SCOPE_PROVIDED.equals( art.getScope() ),
@@ -803,7 +833,48 @@
         }
         return false;
     }
-
+    
+    /**
+     * @return an array with all dependencies avaliable in the workspace.
+     */
+    protected IdeDependency[] getWorkspaceArtefacts() {
+        return this.workspaceArtefacts;
+    }
+    
+    /**
+     * Utility method that locates a project in the workspace for the given artifact.
+     * 
+     * @param artifact the artifact a project should produce.
+     * @return <code>true</code> if the artifact is produced by a reactor projectart.
+     */
+   private boolean isAvailableAsAWorkspaceProject( Artifact artifact )
+   {
+        IdeDependency[] workspaceArtefacts = getWorkspaceArtefacts();
+        for ( int index = 0; workspaceArtefacts != null && index < workspaceArtefacts.length; index++ )
+        {
+            IdeDependency workspaceArtefact = workspaceArtefacts[index];
+            if ( workspaceArtefact.getGroupId().equals( artifact.getGroupId() )
+                && workspaceArtefact.getArtifactId().equals( artifact.getArtifactId() ) )
+            {
+                if ( workspaceArtefact.getVersion().equals( artifact.getVersion() ) )
+                {
+                    workspaceArtefact.setAddedToClasspath( true );
+                    logger.debug( "Using workspace project: " + workspaceArtefact.getEclipseProjectName() );
+                    return true;
+                }
+                else
+                {
+                    getLog().info(
+                                   "Artifact "
+                                       + artifact.getId()
+                                       + " already available as a workspace project, but with different version. Expected: "
+                                       + artifact.getVersion() + ", found: " + workspaceArtefact.getVersion() );
+                }
+            }
+        }
+        return false;
+    }
+   
     private Map createManagedVersionMap( ArtifactFactory artifactFactory, String projectId,
                                          DependencyManagement dependencyManagement )
         throws MojoExecutionException
Index: src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java
===================================================================
--- src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java	(revision 597583)
+++ src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java	(working copy)
@@ -35,6 +35,7 @@
 import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.model.Resource;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.eclipse.reader.ReadWorkspaceLocations;
 import org.apache.maven.plugin.eclipse.writers.EclipseClasspathWriter;
 import org.apache.maven.plugin.eclipse.writers.EclipseManifestWriter;
 import org.apache.maven.plugin.eclipse.writers.EclipseOSGiManifestWriter;
@@ -50,6 +51,7 @@
 import org.apache.maven.plugin.ide.IdeDependency;
 import org.apache.maven.plugin.ide.IdeUtils;
 import org.apache.maven.plugin.ide.JeeUtils;
+import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
@@ -124,10 +126,10 @@
      * needed WTP natures are added. Natures added using this property <strong>replace</strong> the default list.
      * 
      * <pre>
-     * &lt;projectnatures&gt;
-     *    &lt;projectnature&gt;org.eclipse.jdt.core.javanature&lt;/projectnature&gt;
-     *    &lt;projectnature&gt;org.eclipse.wst.common.modulecore.ModuleCoreNature&lt;/projectnature&gt;
-     * &lt;/projectnatures&gt;
+     *               &lt;projectnatures&gt;
+     *                  &lt;projectnature&gt;org.eclipse.jdt.core.javanature&lt;/projectnature&gt;
+     *                  &lt;projectnature&gt;org.eclipse.wst.common.modulecore.ModuleCoreNature&lt;/projectnature&gt;
+     *               &lt;/projectnatures&gt;
      * </pre>
      * 
      * @parameter
@@ -138,9 +140,9 @@
      * List of eclipse project natures to be added to the default ones.
      * 
      * <pre>
-     * &lt;additionalProjectnatures&gt;
-     *    &lt;projectnature&gt;org.springframework.ide.eclipse.core.springnature&lt;/projectnature&gt;
-     * &lt;/additionalProjectnatures&gt;
+     *               &lt;additionalProjectnatures&gt;
+     *                  &lt;projectnature&gt;org.springframework.ide.eclipse.core.springnature&lt;/projectnature&gt;
+     *               &lt;/additionalProjectnatures&gt;
      * </pre>
      * 
      * @parameter
@@ -151,9 +153,9 @@
      * List of eclipse project facets to be added to the default ones.
      * 
      * <pre>
-     * &lt;additionalProjectFacets&gt;
-     *    &lt;jst.jsf&gt;1.1&lt;jst.jsf/&gt;
-     * &lt;/additionalProjectFacets&gt;
+     *               &lt;additionalProjectFacets&gt;
+     *                  &lt;jst.jsf&gt;1.1&lt;jst.jsf/&gt;
+     *               &lt;/additionalProjectFacets&gt;
      * </pre>
      * 
      * @parameter
@@ -167,11 +169,11 @@
      * that. Configuration example: Old style:
      * 
      * <pre>
-     * &lt;buildcommands&gt;
-     *    &lt;buildcommand&gt;org.eclipse.wst.common.modulecore.ComponentStructuralBuilder&lt;/buildcommand&gt;
-     *    &lt;buildcommand&gt;org.eclipse.jdt.core.javabuilder&lt;/buildcommand&gt;
-     *    &lt;buildcommand&gt;org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver&lt;/buildcommand&gt;
-     * &lt;/buildcommands&gt;
+     *               &lt;buildcommands&gt;
+     *                  &lt;buildcommand&gt;org.eclipse.wst.common.modulecore.ComponentStructuralBuilder&lt;/buildcommand&gt;
+     *                  &lt;buildcommand&gt;org.eclipse.jdt.core.javabuilder&lt;/buildcommand&gt;
+     *                  &lt;buildcommand&gt;org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver&lt;/buildcommand&gt;
+     *               &lt;/buildcommands&gt;
      * </pre>
      * 
      * For new style, see <code>additionalBuildCommands</code>.
@@ -184,23 +186,23 @@
      * List of eclipse build commands to be added to the default ones. Old style:
      * 
      * <pre>
-     * &lt;additionalBuildcommands&gt;
-     *    &lt;buildcommand&gt;org.springframework.ide.eclipse.core.springbuilder&lt;/buildcommand&gt;
-     * &lt;/additionalBuildcommands&gt;
+     *               &lt;additionalBuildcommands&gt;
+     *                  &lt;buildcommand&gt;org.springframework.ide.eclipse.core.springbuilder&lt;/buildcommand&gt;
+     *               &lt;/additionalBuildcommands&gt;
      * </pre>
      * 
      * New style:
      * 
      * <pre>
-     * &lt;additionalBuildcommands&gt;
-     *    &lt;buildCommand&gt;
-     *      &lt;name&gt;org.ui.externaltools.ExternalToolBuilder&lt;/name&gt;
-     *      &lt;triggers&gt;auto,full,incremental,&lt;/triggers&gt;
-     *      &lt;arguments&gt;
-     *        &lt;LaunchConfigHandle&gt;&amp;lt;project&amp;gt;./externalToolBuilders/MavenBuilder.launch&lt;/LaunchConfighandle&gt;
-     *      &lt;/arguments&gt;
-     *    &lt;/buildCommand&gt;
-     * &lt;/additionalBuildcommands&gt;
+     *               &lt;additionalBuildcommands&gt;
+     *                  &lt;buildCommand&gt;
+     *                    &lt;name&gt;org.ui.externaltools.ExternalToolBuilder&lt;/name&gt;
+     *                    &lt;triggers&gt;auto,full,incremental,&lt;/triggers&gt;
+     *                    &lt;arguments&gt;
+     *                      &lt;LaunchConfigHandle&gt;&amp;lt;project&amp;gt;./externalToolBuilders/MavenBuilder.launch&lt;/LaunchConfighandle&gt;
+     *                    &lt;/arguments&gt;
+     *                  &lt;/buildCommand&gt;
+     *               &lt;/additionalBuildcommands&gt;
      * </pre>
      * 
      * Note the difference between <code>build<strong>c</strong>ommand</code> and
@@ -215,11 +217,11 @@
      * classpath container is added. Configuration example:
      * 
      * <pre>
-     * &lt;classpathContainers&gt;
-     *    &lt;classpathContainer&gt;org.eclipse.jdt.launching.JRE_CONTAINER&lt;/classpathContainer&gt;
-     *    &lt;classpathContainer&gt;org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5&lt;/classpathContainer&gt;
-     *    &lt;classpathContainer&gt;org.eclipse.jst.j2ee.internal.web.container/artifact&lt;/classpathContainer&gt;
-     * &lt;/classpathContainers&gt;
+     *               &lt;classpathContainers&gt;
+     *                  &lt;classpathContainer&gt;org.eclipse.jdt.launching.JRE_CONTAINER&lt;/classpathContainer&gt;
+     *                  &lt;classpathContainer&gt;org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5&lt;/classpathContainer&gt;
+     *                  &lt;classpathContainer&gt;org.eclipse.jst.j2ee.internal.web.container/artifact&lt;/classpathContainer&gt;
+     *               &lt;/classpathContainers&gt;
      * </pre>
      * 
      * @parameter
@@ -296,19 +298,19 @@
      * running eclipse:eclipse. FOr each file you can specify the name and the text content.
      * 
      * <pre>
-     * &lt;additionalConfig&gt;
-     *    &lt;file&gt;
-     *      &lt;name&gt;.checkstyle&lt;/name&gt;
-     *      &lt;content&gt;
-     *        &lt;![CDATA[&lt;fileset-config file-format-version=&quot;1.2.0&quot; simple-config=&quot;true&quot;&gt;
-     *          &lt;fileset name=&quot;all&quot; enabled=&quot;true&quot; check-config-name=&quot;acme corporate style&quot; local=&quot;false&quot;&gt;
-     *              &lt;file-match-pattern match-pattern=&quot;.&quot; include-pattern=&quot;true&quot;/&gt;
-     *          &lt;/fileset&gt;
-     *          &lt;filter name=&quot;NonSrcDirs&quot; enabled=&quot;true&quot;/&gt;
-     *        &lt;/fileset-config&gt;]]&gt;
-     *      &lt;/content&gt;
-     *    &lt;/file&gt;
-     * &lt;/additionalConfig&gt;
+     *               &lt;additionalConfig&gt;
+     *                  &lt;file&gt;
+     *                    &lt;name&gt;.checkstyle&lt;/name&gt;
+     *                    &lt;content&gt;
+     *                      &lt;![CDATA[&lt;fileset-config file-format-version=&quot;1.2.0&quot; simple-config=&quot;true&quot;&gt;
+     *                        &lt;fileset name=&quot;all&quot; enabled=&quot;true&quot; check-config-name=&quot;acme corporate style&quot; local=&quot;false&quot;&gt;
+     *                            &lt;file-match-pattern match-pattern=&quot;.&quot; include-pattern=&quot;true&quot;/&gt;
+     *                        &lt;/fileset&gt;
+     *                        &lt;filter name=&quot;NonSrcDirs&quot; enabled=&quot;true&quot;/&gt;
+     *                      &lt;/fileset-config&gt;]]&gt;
+     *                    &lt;/content&gt;
+     *                  &lt;/file&gt;
+     *               &lt;/additionalConfig&gt;
      * </pre>
      * 
      * @parameter
@@ -608,14 +610,15 @@
 
         ready = validate();
 
-        // TODO: Why are we using project in some places, and executedProject in others??
+        // TODO: Why are we using project in some places, and executedProject in
+        // others??
         ArtifactHandler artifactHandler = this.project.getArtifact().getArtifactHandler();
 
         // ear projects don't contain java sources
         // pde projects are always java projects
         isJavaProject =
-            pde ||
-                ( Constants.LANGUAGE_JAVA.equals( artifactHandler.getLanguage() ) && !Constants.PROJECT_PACKAGING_EAR.equals( packaging ) );
+            pde
+                || ( Constants.LANGUAGE_JAVA.equals( artifactHandler.getLanguage() ) && !Constants.PROJECT_PACKAGING_EAR.equals( packaging ) );
 
         setupExtras();
 
@@ -710,12 +713,13 @@
     protected void verifyClasspathContainerListIsComplete()
     {
         boolean containsJREContainer = false;
-        // Check if classpathContainer contains a JRE (default, alternate or Execution Environment)
+        // Check if classpathContainer contains a JRE (default, alternate or
+        // Execution Environment)
         for ( Iterator iter = classpathContainers.iterator(); iter.hasNext(); )
         {
             Object classPathContainer = iter.next();
-            if ( classPathContainer != null &&
-                classPathContainer.toString().startsWith( COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER ) )
+            if ( classPathContainer != null
+                && classPathContainer.toString().startsWith( COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER ) )
             {
                 containsJREContainer = true;
                 break;
@@ -859,9 +863,12 @@
             new EclipseOSGiManifestWriter().init( getLog(), config ).write();
         }
 
-        // NOTE: This one MUST be after EclipseClasspathwriter, and possibly others,
-        // since currently EclipseClasspathWriter does some magic to detect nested
-        // output folders and modifies the configuration by adding new (Ant) builders.
+        // NOTE: This one MUST be after EclipseClasspathwriter, and possibly
+        // others,
+        // since currently EclipseClasspathWriter does some magic to detect
+        // nested
+        // output folders and modifies the configuration by adding new (Ant)
+        // builders.
         // So the .project file must be written AFTER those have run!
         new EclipseProjectWriter().init( getLog(), config ).write();
 
@@ -965,8 +972,8 @@
      */
     private void collectWarContextRootsFromReactorEarConfiguration( EclipseWriterConfig config )
     {
-        if ( reactorProjects != null && this.wtpContextName == null &&
-            Constants.PROJECT_PACKAGING_WAR.equals( this.project.getPackaging() ) )
+        if ( reactorProjects != null && this.wtpContextName == null
+            && Constants.PROJECT_PACKAGING_WAR.equals( this.project.getPackaging() ) )
         {
             for ( Iterator iter = reactorProjects.iterator(); iter.hasNext(); )
             {
@@ -982,15 +989,14 @@
                         Xpp3Dom groupId = warDefinitions[index].getChild( "groupId" );
                         Xpp3Dom artifactId = warDefinitions[index].getChild( "artifactId" );
                         Xpp3Dom contextRoot = warDefinitions[index].getChild( "contextRoot" );
-                        if ( groupId != null && artifactId != null && contextRoot != null &&
-                            groupId.getValue() != null && artifactId.getValue() != null &&
-                            contextRoot.getValue() != null )
+                        if ( groupId != null && artifactId != null && contextRoot != null && groupId.getValue() != null
+                            && artifactId.getValue() != null && contextRoot.getValue() != null )
                         {
                             getLog().info(
-                                           "Found context root definition for " + groupId.getValue() + ":" +
-                                               artifactId.getValue() + " " + contextRoot.getValue() );
-                            if ( this.project.getArtifactId().equals( artifactId.getValue() ) &&
-                                this.project.getGroupId().equals( groupId.getValue() ) )
+                                           "Found context root definition for " + groupId.getValue() + ":"
+                                               + artifactId.getValue() + " " + contextRoot.getValue() );
+                            if ( this.project.getArtifactId().equals( artifactId.getValue() )
+                                && this.project.getGroupId().equals( groupId.getValue() ) )
                             {
                                 config.setContextName( contextRoot.getValue() );
                             }
@@ -998,9 +1004,9 @@
                         else
                         {
                             getLog().info(
-                                           "Found incomplete ear configuration in " + reactorProject.getGroupId() +
-                                               ":" + reactorProject.getGroupId() + " found " +
-                                               warDefinitions[index].toString() );
+                                           "Found incomplete ear configuration in " + reactorProject.getGroupId() + ":"
+                                               + reactorProject.getGroupId() + " found "
+                                               + warDefinitions[index].toString() );
                         }
                     }
                 }
@@ -1047,7 +1053,8 @@
 
         if ( wtpVersionFloat >= 1.0f )
         {
-            projectnatures.add( NATURE_WST_FACET_CORE_NATURE ); // WTP 1.0 nature
+            projectnatures.add( NATURE_WST_FACET_CORE_NATURE ); // WTP 1.0
+            // nature
         }
 
         if ( isJavaProject )
@@ -1057,11 +1064,14 @@
 
         if ( wtpVersionFloat >= 0.7f )
         {
-            projectnatures.add( NATURE_WST_MODULE_CORE_NATURE ); // WTP 0.7/1.0 nature
+            projectnatures.add( NATURE_WST_MODULE_CORE_NATURE ); // WTP 0.7/1.0
+            // nature
 
             if ( isJavaProject )
             {
-                projectnatures.add( NATURE_JEM_WORKBENCH_JAVA_EMF ); // WTP 0.7/1.0 nature
+                projectnatures.add( NATURE_JEM_WORKBENCH_JAVA_EMF ); // WTP
+                // 0.7/1.0
+                // nature
             }
         }
 
@@ -1075,8 +1085,13 @@
     protected void fillDefaultClasspathContainers( String packaging )
     {
         classpathContainers = new ArrayList();
-        classpathContainers.add( COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER );
+        String defaultClasspathContainer =
+            ReadWorkspaceLocations.getDefaultJREContaigner( this.workspace, project, getLog() );
 
+        if ( defaultClasspathContainer != null )
+        {
+            classpathContainers.add( defaultClasspathContainer );
+        }
         if ( pde )
         {
             classpathContainers.add( REQUIRED_PLUGINS_CONTAINER );
@@ -1089,7 +1104,9 @@
 
         if ( wtpVersionFloat == 0.7f )
         {
-            buildcommands.add( new BuildCommand( BUILDER_WST_COMPONENT_STRUCTURAL ) ); // WTP 0.7 builder
+            buildcommands.add( new BuildCommand( BUILDER_WST_COMPONENT_STRUCTURAL ) ); // WTP
+            // 0.7
+            // builder
         }
 
         if ( isJavaProject )
@@ -1099,12 +1116,15 @@
 
         if ( wtpVersionFloat >= 1.5f )
         {
-            buildcommands.add( new BuildCommand( BUILDER_WST_FACET ) ); // WTP 1.5 builder
+            buildcommands.add( new BuildCommand( BUILDER_WST_FACET ) ); // WTP 1.5
+            // builder
         }
 
         if ( wtpVersionFloat >= 0.7f )
         {
-            buildcommands.add( new BuildCommand( BUILDER_WST_VALIDATION ) ); // WTP 0.7/1.0 builder
+            buildcommands.add( new BuildCommand( BUILDER_WST_VALIDATION ) ); // WTP
+            // 0.7/1.0
+            // builder
         }
 
         if ( wtpVersionFloat == 0.7f )
@@ -1135,15 +1155,16 @@
         extractResourceDirs( directories, project.getBuild().getResources(), project, basedir, projectBaseDir, false,
                              relativeOutput );
 
-        // If using the standard output location, don't mix the test output into it.
+        // If using the standard output location, don't mix the test output into
+        // it.
         String testOutput = null;
         boolean useStandardOutputDir =
             buildOutputDirectory.equals( new File( project.getBuild().getOutputDirectory() ) );
         if ( useStandardOutputDir )
         {
             getLog().debug(
-                            "testOutput toRelativeAndFixSeparator " + projectBaseDir + " , " +
-                                project.getBuild().getTestOutputDirectory() );
+                            "testOutput toRelativeAndFixSeparator " + projectBaseDir + " , "
+                                + project.getBuild().getTestOutputDirectory() );
             testOutput =
                 IdeUtils.toRelativeAndFixSeparator( projectBaseDir,
                                                     new File( project.getBuild().getTestOutputDirectory() ), false );
@@ -1235,14 +1256,14 @@
                 }
 
                 getLog().debug(
-                                "Making relative and fixing separator: { " + workspaceProjectBaseDir + ", " +
-                                    outputFile + ", false }." );
+                                "Making relative and fixing separator: { " + workspaceProjectBaseDir + ", "
+                                    + outputFile + ", false }." );
                 thisOutput = IdeUtils.toRelativeAndFixSeparator( workspaceProjectBaseDir, outputFile, false );
             }
 
             getLog().debug(
-                            "Adding eclipse source dir: { " + resourceDir + ", " + thisOutput + ", true, " + test +
-                                ", " + includePattern + ", " + excludePattern + " }." );
+                            "Adding eclipse source dir: { " + resourceDir + ", " + thisOutput + ", true, " + test
+                                + ", " + includePattern + ", " + excludePattern + " }." );
 
             directories.add( new EclipseSourceDir( resourceDir, thisOutput, true, test, includePattern, excludePattern,
                                                    resource.isFiltering() ) );
@@ -1287,6 +1308,40 @@
      */
     public String getProjectNameForArifact( Artifact artifact )
     {
+        IdeDependency[] workspaceArtefacts = getWorkspaceArtefacts();
+        for ( int index = 0; workspaceArtefacts != null && index < workspaceArtefacts.length; index++ )
+        {
+            IdeDependency workspaceArtefact = workspaceArtefacts[index];
+            if ( workspaceArtefact.isAddedToClasspath()
+                && workspaceArtefact.getGroupId().equals( artifact.getGroupId() )
+                && workspaceArtefact.getArtifactId().equals( artifact.getArtifactId() ) )
+            {
+                if ( workspaceArtefact.getVersion().equals( artifact.getVersion() ) )
+                {
+                    return workspaceArtefact.getEclipseProjectName();
+                }
+            }
+        }
         return IdeUtils.getProjectName( calculateProjectNameTemplate(), artifact );
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected IdeDependency[] getWorkspaceArtefacts()
+    {
+        if ( this.workspaceArtefacts == null && this.workspace != null )
+        {
+            try
+            {
+                this.workspaceArtefacts = ReadWorkspaceLocations.readWorkspace( this.workspace, getLog() );
+            }
+            catch ( IOException e )
+            {
+                getLog().error( "could not read workspace", e );
+                this.workspaceArtefacts = new IdeDependency[0];
+            }
+        }
+        return this.workspaceArtefacts;
+    }
 }
Index: src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java
===================================================================
--- src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java	(revision 597583)
+++ src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java	(working copy)
@@ -374,7 +374,7 @@
 
         if ( dep.isReferencedProject() && !config.isPde() )
         {
-            path = "/" + IdeUtils.getProjectName( config.getProjectNameTemplate(), dep ); //$NON-NLS-1$
+            path = "/" + dep.getEclipseProjectName(); //$NON-NLS-1$
             kind = ATTR_SRC;
         }
         else if ( dep.isReferencedProject() && config.isPde() )
@@ -426,11 +426,19 @@
                 else
                 {
                     String fullPath = artifactPath.getPath();
+                    String relativePath = IdeUtils.toRelativeAndFixSeparator( localRepositoryFile, new File( fullPath ), false );
 
-                    path = M2_REPO + "/" //$NON-NLS-1$
-                        + IdeUtils.toRelativeAndFixSeparator( localRepositoryFile, new File( fullPath ), false );
-
-                    kind = ATTR_VAR; //$NON-NLS-1$
+                    if ( !new File( relativePath ).isAbsolute() )
+                    {
+                        path = M2_REPO + "/" //$NON-NLS-1$
+                            + relativePath;
+                        kind = ATTR_VAR; //$NON-NLS-1$
+                    } 
+                    else
+                    {
+                        path = relativePath;
+                        kind = ATTR_LIB;
+                    }
                 }
 
                 if ( dep.getSourceAttachment() != null )
Index: src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebSettingsWriter.java
===================================================================
--- src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebSettingsWriter.java	(revision 597583)
+++ src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebSettingsWriter.java	(working copy)
@@ -171,7 +171,7 @@
                     log.debug( "RadWebSettingsWriter: dependency " + dependency.toString() +
                         " selected for inclusion as lib-module" );
 
-                    String depName = IdeUtils.getProjectName( config.getProjectNameTemplate(), dependency );
+                    String depName = dependency.getEclipseProjectName();
                     String depJar = dependency.getArtifactId() + ".jar";
 
                     writer.startElement( WEBSETTINGS_LIBMODULE );
Index: src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseProjectWriter.java
===================================================================
--- src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseProjectWriter.java	(revision 597583)
+++ src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseProjectWriter.java	(working copy)
@@ -194,7 +194,7 @@
                 if ( dep.isReferencedProject() )
                 {
                     writer.startElement( "project" ); //$NON-NLS-1$
-                    writer.writeText( IdeUtils.getProjectName( config.getProjectNameTemplate(), dep ) );
+                    writer.writeText( dep.getEclipseProjectName());
                     writer.endElement();
                 }
             }
Index: src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/AbstractWtpResourceWriter.java
===================================================================
--- src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/AbstractWtpResourceWriter.java	(revision 597583)
+++ src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/AbstractWtpResourceWriter.java	(working copy)
@@ -208,10 +208,19 @@
             else
             {
                 File localRepositoryFile = new File( localRepository.getBasedir() );
+                String relativePath = IdeUtils.toRelativeAndFixSeparator( localRepositoryFile, repoFile, false );
 
-                handle = "module:/classpath/var/M2_REPO/" //$NON-NLS-1$
-                    +
-                    IdeUtils.toRelativeAndFixSeparator( localRepositoryFile, repoFile, false );
+                if ( !new File( relativePath ).isAbsolute() )
+                {
+                    handle = "module:/classpath/var/M2_REPO/" //$NON-NLS-1$
+                        + relativePath;
+                }
+                else 
+                {
+                    handle = "module:/classpath/lib/" //$NON-NLS-1$
+                        +
+                        IdeUtils.toRelativeAndFixSeparator( config.getEclipseProjectDirectory(), repoFile, false );
+                }
             }
             if ( Constants.PROJECT_PACKAGING_EAR.equals( this.config.getPackaging() ) && !"/".equals( deployPath ) )
             {
Index: src/main/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocations.java
===================================================================
--- src/main/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocations.java	(revision 0)
+++ src/main/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocations.java	(revision 0)
@@ -0,0 +1,412 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.maven.plugin.eclipse.reader;
+
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.jar.JarFile;
+
+import org.apache.maven.plugin.ide.IdeDependency;
+import org.apache.maven.plugin.ide.IdeUtils;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.eclipse.core.internal.localstore.SafeChunkyInputStream;
+
+/**
+ * Scan the eclipse workspace and create a array with {@link IdeDependency} for all found artefacts.
+ * 
+ * @author Richard van Nieuwenhoven
+ * @version $Id: $
+ */
+public class ReadWorkspaceLocations
+{
+
+    private static final String BINARY_LOCATION_FILE = ".location";
+
+    private static final String METADATA_PLUGINS_ORG_ECLIPSE_CORE_RESOURCES_PROJECTS =
+        ".metadata/.plugins/org.eclipse.core.resources/.projects";
+
+    private static final String[] PARENT_VERSION = new String[] { "parent", "version" };
+
+    private static final String[] PARENT_GROUP_ID = new String[] { "parent", "groupId" };
+
+    private static final String[] PACKAGING = new String[] { "packaging" };
+
+    private static final String[] VERSION = new String[] { "version" };
+
+    private static final String[] GROUP_ID = new String[] { "groupId" };
+
+    private static final String[] ARTEFACT_ID = new String[] { "artifactId" };
+
+    private static final String METADATA_PLUGINS_ORG_ECLIPSE_CORE_RUNTIME_PREFS =
+        ".metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs";
+
+    private static final String METADATA_PLUGINS_ORG_ECLIPSE_CORE_RUNTIME_PREFS_VM_KEY =
+        "org.eclipse.jdt.launching.PREF_VM_XML";
+
+    private static final String CLASSPATHENTRY_DEFAULT = "org.eclipse.jdt.launching.JRE_CONTAINER";
+
+    private static final String CLASSPATHENTRY_FORMAT = ReadWorkspaceLocations.CLASSPATHENTRY_DEFAULT + "/{0}/{1}";
+
+    /**
+     * Take the compiler executable and try to find a JRE that contains that compiler.
+     * 
+     * @param rawExecutable the executable with the complete path.
+     * @param jreMap the map with defined JRE's.
+     * @param logger the logger to log the error's
+     * @return the found container or null if non found.
+     */
+    private static String getContaignerFromExecutable( String rawExecutable, Map jreMap, Log logger )
+    {
+        String foundContaigner = null;
+        if ( rawExecutable != null )
+        {
+            String executable;
+            try
+            {
+                executable = new File( rawExecutable ).getCanonicalPath();
+                logger.debug( "detected executable: " + executable );
+            }
+            catch ( Exception e )
+            {
+                return null;
+            }
+            File executableFile = new File( executable );
+            while ( executableFile != null )
+            {
+                foundContaigner = (String) jreMap.get( executableFile.getPath() );
+                if ( foundContaigner != null )
+                {
+                    logger.debug( "detected classpathContaigner from executable: " + foundContaigner );
+                    return foundContaigner;
+
+                }
+                executableFile = executableFile.getParentFile();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Search the default JREContainer from eclipse for the current MavenProject
+     * 
+     * @param workspaceLocation the location of the workspace.
+     * @param project the maven project the get the configuration
+     * @param logger the logger for errors
+     * @return the default eclipse jre to use.
+     */
+    public static String getDefaultJREContaigner( String workspaceLocation, MavenProject project, Log logger )
+    {
+        String defaultJREContainer = ReadWorkspaceLocations.CLASSPATHENTRY_DEFAULT;
+        if ( workspaceLocation != null )
+        {
+            Map jreMap = readAvailableJREs( workspaceLocation, logger );
+            if ( jreMap != null )
+            {
+                String foundContaigner =
+                    getContaignerFromExecutable( System.getProperty( "maven.compiler.executable" ), jreMap, logger );
+                if ( foundContaigner == null )
+                {
+                    foundContaigner =
+                        getContaignerFromExecutable( IdeUtils.getCompilerPluginSetting( project, "executable" ),
+                                                     jreMap, logger );
+                }
+                if ( foundContaigner == null )
+                {
+                    String sourceVersion = IdeUtils.getCompilerSourceVersion( project );
+                    foundContaigner = (String) jreMap.get( sourceVersion );
+                    if ( foundContaigner != null )
+                    {
+                        logger.debug( "detected classpathContaigner from sourceVersion(" + sourceVersion + "): " +
+                            foundContaigner );
+                    }
+                }
+                if ( foundContaigner == null )
+                {
+                    foundContaigner = getContaignerFromExecutable( System.getProperty( "java.home" ), jreMap, logger );
+                }
+                if ( foundContaigner != null )
+                {
+                    defaultJREContainer = foundContaigner;
+                }
+
+            }
+        }
+        return defaultJREContainer;
+    }
+
+    /**
+     * Get the project location for a project in the eclipse metadata.
+     * 
+     * @param workspaceLocation the location of the workspace
+     * @param project the project subdirectory in the metadata
+     * @return the full path to the project.
+     */
+    private static String getProjectLocation( String workspaceLocation, File project )
+    {
+        String projectLocation = null;
+        File location = new File( project, ReadWorkspaceLocations.BINARY_LOCATION_FILE );
+        if ( location.exists() )
+        {
+            try
+            {
+                SafeChunkyInputStream fileInputStream = new SafeChunkyInputStream( location );
+                DataInputStream dataInputStream = new DataInputStream( fileInputStream );
+                String file = dataInputStream.readUTF().trim();
+
+                if ( file.length() > 0 )
+                {
+                    file = file.substring( file.indexOf( ':' ) + 1 );
+                    while ( !Character.isLetterOrDigit( file.charAt( 0 ) ) )
+                    {
+                        file = file.substring( 1 );
+                    }
+                    if ( file.indexOf( ':' ) < 0 )
+                    {
+                        file = File.separator + file;
+                    }
+                    projectLocation = file;
+                }
+
+            }
+            catch ( FileNotFoundException e )
+            {
+                projectLocation = "unknown";
+            }
+            catch ( IOException e )
+            {
+                projectLocation = "unknown";
+            }
+        }
+        if ( projectLocation == null )
+        {
+            File projectBase = new File( new File( workspaceLocation ), project.getName() );
+            if ( projectBase.isDirectory() )
+            {
+                projectLocation = projectBase.getAbsolutePath();
+            }
+        }
+        return projectLocation;
+    }
+
+    /**
+     * get a value from a dom element.
+     * 
+     * @param element the element to get a value from
+     * @param elementNames the sub elements to get
+     * @param defaultValue teh default value if the value was null or empty
+     * @return the value of the dome element.
+     */
+    private static String getValue( Xpp3Dom element, String[] elementNames, String defaultValue )
+    {
+        String value = null;
+        Xpp3Dom dom = element;
+        for ( int index = 0; dom != null && index < elementNames.length; index++ )
+        {
+            dom = dom.getChild( elementNames[index] );
+        }
+        if ( dom != null )
+        {
+            value = dom.getValue();
+        }
+        if ( value == null || value.trim().length() == 0 )
+        {
+            return defaultValue;
+        }
+        else
+        {
+            return value;
+        }
+    }
+
+    /**
+     * Read the artefact information from the pom in the project location and the eclipse project name from the .project
+     * file.
+     * 
+     * @param projectLocation the location of the project
+     * @param logger the logger to report errors and debug info.
+     * @return an {@link IdeDependency} or null.
+     * @throws FileNotFoundException
+     * @throws XmlPullParserException
+     * @throws IOException
+     */
+    private static IdeDependency readArtefact( String projectLocation, Log logger )
+        throws FileNotFoundException, XmlPullParserException, IOException
+    {
+        File projectFile = new File( new File( projectLocation ), ".project" );
+        String eclipseProjectName = new File( projectLocation ).getName();
+        if ( projectFile.exists() )
+        {
+            Xpp3Dom project = Xpp3DomBuilder.build( new FileReader( projectFile ) );
+            eclipseProjectName = getValue( project, new String[] { "name" }, eclipseProjectName );
+        }
+        File pomFile = new File( new File( projectLocation ), "pom.xml" );
+        if ( pomFile.exists() )
+        {
+            Xpp3Dom pom = Xpp3DomBuilder.build( new FileReader( pomFile ) );
+
+            String artifact = getValue( pom, ReadWorkspaceLocations.ARTEFACT_ID, null );
+            String group =
+                getValue( pom, ReadWorkspaceLocations.GROUP_ID, getValue( pom, ReadWorkspaceLocations.PARENT_GROUP_ID,
+                                                                          null ) );
+            String version =
+                getValue( pom, ReadWorkspaceLocations.VERSION, getValue( pom, ReadWorkspaceLocations.PARENT_VERSION,
+                                                                         null ) );
+            String packageing = getValue( pom, ReadWorkspaceLocations.PACKAGING, "jar" );
+
+            logger.debug( "found workspace artefact " + group + ":" + artifact + ":" + version + " " + packageing +
+                " (" + eclipseProjectName + ")" + " -> " + projectLocation );
+            return new IdeDependency( group, artifact, version, packageing, true, false, false, false, false, null,
+                                      packageing, false, null, 0, eclipseProjectName );
+        }
+        else
+        {
+            logger.debug( "ignored workspace project NO pom available " + projectLocation );
+            return null;
+        }
+    }
+
+    /**
+     * Read the JRE definition configured in the workspace. They will be put in a HashMap with as key there path and as
+     * value the JRE constant. a second key is included with the JRE version as a key.
+     * 
+     * @param workspaceLocation the workspace location
+     * @param logger the logger to error messages
+     * @return the map with found jre's
+     */
+    public static HashMap readAvailableJREs( String workspaceLocation, Log logger )
+    {
+        HashMap jreMap = new HashMap();
+        Xpp3Dom vms;
+        try
+        {
+            File prefs =
+                new File( new File( workspaceLocation ),
+                          ReadWorkspaceLocations.METADATA_PLUGINS_ORG_ECLIPSE_CORE_RUNTIME_PREFS );
+            Properties properties = new Properties();
+            properties.load( new FileInputStream( prefs ) );
+            vms =
+                Xpp3DomBuilder.build( new StringReader(
+                                                        properties.getProperty( ReadWorkspaceLocations.METADATA_PLUGINS_ORG_ECLIPSE_CORE_RUNTIME_PREFS_VM_KEY ) ) );
+        }
+        catch ( Exception e )
+        {
+            logger.error( "Could not read workspace JRE preferences", e );
+            return null;
+        }
+        String defaultJRE = vms.getAttribute( "defaultVM" ).trim();
+        Xpp3Dom[] vmTypes = vms.getChildren( "vmType" );
+        for ( int vmTypeIndex = 0; vmTypeIndex < vmTypes.length; vmTypeIndex++ )
+        {
+            String typeId = vmTypes[vmTypeIndex].getAttribute( "id" );
+            Xpp3Dom[] vm = vmTypes[vmTypeIndex].getChildren( "vm" );
+            for ( int vmIndex = 0; vmIndex < vm.length; vmIndex++ )
+            {
+                try
+                {
+                    String path = vm[vmIndex].getAttribute( "path" );
+                    String name = vm[vmIndex].getAttribute( "name" );
+                    String vmId = vm[vmIndex].getAttribute( "id" ).trim();
+                    String classpathEntry =
+                        MessageFormat.format( ReadWorkspaceLocations.CLASSPATHENTRY_FORMAT,
+                                              new Object[] { typeId, name } );
+                    String jrePath = new File( path ).getCanonicalPath();
+                    JarFile rtJar = new JarFile( new File( new File( jrePath ), "jre/lib/rt.jar" ) );
+                    String version = rtJar.getManifest().getMainAttributes().getValue( "Specification-Version" );
+                    if ( defaultJRE.endsWith( "," + vmId ) )
+                    {
+                        jreMap.put( jrePath, ReadWorkspaceLocations.CLASSPATHENTRY_DEFAULT );
+                        jreMap.put( version, ReadWorkspaceLocations.CLASSPATHENTRY_DEFAULT );
+                        logger.debug( "Default Classpath Contaigner version: " + version + "  location: " + jrePath );
+                    }
+                    else if ( !jreMap.containsKey( jrePath ) )
+                    {
+                        if ( !jreMap.containsKey( version ) )
+                        {
+                            jreMap.put( version, classpathEntry );
+                        }
+                        jreMap.put( jrePath, classpathEntry );
+                        logger.debug( "Additional Classpath Contaigner version: " + version + " " + classpathEntry +
+                            " location: " + jrePath );
+                    }
+                    else
+                    {
+                        logger.debug( "Ignored (duplicated) additional Classpath Contaigner version: " + version + " " +
+                            classpathEntry + " location: " + jrePath );
+                    }
+                }
+                catch ( IOException e )
+                {
+                    logger.warn( "Could not interpret entry: " + vm.toString() );
+                }
+            }
+        }
+        return jreMap;
+    }
+
+    /**
+     * Scan the eclipse workspace and create a array with {@link IdeDependency} for all found artefacts.
+     * 
+     * @param workspaceLocation the location of the eclipse workspace.
+     * @param logger the logger to report errors and debug info.
+     * @return the array with detected artefacts.
+     * @throws IOException if the workspace could not be read.
+     */
+    public static IdeDependency[] readWorkspace( String workspaceLocation, Log logger )
+        throws IOException
+    {
+        File workspace =
+            new File( new File( workspaceLocation ),
+                      ReadWorkspaceLocations.METADATA_PLUGINS_ORG_ECLIPSE_CORE_RESOURCES_PROJECTS );
+        ArrayList dependencys = new ArrayList();
+        File[] directories = workspace.listFiles();
+        for ( int index = 0; directories != null && index < directories.length; index++ )
+        {
+            File project = directories[index];
+            if ( project.isDirectory() )
+            {
+                try
+                {
+                    String projectLocation = getProjectLocation( workspaceLocation, project );
+                    if ( projectLocation != null )
+                    {
+                        IdeDependency ideDependency = readArtefact( projectLocation, logger );
+                        if ( ideDependency != null )
+                        {
+                            dependencys.add( ideDependency );
+                        }
+                    }
+                }
+                catch ( Exception e )
+                {
+                    logger.warn( "could not read project:" + project );
+                }
+            }
+        }
+        return (IdeDependency[]) dependencys.toArray( new IdeDependency[dependencys.size()] );
+    }
+}
Index: src/main/eclipse/org/eclipse/core/internal/localstore/epl-v10.html
===================================================================
--- src/main/eclipse/org/eclipse/core/internal/localstore/epl-v10.html	(revision 0)
+++ src/main/eclipse/org/eclipse/core/internal/localstore/epl-v10.html	(revision 0)
@@ -0,0 +1,319 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<meta name="ProgId" content="Word.Document">
+<meta name="Generator" content="Microsoft Word 9">
+<meta name="Originator" content="Microsoft Word 9">
+<link rel="File-List" href="http://www.eclipse.org/legal/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+  <o:Revision>2</o:Revision>
+  <o:TotalTime>3</o:TotalTime>
+  <o:Created>2004-03-05T23:03:00Z</o:Created>
+  <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+  <o:Pages>4</o:Pages>
+  <o:Words>1626</o:Words>
+  <o:Characters>9270</o:Characters>
+   <o:Lines>77</o:Lines>
+  <o:Paragraphs>18</o:Paragraphs>
+  <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+  <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+  <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+
+
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+	{font-family:Tahoma;
+	panose-1:2 11 6 4 3 5 4 4 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{mso-style-parent:"";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman";
+	mso-fareast-font-family:"Times New Roman";}
+p
+	{margin-right:0in;
+	mso-margin-top-alt:auto;
+	mso-margin-bottom-alt:auto;
+	margin-left:0in;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman";
+	mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+	{mso-style-name:"Balloon Text";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:8.0pt;
+	font-family:Tahoma;
+	mso-fareast-font-family:"Times New Roman";}
+@page Section1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.25in 1.0in 1.25in;
+	mso-header-margin:.5in;
+	mso-footer-margin:.5in;
+	mso-paper-source:0;}
+div.Section1
+	{page:Section1;}
+-->
+</style></head><body style="" lang="EN-US">
+
+<div class="Section1">
+
+<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p>
+
+<p><span style="font-size: 10pt;">"Contribution" means:</span> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear="left">
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i)
+changes to the Program, and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii)
+additions to the Program;</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style="font-size: 10pt;">"Contributor" means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style="font-size: 10pt;">"Licensed Patents " mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style="font-size: 10pt;">"Program" means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style="font-size: 10pt;">"Recipient" means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p>
+
+<p><span style="font-size: 10pt;">A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b)
+its license agreement:</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style="color: blue;"> </span></span></p>
+
+<p><span style="font-size: 10pt;">When the Program is made available in source
+code form:</span> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+it must be made available under this Agreement; and </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style="font-size: 10pt;">Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style="font-size: 10pt;">Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style="font-size: 10pt;">Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor ("Commercial
+Contributor") hereby agrees to defend and indemnify every other
+Contributor ("Indemnified Contributor") against any losses, damages and
+costs (collectively "Losses") arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style="font-size: 10pt;">For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p>
+
+<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p>
+
+<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style="font-size: 10pt;">If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class="MsoNormal"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></p>
+
+</div>
+
+</body></html>
\ No newline at end of file
Index: src/main/eclipse/org/eclipse/core/internal/localstore/SafeChunkyInputStream.java
===================================================================
--- src/main/eclipse/org/eclipse/core/internal/localstore/SafeChunkyInputStream.java	(revision 0)
+++ src/main/eclipse/org/eclipse/core/internal/localstore/SafeChunkyInputStream.java	(revision 0)
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.core.internal.localstore;
+
+import java.io.*;
+
+/**
+ * @see SafeChunkyOutputStream
+ */
+
+public class SafeChunkyInputStream extends InputStream {
+    protected static final int BUFFER_SIZE = 8192;
+    protected byte[] buffer;
+    protected int bufferLength = 0;
+    protected byte[] chunk;
+    protected int chunkLength = 0;
+    protected boolean endOfFile = false;
+    protected InputStream input;
+    protected int nextByteInBuffer = 0;
+    protected int nextByteInChunk = 0;
+
+    public SafeChunkyInputStream(File target) throws IOException {
+        this(target, BUFFER_SIZE);
+    }
+
+    public SafeChunkyInputStream(File target, int bufferSize) throws IOException {
+        input = new FileInputStream(target);
+        buffer = new byte[bufferSize];
+    }
+
+    protected void accumulate(byte[] data, int start, int end) {
+        byte[] result = new byte[chunk.length + end - start];
+        System.arraycopy(chunk, 0, result, 0, chunk.length);
+        System.arraycopy(data, start, result, chunk.length, end - start);
+        chunk = result;
+        chunkLength = chunkLength + end - start;
+    }
+
+    public int available() throws IOException {
+        return chunkLength - nextByteInChunk;
+    }
+
+    protected void buildChunk() throws IOException {
+        if (nextByteInBuffer + ILocalStoreConstants.CHUNK_DELIMITER_SIZE > bufferLength)
+           shiftAndFillBuffer();
+        int end = find(ILocalStoreConstants.END_CHUNK, nextByteInBuffer, bufferLength, true);
+        if (end != -1) {
+            accumulate(buffer, nextByteInBuffer, end);
+            nextByteInBuffer = end + ILocalStoreConstants.CHUNK_DELIMITER_SIZE;
+            return;
+        }
+        accumulate(buffer, nextByteInBuffer, bufferLength);
+        bufferLength = input.read(buffer);
+        nextByteInBuffer = 0;
+        if (bufferLength == -1) {
+            endOfFile = true;
+            return;
+        }
+        buildChunk();
+    }
+
+    public void close() throws IOException {
+        input.close();
+    }
+
+    protected boolean compare(byte[] source, byte[] target, int startIndex) {
+        for (int i = 0; i < target.length; i++) {
+            if (source[startIndex] != target[i])
+                return false;
+            startIndex++;
+        }
+        return true;
+    }
+
+    protected int find(byte[] pattern, int startIndex, int endIndex, boolean accumulate) throws IOException {
+        int pos = findByte(pattern[0], startIndex, endIndex);
+        if (pos == -1)
+            return -1;
+        if (pos + ILocalStoreConstants.CHUNK_DELIMITER_SIZE > bufferLength) {
+            if (accumulate)
+                accumulate(buffer, nextByteInBuffer, pos);
+            nextByteInBuffer = pos;
+            pos = 0;
+            shiftAndFillBuffer();
+        }
+        if (compare(buffer, pattern, pos))
+            return pos;
+        return find(pattern, pos + 1, endIndex, accumulate);
+    }
+
+    protected int findByte(byte target, int startIndex, int endIndex) {
+         while (startIndex < endIndex) {
+             if (buffer[startIndex] == target)
+                 return startIndex;
+             startIndex++;
+         }
+         return -1;
+    }
+
+    protected void findChunkStart() throws IOException {
+        if (nextByteInBuffer + ILocalStoreConstants.CHUNK_DELIMITER_SIZE > bufferLength)
+           shiftAndFillBuffer();
+        int begin = find(ILocalStoreConstants.BEGIN_CHUNK, nextByteInBuffer, bufferLength, false);
+        if (begin != -1) {
+             nextByteInBuffer = begin + ILocalStoreConstants.CHUNK_DELIMITER_SIZE;
+             return;
+        }
+        bufferLength = input.read(buffer);
+        nextByteInBuffer = 0;
+        if (bufferLength == -1) {
+             resetChunk();
+             endOfFile = true;
+             return;
+         }
+         findChunkStart();
+     }
+
+     public int read() throws IOException {
+         if (endOfFile)
+             return -1;
+         // if there are bytes left in the chunk, return the first available
+         if (nextByteInChunk < chunkLength)
+             return chunk[nextByteInChunk++] & 0xFF;
+         // Otherwise the chunk is empty so clear the current one, get the next
+         // one and recursively call read. Need to recur as the chunk may be
+         // real but empty.
+         resetChunk();
+         findChunkStart();
+         if (endOfFile)
+             return -1;
+         buildChunk();
+         refineChunk();
+         return read();
+     }
+
+     /**
+      * Skip over any begin chunks in the current chunk. This could be optimized
+      * to skip at the same time as we are scanning the buffer.
+      */
+     protected void refineChunk() {
+         int start = chunkLength - ILocalStoreConstants.CHUNK_DELIMITER_SIZE;
+         if (start < 0)
+             return;
+         for (int i = start; i >= 0; i--) {
+             if (compare(chunk, ILocalStoreConstants.BEGIN_CHUNK, i)) {
+                 nextByteInChunk = i + ILocalStoreConstants.CHUNK_DELIMITER_SIZE;
+                 return;
+             }
+         }
+     }
+
+     protected void resetChunk() {
+         chunk = new byte[0];
+         chunkLength = 0;
+         nextByteInChunk = 0;
+     }
+
+     protected void shiftAndFillBuffer() throws IOException {
+         int length = bufferLength - nextByteInBuffer;
+         System.arraycopy(buffer, nextByteInBuffer, buffer, 0, length);
+         nextByteInBuffer = 0;
+         bufferLength = length;
+         int read = input.read(buffer, bufferLength, buffer.length - bufferLength);
+         if (read != -1)
+             bufferLength += read;
+         else {
+             resetChunk();
+             endOfFile = true;
+         }
+     }
+ }
\ No newline at end of file
Index: src/main/eclipse/org/eclipse/core/internal/localstore/ILocalStoreConstants.java
===================================================================
--- src/main/eclipse/org/eclipse/core/internal/localstore/ILocalStoreConstants.java	(revision 0)
+++ src/main/eclipse/org/eclipse/core/internal/localstore/ILocalStoreConstants.java	(revision 0)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.core.internal.localstore;
+
+public interface ILocalStoreConstants {
+
+    /** Common constants for History Store classes. */
+    public final static int SIZE_LASTMODIFIED = 8;
+    public static final int SIZE_COUNTER = 1;
+    public static final int SIZE_KEY_SUFFIX = SIZE_LASTMODIFIED + SIZE_COUNTER;
+
+    /** constants for safe chunky streams */
+
+    // 40b18b8123bc00141a2596e7a393be1e
+public static final byte[] BEGIN_CHUNK = {64, -79, -117, -127, 35, -68, 0, 20, 26, 37, -106, -25, -93, -109, -66, 30};
+
+    // c058fbf323bc00141a51f38c7bbb77c6
+public static final byte[] END_CHUNK = {-64, 88, -5, -13, 35, -68, 0, 20, 26, 81, -13, -116, 123, -69, 119, -58};
+
+    /** chunk delimiter size */
+    // BEGIN_CHUNK and END_CHUNK must have the same length
+public static final int CHUNK_DELIMITER_SIZE = BEGIN_CHUNK.length;
+}
\ No newline at end of file
Index: pom.xml
===================================================================
--- pom.xml	(revision 597583)
+++ pom.xml	(working copy)
@@ -65,6 +65,24 @@
           </systemProperties>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>add-source</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>add-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>src/main/eclipse</source>
+              </sources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <dependencies>
