GitHub #300: Allow standard Maven build with any JDK.

Test cases which require source level > 1.5 get separate source folders.
These source folders are only considered if the corresponding
"bytecode.version" property is specified for integration tests.

The standard JaCoCo build targets Java 1.5 and will not execute any of
these tests (regardless of the JDK version used for building).
diff --git a/.appveyor.yml b/.appveyor.yml
index 66f3c3f..7ab0b10 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -11,7 +11,7 @@
 
 build_script:
   # Maven 3.3.9 requires Java >= 7, but generation of Javadocs requires Java <= 6 (https://github.com/jacoco/jacoco/issues/110)
-  - mvn -V -B -e verify -Pno-java8-validation -Djdk.version=1.6 --toolchains=.travis\appveyor-toolchains.xml
+  - mvn -V -B -e verify -Djdk.version=1.6 --toolchains=.travis\appveyor-toolchains.xml
 
 artifacts:
   - path: jacoco\target\*.zip
diff --git a/org.jacoco.core.test/.classpath b/org.jacoco.core.test/.classpath
index 1dfb8d7..ebe550b 100644
--- a/org.jacoco.core.test/.classpath
+++ b/org.jacoco.core.test/.classpath
@@ -10,7 +10,7 @@
 			<attribute name="maven.pomderived" value="true"/>
 		</attributes>
 	</classpathentry>
-	<classpathentry excluding="org/jacoco/core/test/validation/java8/*.java" including="**/*.java" kind="src" output="target/classes" path="src">
+	<classpathentry kind="src" output="target/classes" path="src">
 		<attributes>
 			<attribute name="optional" value="true"/>
 			<attribute name="maven.pomderived" value="true"/>
diff --git a/org.jacoco.core.test/pom.xml b/org.jacoco.core.test/pom.xml
index 3041b48..78beae7 100644
--- a/org.jacoco.core.test/pom.xml
+++ b/org.jacoco.core.test/pom.xml
@@ -40,24 +40,67 @@
   
   <profiles>
     <profile>
-      <id>no-java8-validation</id>
+      <id>java8-validation</id>
       <activation>
-        <jdk>(,1.8)</jdk>
+        <property>
+          <name>bytecode.version</name>
+          <value>1.8</value>
+        </property>
       </activation>
       <build>
         <plugins>
           <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-compiler-plugin</artifactId>
-            <configuration>
-              <excludes>
-                <exclude>org/jacoco/core/test/validation/java8/*.java</exclude>
-              </excludes>
-            </configuration>
+            <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-java8</source>
+                  </sources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>java9-validation</id>
+      <activation>
+        <property>
+          <name>bytecode.version</name>
+          <value>1.9</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <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-java8</source>
+                  </sources>
+                </configuration>
+              </execution>
+            </executions>
           </plugin>
         </plugins>
       </build>
     </profile>
   </profiles>
-  
+
 </project>
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/InterfaceDefaultMethodsTest.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceDefaultMethodsTest.java
similarity index 86%
rename from org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/InterfaceDefaultMethodsTest.java
rename to org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceDefaultMethodsTest.java
index 5045516..405c4cf 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/InterfaceDefaultMethodsTest.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceDefaultMethodsTest.java
@@ -9,10 +9,10 @@
  *    Marc R. Hoffmann - initial API and implementation
  *    
  *******************************************************************************/
-package org.jacoco.core.test.validation.java8;
+package org.jacoco.core.test.validation;
 
 import org.jacoco.core.analysis.ICounter;
-import org.jacoco.core.test.validation.ValidationTestBase;
+import org.jacoco.core.test.validation.targets.InterfaceDefaultMethodsTarget;
 import org.junit.Test;
 
 /**
@@ -21,7 +21,7 @@
 public class InterfaceDefaultMethodsTest extends ValidationTestBase {
 
 	public InterfaceDefaultMethodsTest() {
-		super(InterfaceDefaultMethodsTarget.class);
+		super("src-java8", InterfaceDefaultMethodsTarget.class);
 	}
 
 	@Override
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/LambdaExpressionsTest.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaExpressionsTest.java
similarity index 87%
rename from org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/LambdaExpressionsTest.java
rename to org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaExpressionsTest.java
index 1e3e0df..22dce21 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/LambdaExpressionsTest.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaExpressionsTest.java
@@ -9,10 +9,10 @@
  *    Marc R. Hoffmann - initial API and implementation
  *    
  *******************************************************************************/
-package org.jacoco.core.test.validation.java8;
+package org.jacoco.core.test.validation;
 
 import org.jacoco.core.analysis.ICounter;
-import org.jacoco.core.test.validation.ValidationTestBase;
+import org.jacoco.core.test.validation.targets.LambdaExpressionsTarget;
 import org.junit.Test;
 
 /**
@@ -21,7 +21,7 @@
 public class LambdaExpressionsTest extends ValidationTestBase {
 
 	public LambdaExpressionsTest() {
-		super(LambdaExpressionsTarget.class);
+		super("src-java8", LambdaExpressionsTarget.class);
 	}
 
 	@Override
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/LambdaInInterfaceTest.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaInInterfaceTest.java
similarity index 86%
rename from org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/LambdaInInterfaceTest.java
rename to org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaInInterfaceTest.java
index 17c690f..921348a 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/LambdaInInterfaceTest.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaInInterfaceTest.java
@@ -9,10 +9,10 @@
  *    Marc R. Hoffmann - initial API and implementation
  *    
  *******************************************************************************/
