Index: modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/pom.xml
===================================================================
--- modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/pom.xml	(nonexistent)
+++ modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/pom.xml	(revision 48428)
@@ -0,0 +1,140 @@
+<?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">
+	<parent>
+    		<groupId>eu.dnetlib</groupId>
+	        <artifactId>dnet45-parent</artifactId>
+            <version>1.0.0</version>
+	</parent>
+
+	<version>0.0.2</version>
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>icm-iis-oozie-maven-plugin</artifactId>
+	<packaging>maven-plugin</packaging>
+
+	<scm>
+	  <developerConnection>
+	    scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2
+	  </developerConnection>
+	</scm>
+
+	<properties>
+	</properties>
+
+	<repositories>                                                                                                                                                                                
+	    <repository>
+	      <id>dnet-deps</id>
+	      <name>dnet-dependencies</name>
+	      <url>http://maven.research-infrastructures.eu/nexus/content/repositories/dnet-deps</url>
+	      <layout>default</layout>
+	    </repository>
+		<repository>
+			<id>cloudera</id>
+			<name>Cloudera Repository</name>
+			<url>https://repository.cloudera.com/artifactory/cloudera-repos</url>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+			<snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+		</repository>
+	</repositories>
+
+	<dependencies>
+	<dependency>
+	      <groupId>org.apache.maven</groupId>
+	      <artifactId>maven-plugin-api</artifactId>
+	      <version>2.0</version>
+	    </dependency>
+	    <dependency>
+	      <groupId>org.apache.maven</groupId>
+	      <artifactId>maven-project</artifactId>
+	      <version>2.0</version>
+	    </dependency>
+	    <dependency>
+			<groupId>org.apache.oozie</groupId>
+			<artifactId>oozie-client</artifactId>
+			<version>${iis.oozie.version}</version>
+			<exclusions>
+				<exclusion>
+					<artifactId>slf4j-simple</artifactId>
+					<groupId>org.slf4j</groupId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+	</dependencies>
+	<build>	
+	<directory>target</directory>
+    <outputDirectory>target/classes</outputDirectory>
+    <finalName>${project.artifactId}-${project.version}</finalName>
+    <testOutputDirectory>target/test-classes</testOutputDirectory>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.3.2</version>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <version>2.1.2</version>
+        <executions>
+          <execution>
+            <id>attach-sources</id>
+            <phase>verify</phase>
+            <goals>
+              <goal>jar-no-fork</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+    <pluginManagement>
+    	<plugins>
+    		<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+    		<plugin>
+    			<groupId>org.eclipse.m2e</groupId>
+    			<artifactId>lifecycle-mapping</artifactId>
+    			<version>1.0.0</version>
+    			<configuration>
+    				<lifecycleMappingMetadata>
+    					<pluginExecutions>
+    						<pluginExecution>
+    							<pluginExecutionFilter>
+    								<groupId>
+    									org.apache.maven.plugins
+    								</groupId>
+    								<artifactId>
+    									maven-plugin-plugin
+    								</artifactId>
+    								<versionRange>[3.2,)</versionRange>
+    								<goals>
+    									<goal>descriptor</goal>
+    								</goals>
+    							</pluginExecutionFilter>
+    							<action>
+    								<ignore />
+    							</action>
+    						</pluginExecution>
+    					</pluginExecutions>
+    				</lifecycleMappingMetadata>
+    			</configuration>
+    		</plugin>
+    	</plugins>
+    </pluginManagement>
+	</build>
+
+    <distributionManagement>
+        <repository>
+        <id>dnet45-bootstrap-release</id>
+        <url>
+        http://maven.research-infrastructures.eu/nexus/content/repositories/dnet45-bootstrap-release
+        </url>
+        </repository>
+    </distributionManagement>
+
+</project>
Index: modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/src/main/java/eu/dnetlib/maven/plugin/oozie/CheckJobStatus.java
===================================================================
--- modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/src/main/java/eu/dnetlib/maven/plugin/oozie/CheckJobStatus.java	(nonexistent)
+++ modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/src/main/java/eu/dnetlib/maven/plugin/oozie/CheckJobStatus.java	(revision 48428)
@@ -0,0 +1,77 @@
+package eu.dnetlib.maven.plugin.oozie;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.oozie.client.OozieClient;
+import org.apache.oozie.client.OozieClientException;
+import org.apache.oozie.client.WorkflowJob.Status;
+
+
+
+/**
+ * Checks oozie job status.
+ * @author mhorst
+ *
+ * @goal check-job-status
+ */
+public class CheckJobStatus extends AbstractMojo {
+	
+
+    public static final String PROPERTY_NAME_LOG_FILE_LOCATION = "logFileLocation";
+	
+	/**
+	 * @parameter expression="${properties.oozieLocation}"
+	 */
+	private String oozieLocation;
+	
+	/**
+	 * @parameter expression="${properties.jobId}"
+	 */
+	private String jobId;
+	
+	/**
+	 * @parameter expression="${properties.maxExecutionTimeMins}"
+	 */
+	private Integer maxExecutionTimeMins;
+	
+	/**
+	 * @parameter expression="${properties.checkIntervalSecs}"
+	 */
+	private Integer checkIntervalSecs = 60;
+	
+    @Override
+    public void execute() throws MojoExecutionException, MojoFailureException {
+    	OozieClient oozieClient = new OozieClient(oozieLocation);
+//    	OozieClient oozieClient = new AuthOozieClient(oozieLocation);
+    	long maxExecutionTime = 1000L * 60 * maxExecutionTimeMins;
+    	long checkInterval = 1000L * checkIntervalSecs;
+    	long startTime = System.currentTimeMillis();
+    	try {
+        	try {
+        		while ((System.currentTimeMillis()-startTime)<maxExecutionTime) {
+        			Thread.sleep(checkInterval);
+        			Status status = oozieClient.getJobInfo(jobId).getStatus();
+        			if (Status.SUCCEEDED.equals(status)) {
+        				getLog().info("job SUCCEEDED");
+        				return;
+        			} else if (Status.FAILED.equals(status) || Status.KILLED.equals(status)) {
+        				System.out.print(oozieClient.getJobLog(jobId));
+        				throw new MojoFailureException("job " + jobId + " finished with status: " + status);
+        			} else {
+        				getLog().info("job " + jobId + " is still running with status: " + status);
+        			}
+        		}
+        		System.out.print(oozieClient.getJobLog(jobId));
+            	throw new MojoFailureException("Maximum execution time has passed!");
+            	
+        	} catch (InterruptedException e) {
+        		System.out.print(oozieClient.getJobLog(jobId));
+        		throw new MojoExecutionException("exception occured while sleeping", e);
+    		}
+    	} catch (OozieClientException e) {
+			throw new MojoExecutionException("exception occured when obtaining status from oozie", e);
+		}
+    }
+
+}

