Ignore JAVA_TOOL_OPTIONS for AUT.

Change-Id: I423954903d3931335711663c2ff2822b59349601
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
diff --git a/.gitignore b/.gitignore
index 0ec9398..7dad339 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,3 +32,7 @@
 ecl/plugins/org.eclipse.rcptt.ecl.parser/antlr/Ecl__.g
 ecl/plugins/org.eclipse.rcptt.ecl.parser/src/org/eclipse/rcptt/ecl/internal/parser/Ecl.tokens
 m2
+maven-plugin/rcptt-maven-util/rcptt-maven-util.iml
+maven-plugin/rcptt-maven-plugin/rcptt-maven-plugin.iml
+maven-plugin/rcptt-maven-modules.iml
+.idea
diff --git a/maven-plugin/rcptt-maven-plugin/src/main/java/org/eclipse/rcptt/maven/ExecuteMojo.java b/maven-plugin/rcptt-maven-plugin/src/main/java/org/eclipse/rcptt/maven/ExecuteMojo.java
index 10aed57..40da423 100644
--- a/maven-plugin/rcptt-maven-plugin/src/main/java/org/eclipse/rcptt/maven/ExecuteMojo.java
+++ b/maven-plugin/rcptt-maven-plugin/src/main/java/org/eclipse/rcptt/maven/ExecuteMojo.java
@@ -89,6 +89,16 @@
 	// TODO: Replace this random number with carefully thought one
 	private static final int TEST_FAIL_EXIT_CODE = 56;
 
+	private class AUTCommandLine extends Commandline {
+		@Override public void addEnvironment(String name, String value) {
+			if( name.equals("JAVA_TOOL_OPTIONS")) {
+				getLog().info(format("Environment variable %s=%s is ignored, please use AUT options", name, value));
+				return;
+			}
+			super.addEnvironment(name, value);
+		}
+	}
+
 	@Override
 	public void execute() throws MojoExecutionException, MojoFailureException {
 		if (skipTests()) {
@@ -102,7 +112,8 @@
 
 		validatePreparation();
 		JavaExec java = JavaExec.getDefault();
-		Commandline cmd = new Commandline();
+		AUTCommandLine cmd = new AUTCommandLine();
+
 		cmd.setExecutable(java.getFile().getAbsolutePath());
 		cmd.setWorkingDirectory(getResolvedQ7Dir(getQ7Coords().getPlatform()));
 
@@ -265,7 +276,6 @@
 			int duration = TestOptions.getInt(getTestOptions(), TestOptions.EXEC_TIMEOUT);
 			getLog().info(format("The execution timeout is set to %d seconds", duration));
 			Runtime.getRuntime().addShutdownHook(ShutdownHook);
-			CommandLineUtils.removeShutdownHook(false);
 			int exitCode = CommandLineUtils.executeCommandLine(cmd, outConsumer, errConsumer, duration);
 			getLog().info(format("Runner exit code is: %d", exitCode));
 			if (exitCode != 0) {
diff --git a/maven-plugin/rcptt-maven-util/pom.xml b/maven-plugin/rcptt-maven-util/pom.xml
index 7264735..5fc896e 100644
--- a/maven-plugin/rcptt-maven-util/pom.xml
+++ b/maven-plugin/rcptt-maven-util/pom.xml
@@ -31,7 +31,7 @@
 		<dependency>
 			<groupId>org.codehaus.plexus</groupId>
 			<artifactId>plexus-archiver</artifactId>
-			<version>1.2</version>
+			<version>4.2.0</version>
 			<type>jar</type>
 			<scope>compile</scope>
 		</dependency>