-package org.jacoco.core.test.validation.java8;
+package org.jacoco.core.test.validation;
 
 import org.jacoco.core.analysis.ICounter;
-import org.jacoco.core.test.validation.ValidationTestBase;
+import org.jacoco.core.test.validation.targets.LambdaInInterfaceTarget;
 import org.junit.Test;
 
 /**
@@ -21,7 +21,7 @@
 public class LambdaInInterfaceTest extends ValidationTestBase {
 
 	public LambdaInInterfaceTest() {
-		super(LambdaInInterfaceTarget.class);
+		super("src-java8", LambdaInInterfaceTarget.class);
 	}
 
 	@Override
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/InterfaceDefaultMethodsTarget.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceDefaultMethodsTarget.java
similarity index 94%
rename from org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/InterfaceDefaultMethodsTarget.java
rename to org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceDefaultMethodsTarget.java
index 20ac0f7..65028b9 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/InterfaceDefaultMethodsTarget.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceDefaultMethodsTarget.java
@@ -9,7 +9,7 @@
  *    Marc R. Hoffmann - initial API and implementation
  *    
  *******************************************************************************/
-package org.jacoco.core.test.validation.java8;
+package org.jacoco.core.test.validation.targets;
 
 import static org.jacoco.core.test.validation.targets.Stubs.i1;
 
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/LambdaExpressionsTarget.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaExpressionsTarget.java
similarity index 95%
rename from org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/LambdaExpressionsTarget.java
rename to org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaExpressionsTarget.java
index da511cf..e5e33c8 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/LambdaExpressionsTarget.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaExpressionsTarget.java
@@ -9,7 +9,7 @@
  *    Marc R. Hoffmann - initial API and implementation
  *    
  *******************************************************************************/
-package org.jacoco.core.test.validation.java8;
+package org.jacoco.core.test.validation.targets;
 
 import static org.jacoco.core.test.validation.targets.Stubs.exec;
 import static org.jacoco.core.test.validation.targets.Stubs.noexec;
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/LambdaInInterfaceTarget.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaInInterfaceTarget.java
similarity index 94%
rename from org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/LambdaInInterfaceTarget.java
rename to org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaInInterfaceTarget.java
index 23d152c..73165b7 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/java8/LambdaInInterfaceTarget.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaInInterfaceTarget.java
@@ -9,7 +9,7 @@
  *    Marc R. Hoffmann - initial API and implementation
  *    
  *******************************************************************************/
-package org.jacoco.core.test.validation.java8;
+package org.jacoco.core.test.validation.targets;
 
 import static org.jacoco.core.test.validation.targets.Stubs.nop;
 
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/Source.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/Source.java
index 49c9297..da918a0 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/Source.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/Source.java
@@ -12,6 +12,7 @@
 package org.jacoco.core.test.validation;
 
 import java.io.BufferedReader;
+import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.Reader;
@@ -31,16 +32,18 @@
 public class Source {
 
 	/**
-	 * Reads the source for the given type from the <code>./src/</code> folder
-	 * relative to the working directory.
+	 * Reads the source for the given type from the given source folder relative
+	 * to the working directory.
 	 * 
+	 * @param srcFolder
+	 *            source folder
 	 * @param type
 	 *            type to load the source file for
-	 * @throws IOException
-	 * @throws
 	 */
-	public static Source getSourceFor(final Class<?> type) throws IOException {
-		String file = "src/" + type.getName().replace('.', '/') + ".java";
+	public static Source getSourceFor(final String srcFolder,
+			final Class<?> type) throws IOException {
+		File folder = new File(srcFolder);
+		File file = new File(folder, type.getName().replace('.', '/') + ".java");
 		return new Source(new FileReader(file));
 	}
 
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/SourceTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/SourceTest.java
index efd8e5e..9c6f7e7 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/SourceTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/SourceTest.java
@@ -78,7 +78,7 @@
 
 	@Test
 	public void testGetSourceFor() throws IOException {
-		final Source s = Source.getSourceFor(SourceTest.class);
+		final Source s = Source.getSourceFor("src", SourceTest.class);
 		// Here we are. $line-testGetSourceFor$
 		final String l = s.getLine(s.getLineNumber("testGetSourceFor"));
 		assertTrue(l, l.contains("Here we are."));
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ValidationTestBase.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ValidationTestBase.java
index c341fdb..a3ecabe 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ValidationTestBase.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ValidationTestBase.java
@@ -47,6 +47,8 @@
 		STATUS_NAME[ICounter.PARTLY_COVERED] = "PARTLY_COVERED";
 	}
 
+	protected final String srcFolder;
+
 	protected final Class<?> target;
 
 	protected IClassCoverage classCoverage;
@@ -57,10 +59,15 @@
 
 	protected TargetLoader loader;
 
-	protected ValidationTestBase(final Class<?> target) {
+	protected ValidationTestBase(final String srcFolder, final Class<?> target) {
+		this.srcFolder = srcFolder;
 		this.target = target;
 	}
 
+	protected ValidationTestBase(final Class<?> target) {
+		this("src", target);
+	}
+
 	@Before
 	public void setup() throws Exception {
 		loader = new TargetLoader();
@@ -68,7 +75,7 @@
 				TargetLoader.getClassData(target));
 		final ExecutionDataStore store = execute(reader);
 		analyze(reader, store);
-		source = Source.getSourceFor(target);
+		source = Source.getSourceFor(srcFolder, target);
 	}
 
 	private ExecutionDataStore execute(final ClassReader reader)