Property changes on: modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/src/main/java/eu/dnetlib/maven/plugin/oozie/CheckJobStatus.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/src/main/java/eu/dnetlib/maven/plugin/oozie/ReadJobId.java
===================================================================
--- modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/src/main/java/eu/dnetlib/maven/plugin/oozie/ReadJobId.java	(nonexistent)
+++ modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/src/main/java/eu/dnetlib/maven/plugin/oozie/ReadJobId.java	(revision 48428)
@@ -0,0 +1,88 @@
+package eu.dnetlib.maven.plugin.oozie;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ * Read oozie job identifier from log file.
+ * @author mhorst
+ *
+ * @goal read-job-id
+ */
+public class ReadJobId extends AbstractMojo {
+	
+
+    public static final String PROPERTY_NAME_LOG_FILE_LOCATION = "logFileLocation";
+    
+	public static final String PROPERTY_NAME_OOZIE_JOB_ID = "oozieJobId";
+	
+	public static final String OOZIE_JOB_LOG_LINE_TOKEN_SEPARATOR = ":";
+	
+	public static final String OOZIE_JOB_LOG_LINE_PREFIX = "job" + OOZIE_JOB_LOG_LINE_TOKEN_SEPARATOR;
+	
+	/**
+	 * @parameter expression="${properties.logFileLocation}"
+	 */
+	private String logFileLocation;
+	
+	/** @parameter default-value="${project}" */
+	private MavenProject project;
+	
+    @Override
+    public void execute() throws MojoExecutionException, MojoFailureException {
+		String extractedOozieJobId = extractOozieJobId(logFileLocation);
+		if (extractedOozieJobId!=null) {
+			project.getProperties().setProperty(PROPERTY_NAME_OOZIE_JOB_ID, 
+    				extractedOozieJobId);	
+			System.out.println("extracted job identifier: " + extractedOozieJobId);
+		} else {
+			throw new MojoFailureException("unable to extract oozie job identifier from log file: " + 
+					logFileLocation);
+		}
+    }
+    
+    /**
+     * Extracts oozie job identifier from log file
+     * @param logFileLocation
+     * @return extracted oozie job identifier
+     * @throws MojoExecutionException 
+     */
+    private String extractOozieJobId(String logFileLocation) throws MojoExecutionException {
+    	try {
+    		BufferedReader reader = new BufferedReader(new InputStreamReader(
+        			new FileInputStream(new File(logFileLocation))));
+    		String line;
+    		try {
+    			while ((line = reader.readLine())!=null) {
+    				String trimmedLine = line.trim();
+        			if (trimmedLine.startsWith(OOZIE_JOB_LOG_LINE_PREFIX)) {
+        				String[] split = StringUtils.split(trimmedLine, OOZIE_JOB_LOG_LINE_TOKEN_SEPARATOR);
+        				if (split.length == 2) {
+        					return split[1].trim();
+        				}
+        			}
+        		}
+    			return null;
+    		} finally {
+    			reader.close();	
+    		}
+    	} catch (FileNotFoundException e) {
+			throw new MojoExecutionException("unable to read log file: " + 
+					logFileLocation, e);
+    	} catch (IOException e) {
+    		throw new MojoExecutionException("error occurred when reading log file: " + 
+					logFileLocation, e);
+		}
+    }
+
+}

Property changes on: modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/src/main/java/eu/dnetlib/maven/plugin/oozie/ReadJobId.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/README.markdown
===================================================================
--- modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/README.markdown	(nonexistent)
+++ modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2/README.markdown	(revision 48428)
@@ -0,0 +1 @@
+Maven plugin module prepared for oozie communication required by test verification profile.
Index: modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2
===================================================================
--- modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2	(nonexistent)
+++ modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2	(revision 48428)

Property changes on: modules/icm-iis-oozie-maven-plugin/tags/icm-iis-oozie-maven-plugin-0.0.2
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,2 ##
+.*
+target
