diff --git a/dhp-build/dhp-build-assembly-resources/README.markdown b/dhp-build/dhp-build-assembly-resources/README.markdown
deleted file mode 100644
index efee5fa45..000000000
--- a/dhp-build/dhp-build-assembly-resources/README.markdown
+++ /dev/null
@@ -1,7 +0,0 @@
-Module utilized by `dhp-wf`.
-
-Contains all required resources by this parent module:
-
-* assembly XML definitions
-* build shell scripts
-* oozie package commands for uploading, running and monitoring oozie workflows
diff --git a/dhp-build/dhp-build-assembly-resources/pom.xml b/dhp-build/dhp-build-assembly-resources/pom.xml
deleted file mode 100644
index 2d2543505..000000000
--- a/dhp-build/dhp-build-assembly-resources/pom.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- 4.0.0
-
-
- eu.dnetlib.dhp
- dhp-build
- 1.0.0-SNAPSHOT
-
-
- dhp-build-assembly-resources
- jar
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
-
-
-
-
diff --git a/dhp-build/dhp-build-assembly-resources/src/main/resources/assemblies/oozie-installer.xml b/dhp-build/dhp-build-assembly-resources/src/main/resources/assemblies/oozie-installer.xml
deleted file mode 100644
index 1419c5b1c..000000000
--- a/dhp-build/dhp-build-assembly-resources/src/main/resources/assemblies/oozie-installer.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
- oozie-installer
-
- dir
-
-
-
-
- true
- ${project.build.directory}/assembly-resources/commands
-
- /
-
- **/*
-
- 0755
- unix
-
-
- /
-
diff --git a/dhp-build/dhp-build-assembly-resources/src/main/resources/assemblies/tests.xml b/dhp-build/dhp-build-assembly-resources/src/main/resources/assemblies/tests.xml
deleted file mode 100644
index bf679e652..000000000
--- a/dhp-build/dhp-build-assembly-resources/src/main/resources/assemblies/tests.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
- tests
-
- jar
-
- false
-
-
- ${project.build.testOutputDirectory}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/get_working_dir.sh b/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/get_working_dir.sh
deleted file mode 100644
index e9d55f0d7..000000000
--- a/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/get_working_dir.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-hadoop fs -get ${workingDir}
-
diff --git a/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/print_working_dir.sh b/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/print_working_dir.sh
deleted file mode 100644
index c79839ea4..000000000
--- a/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/print_working_dir.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-echo ""
-echo "---->Contents of the working directory"
-hadoop fs -ls ${workingDir}
-
diff --git a/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/readme.markdown b/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/readme.markdown
deleted file mode 100644
index 3e049c18b..000000000
--- a/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/readme.markdown
+++ /dev/null
@@ -1,5 +0,0 @@
-Execute the scripts in the following order:
-
-1. `upload_workflow.sh`
-2. `run_workflow.sh`
-3. `print_working_dir.sh` or `get_working_dir.sh`
diff --git a/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/run_workflow.sh b/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/run_workflow.sh
deleted file mode 100644
index fee3d7737..000000000
--- a/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/run_workflow.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-if [ $# = 0 ] ; then
- oozie job -oozie ${oozieServiceLoc} -config job.properties -run
-else
- oozie job -oozie ${oozieServiceLoc} -config $1/job.properties -run
-fi
-
-
-
diff --git a/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/upload_workflow.sh b/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/upload_workflow.sh
deleted file mode 100644
index c5d299c2f..000000000
--- a/dhp-build/dhp-build-assembly-resources/src/main/resources/commands/upload_workflow.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-exec 3>&1
-BASH_XTRACEFD=3
-set -x ## print every executed command
-
-
-if [ $# = 0 ] ; then
- target_dir_root=`pwd`'/${oozieAppDir}'
-else
- target_dir_root=`readlink -f $1`'/${oozieAppDir}'
-fi
-
-# initial phase, creating symbolic links to jars in all subworkflows
-# currently disabled
-#libDir=$target_dir_root'/lib'
-#dirs=`find $target_dir_root/* -maxdepth 10 -type d`
-#for dir in $dirs
-#do
-# if [ -f $dir/workflow.xml ]
-# then
-# echo "creating symbolic links to jars in directory: $dir/lib"
-# if [ ! -d "$dir/lib" ]; then
-# mkdir $dir/lib
-# fi
-# find $libDir -type f -exec ln -s \{\} $dir/lib \;
-# fi
-#done
-
-
-#uploading
-hadoop fs -rm -r ${sandboxDir}
-hadoop fs -mkdir -p ${sandboxDir}
-hadoop fs -mkdir -p ${workingDir}
-hadoop fs -put $target_dir_root ${sandboxDir}
diff --git a/dhp-build/dhp-build-assembly-resources/src/main/resources/project-default.properties b/dhp-build/dhp-build-assembly-resources/src/main/resources/project-default.properties
deleted file mode 100644
index 021ecf55b..000000000
--- a/dhp-build/dhp-build-assembly-resources/src/main/resources/project-default.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-#sandboxName when not provided explicitly will be generated
-sandboxName=${sandboxName}
-sandboxDir=/user/${iis.hadoop.frontend.user.name}/${sandboxName}
-workingDir=${sandboxDir}/working_dir
-oozie.wf.application.path = ${nameNode}${sandboxDir}/${oozieAppDir}
-oozieTopWfApplicationPath = ${oozie.wf.application.path}
-
diff --git a/dhp-build/dhp-build-assembly-resources/target/classes/assemblies/oozie-installer.xml b/dhp-build/dhp-build-assembly-resources/target/classes/assemblies/oozie-installer.xml
deleted file mode 100644
index 1419c5b1c..000000000
--- a/dhp-build/dhp-build-assembly-resources/target/classes/assemblies/oozie-installer.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
- oozie-installer
-
- dir
-
-
-
-
- true
- ${project.build.directory}/assembly-resources/commands
-
- /
-
- **/*
-
- 0755
- unix
-
-
- /
-
diff --git a/dhp-build/dhp-build-assembly-resources/target/classes/assemblies/tests.xml b/dhp-build/dhp-build-assembly-resources/target/classes/assemblies/tests.xml
deleted file mode 100644
index bf679e652..000000000
--- a/dhp-build/dhp-build-assembly-resources/target/classes/assemblies/tests.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
- tests
-
- jar
-
- false
-
-
- ${project.build.testOutputDirectory}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dhp-build/dhp-build-assembly-resources/target/classes/commands/get_working_dir.sh b/dhp-build/dhp-build-assembly-resources/target/classes/commands/get_working_dir.sh
deleted file mode 100644
index e9d55f0d7..000000000
--- a/dhp-build/dhp-build-assembly-resources/target/classes/commands/get_working_dir.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-hadoop fs -get ${workingDir}
-
diff --git a/dhp-build/dhp-build-assembly-resources/target/classes/commands/print_working_dir.sh b/dhp-build/dhp-build-assembly-resources/target/classes/commands/print_working_dir.sh
deleted file mode 100644
index c79839ea4..000000000
--- a/dhp-build/dhp-build-assembly-resources/target/classes/commands/print_working_dir.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-echo ""
-echo "---->Contents of the working directory"
-hadoop fs -ls ${workingDir}
-
diff --git a/dhp-build/dhp-build-assembly-resources/target/classes/commands/readme.markdown b/dhp-build/dhp-build-assembly-resources/target/classes/commands/readme.markdown
deleted file mode 100644
index 3e049c18b..000000000
--- a/dhp-build/dhp-build-assembly-resources/target/classes/commands/readme.markdown
+++ /dev/null
@@ -1,5 +0,0 @@
-Execute the scripts in the following order:
-
-1. `upload_workflow.sh`
-2. `run_workflow.sh`
-3. `print_working_dir.sh` or `get_working_dir.sh`
diff --git a/dhp-build/dhp-build-assembly-resources/target/classes/commands/run_workflow.sh b/dhp-build/dhp-build-assembly-resources/target/classes/commands/run_workflow.sh
deleted file mode 100644
index fee3d7737..000000000
--- a/dhp-build/dhp-build-assembly-resources/target/classes/commands/run_workflow.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-if [ $# = 0 ] ; then
- oozie job -oozie ${oozieServiceLoc} -config job.properties -run
-else
- oozie job -oozie ${oozieServiceLoc} -config $1/job.properties -run
-fi
-
-
-
diff --git a/dhp-build/dhp-build-assembly-resources/target/classes/commands/upload_workflow.sh b/dhp-build/dhp-build-assembly-resources/target/classes/commands/upload_workflow.sh
deleted file mode 100644
index c5d299c2f..000000000
--- a/dhp-build/dhp-build-assembly-resources/target/classes/commands/upload_workflow.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-exec 3>&1
-BASH_XTRACEFD=3
-set -x ## print every executed command
-
-
-if [ $# = 0 ] ; then
- target_dir_root=`pwd`'/${oozieAppDir}'
-else
- target_dir_root=`readlink -f $1`'/${oozieAppDir}'
-fi
-
-# initial phase, creating symbolic links to jars in all subworkflows
-# currently disabled
-#libDir=$target_dir_root'/lib'
-#dirs=`find $target_dir_root/* -maxdepth 10 -type d`
-#for dir in $dirs
-#do
-# if [ -f $dir/workflow.xml ]
-# then
-# echo "creating symbolic links to jars in directory: $dir/lib"
-# if [ ! -d "$dir/lib" ]; then
-# mkdir $dir/lib
-# fi
-# find $libDir -type f -exec ln -s \{\} $dir/lib \;
-# fi
-#done
-
-
-#uploading
-hadoop fs -rm -r ${sandboxDir}
-hadoop fs -mkdir -p ${sandboxDir}
-hadoop fs -mkdir -p ${workingDir}
-hadoop fs -put $target_dir_root ${sandboxDir}
diff --git a/dhp-build/dhp-build-assembly-resources/target/classes/project-default.properties b/dhp-build/dhp-build-assembly-resources/target/classes/project-default.properties
deleted file mode 100644
index 021ecf55b..000000000
--- a/dhp-build/dhp-build-assembly-resources/target/classes/project-default.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-#sandboxName when not provided explicitly will be generated
-sandboxName=${sandboxName}
-sandboxDir=/user/${iis.hadoop.frontend.user.name}/${sandboxName}
-workingDir=${sandboxDir}/working_dir
-oozie.wf.application.path = ${nameNode}${sandboxDir}/${oozieAppDir}
-oozieTopWfApplicationPath = ${oozie.wf.application.path}
-
diff --git a/dhp-build/dhp-build-properties-maven-plugin/README.markdown b/dhp-build/dhp-build-properties-maven-plugin/README.markdown
deleted file mode 100644
index f99c7c1b0..000000000
--- a/dhp-build/dhp-build-properties-maven-plugin/README.markdown
+++ /dev/null
@@ -1,6 +0,0 @@
-Maven plugin module utilized by `dhp-wf` for proper `job.properties` file building.
-
-It is based on http://site.kuali.org/maven/plugins/properties-maven-plugin/1.3.2/write-project-properties-mojo.html and supplemented with:
-
-* handling includePropertyKeysFromFiles property allowing writing only properties listed in given property files
-As a final outcome only properties listed in `` element and listed as a keys in files from `` element will be written to output file.
diff --git a/dhp-build/dhp-build-properties-maven-plugin/pom.xml b/dhp-build/dhp-build-properties-maven-plugin/pom.xml
deleted file mode 100644
index 38093f4d1..000000000
--- a/dhp-build/dhp-build-properties-maven-plugin/pom.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
- 4.0.0
-
-
- eu.dnetlib.dhp
- dhp-build
- 1.0.0-SNAPSHOT
-
-
- dhp-build-properties-maven-plugin
- maven-plugin
-
-
-
-
- org.apache.maven
- maven-plugin-api
- 2.0
-
-
- org.apache.maven
- maven-project
- 2.0
-
-
- org.kuali.maven.plugins
- properties-maven-plugin
- 1.3.2
-
-
-
-
-
- target
- target/classes
- ${project.artifactId}-${project.version}
- target/test-classes
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
-
- org.apache.maven.plugins
- maven-source-plugin
-
-
- attach-sources
- verify
-
- jar-no-fork
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
- true
-
-
-
-
-
-
diff --git a/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.java b/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.java
deleted file mode 100644
index a3a99cc0c..000000000
--- a/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package eu.dnetlib.maven.plugin.properties;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-/**
- * Generates oozie properties which were not provided from commandline.
- * @author mhorst
- *
- * @goal generate-properties
- */
-public class GenerateOoziePropertiesMojo extends AbstractMojo {
-
- public static final String PROPERTY_NAME_WF_SOURCE_DIR = "workflow.source.dir";
- public static final String PROPERTY_NAME_SANDBOX_NAME = "sandboxName";
-
- private final String[] limiters = {"iis", "dnetlib", "eu", "dhp"};
-
- @Override
- public void execute() throws MojoExecutionException, MojoFailureException {
- if (System.getProperties().containsKey(PROPERTY_NAME_WF_SOURCE_DIR) &&
- !System.getProperties().containsKey(PROPERTY_NAME_SANDBOX_NAME)) {
- String generatedSandboxName = generateSandboxName(System.getProperties().getProperty(
- PROPERTY_NAME_WF_SOURCE_DIR));
- if (generatedSandboxName!=null) {
- System.getProperties().setProperty(PROPERTY_NAME_SANDBOX_NAME,
- generatedSandboxName);
- } else {
- System.out.println("unable to generate sandbox name from path: " +
- System.getProperties().getProperty(PROPERTY_NAME_WF_SOURCE_DIR));
- }
- }
- }
-
- /**
- * Generates sandbox name from workflow source directory.
- * @param wfSourceDir
- * @return generated sandbox name
- */
- private String generateSandboxName(String wfSourceDir) {
-// utilize all dir names until finding one of the limiters
- List sandboxNameParts = new ArrayList();
- String[] tokens = StringUtils.split(wfSourceDir, File.separatorChar);
- ArrayUtils.reverse(tokens);
- if (tokens.length>0) {
- for (String token : tokens) {
- for (String limiter : limiters) {
- if (limiter.equals(token)) {
- return sandboxNameParts.size()>0?
- StringUtils.join(sandboxNameParts.toArray()):null;
- }
- }
- if (sandboxNameParts.size()>0) {
- sandboxNameParts.add(0, File.separator);
- }
- sandboxNameParts.add(0, token);
- }
- return StringUtils.join(sandboxNameParts.toArray());
- } else {
- return null;
- }
- }
-
-}
diff --git a/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.java b/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.java
deleted file mode 100644
index 62f04761a..000000000
--- a/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/**
- *
- * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
- *
- * 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 eu.dnetlib.maven.plugin.properties;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
-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.springframework.core.io.DefaultResourceLoader;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.ResourceLoader;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
-/**
- * Writes project properties for the keys listed in specified properties files.
- * Based on:
- * http://site.kuali.org/maven/plugins/properties-maven-plugin/1.3.2/write-project-properties-mojo.html
-
- * @author mhorst
- * @goal write-project-properties
- */
-public class WritePredefinedProjectProperties extends AbstractMojo {
-
- private static final String CR = "\r";
- private static final String LF = "\n";
- private static final String TAB = "\t";
- protected static final String PROPERTY_PREFIX_ENV = "env.";
- private static final String ENCODING_UTF8 = "utf8";
-
- /**
- * @parameter property="properties.includePropertyKeysFromFiles"
- */
- private String[] includePropertyKeysFromFiles;
-
- /**
- * @parameter default-value="${project}"
- * @required
- * @readonly
- */
- protected MavenProject project;
-
- /**
- * The file that properties will be written to
- *
- * @parameter property="properties.outputFile"
- * default-value="${project.build.directory}/properties/project.properties";
- * @required
- */
- protected File outputFile;
-
- /**
- * If true, the plugin will silently ignore any non-existent properties files, and the build will continue
- *
- * @parameter property="properties.quiet" default-value="true"
- */
- private boolean quiet;
-
- /**
- * Comma separated list of characters to escape when writing property values. cr=carriage return, lf=linefeed,
- * tab=tab. Any other values are taken literally.
- *
- * @parameter default-value="cr,lf,tab" property="properties.escapeChars"
- */
- private String escapeChars;
-
- /**
- * If true, the plugin will include system properties when writing the properties file. System properties override
- * both environment variables and project properties.
- *
- * @parameter default-value="false" property="properties.includeSystemProperties"
- */
- private boolean includeSystemProperties;
-
- /**
- * If true, the plugin will include environment variables when writing the properties file. Environment variables
- * are prefixed with "env". Environment variables override project properties.
- *
- * @parameter default-value="false" property="properties.includeEnvironmentVariables"
- */
- private boolean includeEnvironmentVariables;
-
- /**
- * Comma separated set of properties to exclude when writing the properties file
- *
- * @parameter property="properties.exclude"
- */
- private String exclude;
-
- /**
- * Comma separated set of properties to write to the properties file. If provided, only the properties matching
- * those supplied here will be written to the properties file.
- *
- * @parameter property="properties.include"
- */
- private String include;
-
- /* (non-Javadoc)
- * @see org.apache.maven.plugin.AbstractMojo#execute()
- */
- @Override
- @SuppressFBWarnings({"NP_UNWRITTEN_FIELD","UWF_UNWRITTEN_FIELD"})
- public void execute() throws MojoExecutionException, MojoFailureException {
- Properties properties = new Properties();
- // Add project properties
- properties.putAll(project.getProperties());
- if (includeEnvironmentVariables) {
- // Add environment variables, overriding any existing properties with the same key
- properties.putAll(getEnvironmentVariables());
- }
- if (includeSystemProperties) {
- // Add system properties, overriding any existing properties with the same key
- properties.putAll(System.getProperties());
- }
-
- // Remove properties as appropriate
- trim(properties, exclude, include);
-
- String comment = "# " + new Date() + "\n";
- List escapeTokens = getEscapeChars(escapeChars);
-
- getLog().info("Creating " + outputFile);
- writeProperties(outputFile, comment, properties, escapeTokens);
- }
-
- /**
- * Provides environment variables.
- * @return environment variables
- */
- protected static Properties getEnvironmentVariables() {
- Properties props = new Properties();
- for (Entry entry : System.getenv().entrySet()) {
- props.setProperty(PROPERTY_PREFIX_ENV + entry.getKey(), entry.getValue());
- }
- return props;
- }
-
- /**
- * Removes properties which should not be written.
- * @param properties
- * @param omitCSV
- * @param includeCSV
- * @throws MojoExecutionException
- */
- protected void trim(Properties properties, String omitCSV, String includeCSV) throws MojoExecutionException {
- List omitKeys = getListFromCSV(omitCSV);
- for (String key : omitKeys) {
- properties.remove(key);
- }
-
- List includeKeys = getListFromCSV(includeCSV);
-// mh: including keys from predefined properties
- if (includePropertyKeysFromFiles!=null && includePropertyKeysFromFiles.length>0) {
- for (String currentIncludeLoc : includePropertyKeysFromFiles) {
- if (validate(currentIncludeLoc)) {
- Properties p = getProperties(currentIncludeLoc);
- for (String key : p.stringPropertyNames()) {
- includeKeys.add(key);
- }
- }
- }
- }
- if (includeKeys!=null && !includeKeys.isEmpty()) {
-// removing only when include keys provided
- Set keys = properties.stringPropertyNames();
- for (String key : keys) {
- if (!includeKeys.contains(key)) {
- properties.remove(key);
- }
- }
- }
- }
-
- /**
- * Checks whether file exists.
- * @param location
- * @return true when exists, false otherwise.
- */
- protected boolean exists(String location) {
- if (StringUtils.isBlank(location)) {
- return false;
- }
- File file = new File(location);
- if (file.exists()) {
- return true;
- }
- ResourceLoader loader = new DefaultResourceLoader();
- Resource resource = loader.getResource(location);
- return resource.exists();
- }
-
- /**
- * Validates resource location.
- * @param location
- * @return true when valid, false otherwise
- * @throws MojoExecutionException
- */
- protected boolean validate(String location) throws MojoExecutionException {
- boolean exists = exists(location);
- if (exists) {
- return true;
- }
- if (quiet) {
- getLog().info("Ignoring non-existent properties file '" + location + "'");
- return false;
- } else {
- throw new MojoExecutionException("Non-existent properties file '" + location + "'");
- }
- }
-
- /**
- * Provides input stream.
- * @param location
- * @return input stream
- * @throws IOException
- */
- protected InputStream getInputStream(String location) throws IOException {
- File file = new File(location);
- if (file.exists()) {
- return new FileInputStream(location);
- }
- ResourceLoader loader = new DefaultResourceLoader();
- Resource resource = loader.getResource(location);
- return resource.getInputStream();
- }
-
- /**
- * Creates properties for given location.
- * @param location
- * @return properties for given location
- * @throws MojoExecutionException
- */
- protected Properties getProperties(String location) throws MojoExecutionException {
- InputStream in = null;
- try {
- Properties properties = new Properties();
- in = getInputStream(location);
- if (location.toLowerCase().endsWith(".xml")) {
- properties.loadFromXML(in);
- } else {
- properties.load(in);
- }
- return properties;
- } catch (IOException e) {
- throw new MojoExecutionException("Error reading properties file " + location, e);
- } finally {
- IOUtils.closeQuietly(in);
- }
- }
-
- /**
- * Provides escape characters.
- * @param escapeChars
- * @return escape characters
- */
- protected List getEscapeChars(String escapeChars) {
- List tokens = getListFromCSV(escapeChars);
- List realTokens = new ArrayList();
- for (String token : tokens) {
- String realToken = getRealToken(token);
- realTokens.add(realToken);
- }
- return realTokens;
- }
-
- /**
- * Provides real token.
- * @param token
- * @return real token
- */
- protected String getRealToken(String token) {
- if (token.equalsIgnoreCase("CR")) {
- return CR;
- } else if (token.equalsIgnoreCase("LF")) {
- return LF;
- } else if (token.equalsIgnoreCase("TAB")) {
- return TAB;
- } else {
- return token;
- }
- }
-
- /**
- * Returns content.
- * @param comment
- * @param properties
- * @param escapeTokens
- * @return content
- */
- protected String getContent(String comment, Properties properties, List escapeTokens) {
- List names = new ArrayList(properties.stringPropertyNames());
- Collections.sort(names);
- StringBuilder sb = new StringBuilder();
- if (!StringUtils.isBlank(comment)) {
- sb.append(comment);
- }
- for (String name : names) {
- String value = properties.getProperty(name);
- String escapedValue = escape(value, escapeTokens);
- sb.append(name + "=" + escapedValue + "\n");
- }
- return sb.toString();
- }
-
- /**
- * Writes properties to given file.
- * @param file
- * @param comment
- * @param properties
- * @param escapeTokens
- * @throws MojoExecutionException
- */
- protected void writeProperties(File file, String comment, Properties properties, List escapeTokens)
- throws MojoExecutionException {
- try {
- String content = getContent(comment, properties, escapeTokens);
- FileUtils.writeStringToFile(file, content, ENCODING_UTF8);
- } catch (IOException e) {
- throw new MojoExecutionException("Error creating properties file", e);
- }
- }
-
- /**
- * Escapes characters.
- * @param s
- * @param escapeChars
- * @return
- */
- protected String escape(String s, List escapeChars) {
- String result = s;
- for (String escapeChar : escapeChars) {
- result = result.replace(escapeChar, getReplacementToken(escapeChar));
- }
- return result;
- }
-
- /**
- * Provides replacement token.
- * @param escapeChar
- * @return replacement token
- */
- protected String getReplacementToken(String escapeChar) {
- if (escapeChar.equals(CR)) {
- return "\\r";
- } else if (escapeChar.equals(LF)) {
- return "\\n";
- } else if (escapeChar.equals(TAB)) {
- return "\\t";
- } else {
- return "\\" + escapeChar;
- }
- }
-
- /**
- * Returns list from csv.
- * @param csv
- * @return list of values generated from CSV
- */
- protected static final List getListFromCSV(String csv) {
- if (StringUtils.isBlank(csv)) {
- return new ArrayList();
- }
- List list = new ArrayList();
- String[] tokens = StringUtils.split(csv, ",");
- for (String token : tokens) {
- list.add(token.trim());
- }
- return list;
- }
-
- public void setIncludeSystemProperties(boolean includeSystemProperties) {
- this.includeSystemProperties = includeSystemProperties;
- }
-
- public void setEscapeChars(String escapeChars) {
- this.escapeChars = escapeChars;
- }
-
- public void setIncludeEnvironmentVariables(boolean includeEnvironmentVariables) {
- this.includeEnvironmentVariables = includeEnvironmentVariables;
- }
-
- public void setExclude(String exclude) {
- this.exclude = exclude;
- }
-
- public void setInclude(String include) {
- this.include = include;
- }
-
- public void setQuiet(boolean quiet) {
- this.quiet = quiet;
- }
-
- /**
- * Sets property files for which keys properties should be included.
- * @param includePropertyKeysFromFiles
- */
- public void setIncludePropertyKeysFromFiles(
- String[] includePropertyKeysFromFiles) {
- if (includePropertyKeysFromFiles!=null) {
- this.includePropertyKeysFromFiles = Arrays.copyOf(
- includePropertyKeysFromFiles,
- includePropertyKeysFromFiles.length);
- }
- }
-
-}
\ No newline at end of file
diff --git a/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojoTest.java b/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojoTest.java
deleted file mode 100644
index 8a763c1bd..000000000
--- a/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojoTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package eu.dnetlib.maven.plugin.properties;
-
-import static eu.dnetlib.maven.plugin.properties.GenerateOoziePropertiesMojo.PROPERTY_NAME_SANDBOX_NAME;
-import static eu.dnetlib.maven.plugin.properties.GenerateOoziePropertiesMojo.PROPERTY_NAME_WF_SOURCE_DIR;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @author mhorst
- *
- */
-public class GenerateOoziePropertiesMojoTest {
-
- private GenerateOoziePropertiesMojo mojo = new GenerateOoziePropertiesMojo();
-
- @Before
- public void clearSystemProperties() {
- System.clearProperty(PROPERTY_NAME_SANDBOX_NAME);
- System.clearProperty(PROPERTY_NAME_WF_SOURCE_DIR);
- }
-
- @Test
- public void testExecuteEmpty() throws Exception {
- // execute
- mojo.execute();
-
- // assert
- assertNull(System.getProperty(PROPERTY_NAME_SANDBOX_NAME));
- }
-
- @Test
- public void testExecuteSandboxNameAlreadySet() throws Exception {
- // given
- String workflowSourceDir = "eu/dnetlib/iis/wf/transformers";
- String sandboxName = "originalSandboxName";
- System.setProperty(PROPERTY_NAME_WF_SOURCE_DIR, workflowSourceDir);
- System.setProperty(PROPERTY_NAME_SANDBOX_NAME, sandboxName);
-
- // execute
- mojo.execute();
-
- // assert
- assertEquals(sandboxName, System.getProperty(PROPERTY_NAME_SANDBOX_NAME));
- }
-
- @Test
- public void testExecuteEmptyWorkflowSourceDir() throws Exception {
- // given
- String workflowSourceDir = "";
- System.setProperty(PROPERTY_NAME_WF_SOURCE_DIR, workflowSourceDir);
-
- // execute
- mojo.execute();
-
- // assert
- assertNull(System.getProperty(PROPERTY_NAME_SANDBOX_NAME));
- }
-
- @Test
- public void testExecuteNullSandboxNameGenerated() throws Exception {
- // given
- String workflowSourceDir = "eu/dnetlib/iis/";
- System.setProperty(PROPERTY_NAME_WF_SOURCE_DIR, workflowSourceDir);
-
- // execute
- mojo.execute();
-
- // assert
- assertNull(System.getProperty(PROPERTY_NAME_SANDBOX_NAME));
- }
-
- @Test
- public void testExecute() throws Exception {
- // given
- String workflowSourceDir = "eu/dnetlib/iis/wf/transformers";
- System.setProperty(PROPERTY_NAME_WF_SOURCE_DIR, workflowSourceDir);
-
- // execute
- mojo.execute();
-
- // assert
- assertEquals("wf/transformers", System.getProperty(PROPERTY_NAME_SANDBOX_NAME));
- }
-
- @Test
- public void testExecuteWithoutRoot() throws Exception {
- // given
- String workflowSourceDir = "wf/transformers";
- System.setProperty(PROPERTY_NAME_WF_SOURCE_DIR, workflowSourceDir);
-
- // execute
- mojo.execute();
-
- // assert
- assertEquals("wf/transformers", System.getProperty(PROPERTY_NAME_SANDBOX_NAME));
- }
-
-}
diff --git a/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectPropertiesTest.java b/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectPropertiesTest.java
deleted file mode 100644
index 51d9575ff..000000000
--- a/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectPropertiesTest.java
+++ /dev/null
@@ -1,365 +0,0 @@
-package eu.dnetlib.maven.plugin.properties;
-
-import static eu.dnetlib.maven.plugin.properties.WritePredefinedProjectProperties.PROPERTY_PREFIX_ENV;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.doReturn;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Properties;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.MavenProject;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
-
-
-/**
- * @author mhorst
- *
- */
-@RunWith(MockitoJUnitRunner.class)
-public class WritePredefinedProjectPropertiesTest {
-
- @Rule
- public TemporaryFolder testFolder = new TemporaryFolder();
-
- @Mock
- private MavenProject mavenProject;
-
- private WritePredefinedProjectProperties mojo;
-
- @Before
- public void init() {
- mojo = new WritePredefinedProjectProperties();
- mojo.outputFile = getPropertiesFileLocation();
- mojo.project = mavenProject;
- doReturn(new Properties()).when(mavenProject).getProperties();
- }
-
- // ----------------------------------- TESTS ---------------------------------------------
-
- @Test
- public void testExecuteEmpty() throws Exception {
- // execute
- mojo.execute();
-
- // assert
- assertTrue(mojo.outputFile.exists());
- Properties storedProperties = getStoredProperties();
- assertEquals(0, storedProperties.size());
- }
-
- @Test
- public void testExecuteWithProjectProperties() throws Exception {
- // given
- String key = "projectPropertyKey";
- String value = "projectPropertyValue";
- Properties projectProperties = new Properties();
- projectProperties.setProperty(key, value);
- doReturn(projectProperties).when(mavenProject).getProperties();
-
- // execute
- mojo.execute();
-
- // assert
- assertTrue(mojo.outputFile.exists());
- Properties storedProperties = getStoredProperties();
- assertEquals(1, storedProperties.size());
- assertTrue(storedProperties.containsKey(key));
- assertEquals(value, storedProperties.getProperty(key));
- }
-
- @Test(expected=MojoExecutionException.class)
- public void testExecuteWithProjectPropertiesAndInvalidOutputFile() throws Exception {
- // given
- String key = "projectPropertyKey";
- String value = "projectPropertyValue";
- Properties projectProperties = new Properties();
- projectProperties.setProperty(key, value);
- doReturn(projectProperties).when(mavenProject).getProperties();
- mojo.outputFile = testFolder.getRoot();
-
- // execute
- mojo.execute();
- }
-
- @Test
- public void testExecuteWithProjectPropertiesExclusion() throws Exception {
- // given
- String key = "projectPropertyKey";
- String value = "projectPropertyValue";
- String excludedKey = "excludedPropertyKey";
- String excludedValue = "excludedPropertyValue";
- Properties projectProperties = new Properties();
- projectProperties.setProperty(key, value);
- projectProperties.setProperty(excludedKey, excludedValue);
- doReturn(projectProperties).when(mavenProject).getProperties();
- mojo.setExclude(excludedKey);
-
- // execute
- mojo.execute();
-
- // assert
- assertTrue(mojo.outputFile.exists());
- Properties storedProperties = getStoredProperties();
- assertEquals(1, storedProperties.size());
- assertTrue(storedProperties.containsKey(key));
- assertEquals(value, storedProperties.getProperty(key));
- }
-
- @Test
- public void testExecuteWithProjectPropertiesInclusion() throws Exception {
- // given
- String key = "projectPropertyKey";
- String value = "projectPropertyValue";
- String includedKey = "includedPropertyKey";
- String includedValue = "includedPropertyValue";
- Properties projectProperties = new Properties();
- projectProperties.setProperty(key, value);
- projectProperties.setProperty(includedKey, includedValue);
- doReturn(projectProperties).when(mavenProject).getProperties();
- mojo.setInclude(includedKey);
-
- // execute
- mojo.execute();
-
- // assert
- assertTrue(mojo.outputFile.exists());
- Properties storedProperties = getStoredProperties();
- assertEquals(1, storedProperties.size());
- assertTrue(storedProperties.containsKey(includedKey));
- assertEquals(includedValue, storedProperties.getProperty(includedKey));
- }
-
- @Test
- public void testExecuteIncludingPropertyKeysFromFile() throws Exception {
- // given
- String key = "projectPropertyKey";
- String value = "projectPropertyValue";
- String includedKey = "includedPropertyKey";
- String includedValue = "includedPropertyValue";
- Properties projectProperties = new Properties();
- projectProperties.setProperty(key, value);
- projectProperties.setProperty(includedKey, includedValue);
- doReturn(projectProperties).when(mavenProject).getProperties();
-
- File includedPropertiesFile = new File(testFolder.getRoot(), "included.properties");
- Properties includedProperties = new Properties();
- includedProperties.setProperty(includedKey, "irrelevantValue");
- includedProperties.store(new FileWriter(includedPropertiesFile), null);
-
- mojo.setIncludePropertyKeysFromFiles(new String[] {includedPropertiesFile.getAbsolutePath()});
-
- // execute
- mojo.execute();
-
- // assert
- assertTrue(mojo.outputFile.exists());
- Properties storedProperties = getStoredProperties();
- assertEquals(1, storedProperties.size());
- assertTrue(storedProperties.containsKey(includedKey));
- assertEquals(includedValue, storedProperties.getProperty(includedKey));
- }
-
- @Test
- public void testExecuteIncludingPropertyKeysFromClasspathResource() throws Exception {
- // given
- String key = "projectPropertyKey";
- String value = "projectPropertyValue";
- String includedKey = "includedPropertyKey";
- String includedValue = "includedPropertyValue";
- Properties projectProperties = new Properties();
- projectProperties.setProperty(key, value);
- projectProperties.setProperty(includedKey, includedValue);
- doReturn(projectProperties).when(mavenProject).getProperties();
-
- mojo.setIncludePropertyKeysFromFiles(new String[] {"/eu/dnetlib/maven/plugin/properties/included.properties"});
-
- // execute
- mojo.execute();
-
- // assert
- assertTrue(mojo.outputFile.exists());
- Properties storedProperties = getStoredProperties();
- assertEquals(1, storedProperties.size());
- assertTrue(storedProperties.containsKey(includedKey));
- assertEquals(includedValue, storedProperties.getProperty(includedKey));
- }
-
- @Test(expected=MojoExecutionException.class)
- public void testExecuteIncludingPropertyKeysFromBlankLocation() throws Exception {
- // given
- String key = "projectPropertyKey";
- String value = "projectPropertyValue";
- String includedKey = "includedPropertyKey";
- String includedValue = "includedPropertyValue";
- Properties projectProperties = new Properties();
- projectProperties.setProperty(key, value);
- projectProperties.setProperty(includedKey, includedValue);
- doReturn(projectProperties).when(mavenProject).getProperties();
-
- mojo.setIncludePropertyKeysFromFiles(new String[] {""});
-
- // execute
- mojo.execute();
- }
-
- @Test
- public void testExecuteIncludingPropertyKeysFromXmlFile() throws Exception {
- // given
- String key = "projectPropertyKey";
- String value = "projectPropertyValue";
- String includedKey = "includedPropertyKey";
- String includedValue = "includedPropertyValue";
- Properties projectProperties = new Properties();
- projectProperties.setProperty(key, value);
- projectProperties.setProperty(includedKey, includedValue);
- doReturn(projectProperties).when(mavenProject).getProperties();
-
- File includedPropertiesFile = new File(testFolder.getRoot(), "included.xml");
- Properties includedProperties = new Properties();
- includedProperties.setProperty(includedKey, "irrelevantValue");
- includedProperties.storeToXML(new FileOutputStream(includedPropertiesFile), null);
-
- mojo.setIncludePropertyKeysFromFiles(new String[] {includedPropertiesFile.getAbsolutePath()});
-
- // execute
- mojo.execute();
-
- // assert
- assertTrue(mojo.outputFile.exists());
- Properties storedProperties = getStoredProperties();
- assertEquals(1, storedProperties.size());
- assertTrue(storedProperties.containsKey(includedKey));
- assertEquals(includedValue, storedProperties.getProperty(includedKey));
- }
-
- @Test(expected=MojoExecutionException.class)
- public void testExecuteIncludingPropertyKeysFromInvalidXmlFile() throws Exception {
- // given
- String key = "projectPropertyKey";
- String value = "projectPropertyValue";
- String includedKey = "includedPropertyKey";
- String includedValue = "includedPropertyValue";
- Properties projectProperties = new Properties();
- projectProperties.setProperty(key, value);
- projectProperties.setProperty(includedKey, includedValue);
- doReturn(projectProperties).when(mavenProject).getProperties();
-
- File includedPropertiesFile = new File(testFolder.getRoot(), "included.xml");
- Properties includedProperties = new Properties();
- includedProperties.setProperty(includedKey, "irrelevantValue");
- includedProperties.store(new FileOutputStream(includedPropertiesFile), null);
-
- mojo.setIncludePropertyKeysFromFiles(new String[] {includedPropertiesFile.getAbsolutePath()});
-
- // execute
- mojo.execute();
- }
-
- @Test
- public void testExecuteWithQuietModeOn() throws Exception {
- // given
- mojo.setQuiet(true);
- mojo.setIncludePropertyKeysFromFiles(new String[] {"invalid location"});
-
- // execute
- mojo.execute();
-
- // assert
- assertTrue(mojo.outputFile.exists());
- Properties storedProperties = getStoredProperties();
- assertEquals(0, storedProperties.size());
- }
-
- @Test(expected=MojoExecutionException.class)
- public void testExecuteIncludingPropertyKeysFromInvalidFile() throws Exception {
- // given
- mojo.setIncludePropertyKeysFromFiles(new String[] {"invalid location"});
-
- // execute
- mojo.execute();
- }
-
- @Test
- public void testExecuteWithEnvironmentProperties() throws Exception {
- // given
- mojo.setIncludeEnvironmentVariables(true);
-
- // execute
- mojo.execute();
-
- // assert
- assertTrue(mojo.outputFile.exists());
- Properties storedProperties = getStoredProperties();
- assertTrue(storedProperties.size() > 0);
- for (Object currentKey : storedProperties.keySet()) {
- assertTrue(((String)currentKey).startsWith(PROPERTY_PREFIX_ENV));
- }
- }
-
- @Test
- public void testExecuteWithSystemProperties() throws Exception {
- // given
- String key = "systemPropertyKey";
- String value = "systemPropertyValue";
- System.setProperty(key, value);
- mojo.setIncludeSystemProperties(true);
-
- // execute
- mojo.execute();
-
- // assert
- assertTrue(mojo.outputFile.exists());
- Properties storedProperties = getStoredProperties();
- assertTrue(storedProperties.size() > 0);
- assertTrue(storedProperties.containsKey(key));
- assertEquals(value, storedProperties.getProperty(key));
- }
-
- @Test
- public void testExecuteWithSystemPropertiesAndEscapeChars() throws Exception {
- // given
- String key = "systemPropertyKey ";
- String value = "systemPropertyValue";
- System.setProperty(key, value);
- mojo.setIncludeSystemProperties(true);
- String escapeChars = "cr,lf,tab,|";
- mojo.setEscapeChars(escapeChars);
-
- // execute
- mojo.execute();
-
- // assert
- assertTrue(mojo.outputFile.exists());
- Properties storedProperties = getStoredProperties();
- assertTrue(storedProperties.size() > 0);
- assertFalse(storedProperties.containsKey(key));
- assertTrue(storedProperties.containsKey(key.trim()));
- assertEquals(value, storedProperties.getProperty(key.trim()));
- }
-
- // ----------------------------------- PRIVATE -------------------------------------------
-
- private File getPropertiesFileLocation() {
- return new File(testFolder.getRoot(), "test.properties");
- }
-
- private Properties getStoredProperties() throws FileNotFoundException, IOException {
- Properties properties = new Properties();
- properties.load(new FileInputStream(getPropertiesFileLocation()));
- return properties;
- }
-}
diff --git a/dhp-build/dhp-build-properties-maven-plugin/src/test/resources/eu/dnetlib/maven/plugin/properties/included.properties b/dhp-build/dhp-build-properties-maven-plugin/src/test/resources/eu/dnetlib/maven/plugin/properties/included.properties
deleted file mode 100644
index 3c79fe6cb..000000000
--- a/dhp-build/dhp-build-properties-maven-plugin/src/test/resources/eu/dnetlib/maven/plugin/properties/included.properties
+++ /dev/null
@@ -1 +0,0 @@
-includedPropertyKey=irrelevantValue
\ No newline at end of file
diff --git a/dhp-build/dhp-build-properties-maven-plugin/target/classes/META-INF/maven/plugin.xml b/dhp-build/dhp-build-properties-maven-plugin/target/classes/META-INF/maven/plugin.xml
deleted file mode 100644
index 03188dc53..000000000
--- a/dhp-build/dhp-build-properties-maven-plugin/target/classes/META-INF/maven/plugin.xml
+++ /dev/null
@@ -1,281 +0,0 @@
-
-
- dhp-build-properties-maven-plugin
-
- eu.dnetlib.dhp
- dhp-build-properties-maven-plugin
- 1.0.0-SNAPSHOT
- dhp-build-properties
- false
- true
-
-
- generate-properties
- Generates oozie properties which were not provided from commandline.
- false
- true
- false
- false
- false
- true
- eu.dnetlib.maven.plugin.properties.GenerateOoziePropertiesMojo
- java
- per-lookup
- once-per-session
- false
-
-
-
- write-project-properties
- Writes project properties for the keys listed in specified properties files.
-Based on:
-http://site.kuali.org/maven/plugins/properties-maven-plugin/1.3.2/write-project-properties-mojo.html
- false
- true
- false
- false
- false
- true
- eu.dnetlib.maven.plugin.properties.WritePredefinedProjectProperties
- java
- per-lookup
- once-per-session
- false
-
-
- properties.escapeChars
- java.lang.String
- false
- true
- Comma separated list of characters to escape when writing property values. cr=carriage return, lf=linefeed,
-tab=tab. Any other values are taken literally.
-
-
- properties.exclude
- java.lang.String
- false
- true
- Comma separated set of properties to exclude when writing the properties file
-
-
- properties.include
- java.lang.String
- false
- true
- Comma separated set of properties to write to the properties file. If provided, only the properties matching
-those supplied here will be written to the properties file.
-
-
- properties.includeEnvironmentVariables
- boolean
- false
- true
- If true, the plugin will include environment variables when writing the properties file. Environment variables
-are prefixed with "env". Environment variables override project properties.
-
-
- properties.includePropertyKeysFromFiles
- java.lang.String[]
- false
- true
-
-
-
- properties.includeSystemProperties
- boolean
- false
- true
- If true, the plugin will include system properties when writing the properties file. System properties override
-both environment variables and project properties.
-
-
- properties.outputFile
- java.io.File
- true
- true
- The file that properties will be written to
-
-
- project
- org.apache.maven.project.MavenProject
- true
- false
-
-
-
- properties.quiet
- boolean
- false
- true
- If true, the plugin will silently ignore any non-existent properties files, and the build will continue
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.apache.maven
- maven-plugin-api
- jar
- 2.0
-
-
- org.apache.maven
- maven-project
- jar
- 2.0
-
-
- org.apache.maven
- maven-profile
- jar
- 2.0
-
-
- org.apache.maven
- maven-model
- jar
- 2.0
-
-
- org.apache.maven
- maven-artifact-manager
- jar
- 2.0
-
-
- org.apache.maven
- maven-repository-metadata
- jar
- 2.0
-
-
- org.apache.maven.wagon
- wagon-provider-api
- jar
- 1.0-alpha-5
-
-
- org.codehaus.plexus
- plexus-utils
- jar
- 1.0.4
-
-
- org.apache.maven
- maven-artifact
- jar
- 2.0
-
-
- org.codehaus.plexus
- plexus-container-default
- jar
- 1.0-alpha-8
-
-
- classworlds
- classworlds
- jar
- 1.1-alpha-2
-
-
- org.kuali.maven.plugins
- properties-maven-plugin
- jar
- 1.3.2
-
-
- org.springframework
- spring-core
- jar
- 3.1.1.RELEASE
-
-
- org.springframework
- spring-asm
- jar
- 3.1.1.RELEASE
-
-
- org.jasypt
- jasypt
- jar
- 1.9.0
-
-
- org.kuali.maven.common
- maven-kuali-common
- jar
- 1.2.8
-
-
- org.apache.ant
- ant
- jar
- 1.8.2
-
-
- org.apache.ant
- ant-launcher
- jar
- 1.8.2
-
-
- org.codehaus.plexus
- plexus-interpolation
- jar
- 1.15
-
-
- commons-lang
- commons-lang
- jar
- 2.6
-
-
- commons-io
- commons-io
- jar
- 2.5
-
-
- org.slf4j
- jcl-over-slf4j
- jar
- 1.6.4
-
-
- org.slf4j
- slf4j-api
- jar
- 1.7.22
-
-
- org.slf4j
- slf4j-log4j12
- jar
- 1.7.22
-
-
- log4j
- log4j
- jar
- 1.2.17
-
-
- javax.servlet
- javax.servlet-api
- jar
- 3.1.0
-
-
-
\ No newline at end of file
diff --git a/dhp-build/dhp-build-properties-maven-plugin/target/classes/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.class b/dhp-build/dhp-build-properties-maven-plugin/target/classes/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.class
deleted file mode 100644
index 3eeb323f7..000000000
Binary files a/dhp-build/dhp-build-properties-maven-plugin/target/classes/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.class and /dev/null differ
diff --git a/dhp-build/dhp-build-properties-maven-plugin/target/classes/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.class b/dhp-build/dhp-build-properties-maven-plugin/target/classes/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.class
deleted file mode 100644
index e09929dea..000000000
Binary files a/dhp-build/dhp-build-properties-maven-plugin/target/classes/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.class and /dev/null differ
diff --git a/dhp-build/dhp-build-properties-maven-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/dhp-build/dhp-build-properties-maven-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
deleted file mode 100644
index 5c141f830..000000000
--- a/dhp-build/dhp-build-properties-maven-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
+++ /dev/null
@@ -1,2 +0,0 @@
-eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.class
-eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.class
diff --git a/dhp-build/dhp-build-properties-maven-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/dhp-build/dhp-build-properties-maven-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
deleted file mode 100644
index cac9348aa..000000000
--- a/dhp-build/dhp-build-properties-maven-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ /dev/null
@@ -1,2 +0,0 @@
-/Users/claudio/workspace/dnet-hadoop/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.java
-/Users/claudio/workspace/dnet-hadoop/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.java
diff --git a/dhp-build/pom.xml b/dhp-build/pom.xml
index a930af4ea..bc95d979a 100644
--- a/dhp-build/pom.xml
+++ b/dhp-build/pom.xml
@@ -9,8 +9,7 @@
dhp-buildpom
- dhp-build-assembly-resources
- dhp-build-properties-maven-plugin
+
diff --git a/dhp-collector-worker/pom.xml b/dhp-collector-worker/pom.xml
index aa0e1c917..e187d86f1 100644
--- a/dhp-collector-worker/pom.xml
+++ b/dhp-collector-worker/pom.xml
@@ -3,13 +3,15 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- dhp
- eu.dnetlib.dhp
- 1.0.0-SNAPSHOT
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.1.3.RELEASE4.0.0
+ eu.dnetlibdhp-collector-worker
+ 1.0.0
diff --git a/dhp-collector-worker/src/main/java/eu/dnetlib/collector/worker/DnetCollectorWorkerApplication.java b/dhp-collector-worker/src/main/java/eu/dnetlib/collector/worker/DnetCollectorWorkerApplication.java
index b10f11c5f..a0fb1a4d4 100644
--- a/dhp-collector-worker/src/main/java/eu/dnetlib/collector/worker/DnetCollectorWorkerApplication.java
+++ b/dhp-collector-worker/src/main/java/eu/dnetlib/collector/worker/DnetCollectorWorkerApplication.java
@@ -1,5 +1,12 @@
package eu.dnetlib.collector.worker;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import eu.dnetlib.collector.worker.model.ApiDescriptor;
+import eu.dnetlib.collector.worker.plugins.CollectorPlugin;
+import eu.dnetlib.collector.worker.utils.CollectorPluginEnumerator;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.SequenceFile;
import org.apache.hadoop.io.Text;
@@ -10,21 +17,21 @@ import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import eu.dnetlib.collector.worker.model.ApiDescriptor;
-import eu.dnetlib.collector.worker.plugins.CollectorPlugin;
-import eu.dnetlib.collector.worker.utils.CollectorPluginEnumerator;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FSDataOutputStream;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-
import java.io.IOException;
import java.net.URI;
import java.util.concurrent.atomic.AtomicInteger;
-import java.util.stream.Stream;
+
+/**
+ *
+ * DnetCollectortWorkerApplication is the main class responsible to start
+ * the Dnet Collection into HDFS.
+ * This module will be executed on the hadoop cluster and taking in input some parameters
+ * that tells it which is the right collector plugin to use and where store the data into HDFS path
+ *
+ *
+ * @author Sandro La Bruzzo
+ */
@SpringBootApplication
public class DnetCollectorWorkerApplication implements CommandLineRunner {
@@ -42,7 +49,9 @@ public class DnetCollectorWorkerApplication implements CommandLineRunner {
}
/**
- *
+ * This module expect two arguments:
+ * path hdfs where store the sequential file.
+ * Json serialization of {@link ApiDescriptor}
*/
@Override
public void run(final String... args) throws Exception {
@@ -70,12 +79,9 @@ public class DnetCollectorWorkerApplication implements CommandLineRunner {
// Because of Maven
conf.set("fs.hdfs.impl", org.apache.hadoop.hdfs.DistributedFileSystem.class.getName());
conf.set("fs.file.impl", org.apache.hadoop.fs.LocalFileSystem.class.getName());
- // Set HADOOP user
- System.setProperty("HADOOP_USER_NAME", "sandro.labruzzo");
System.setProperty("hadoop.home.dir", "/");
//Get the filesystem - HDFS
FileSystem fs = FileSystem.get(URI.create(hdfsuri), conf);
-
Path hdfswritepath = new Path(hdfsPath);
log.info("Created path "+hdfswritepath.toString());
diff --git a/dhp-common/pom.xml b/dhp-common/pom.xml
index 42b8864fa..51db097b7 100644
--- a/dhp-common/pom.xml
+++ b/dhp-common/pom.xml
@@ -15,163 +15,10 @@
-
- ${project.groupId}
- dhp-schemas
- ${project.version}
-
-
- org.apache.oozie
- oozie-core
- provided
-
-
-
- org.apache.hadoop
- hadoop-mapreduce-client-core
-
-
-
- org.apache.hadoop
- hadoop-common
-
-
-
- org.apache.spark
- spark-core_2.10
-
-
-
- org.apache.spark
- spark-sql_2.10
-
-
-
- org.apache.avro
- avro
-
-
-
- org.apache.avro
- avro-mapred
- hadoop2
-
-
-
- org.apache.commons
- commons-lang3
-
-
-
-
- org.springframework
- spring-beans
-
-
-
- com.beust
- jcommander
-
-
-
- org.apache.pig
- pig
-
-
-
- com.linkedin.datafu
- datafu
-
-
-
- commons-beanutils
- commons-beanutils
-
-
-
- commons-io
- commons-io
-
-
-
- org.jdom
- jdom
-
-
-
-
- net.alchim31.maven
- scala-maven-plugin
-
-
-
- org.apache.avro
- avro-maven-plugin
-
-
- generate-test-sources
-
- schema
- idl-protocol
-
-
- String
-
-
-
-
-
-
- org.codehaus.mojo
- build-helper-maven-plugin
-
-
- add-test-sources
- generate-test-sources
-
- add-test-source
-
-
-
-
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
-
- test-jar
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- eu.dnetlib.iis.common.IntegrationTest
-
-
-
-
- org.apache.maven.plugins
- maven-failsafe-plugin
-
-
-
-
diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/FsShellPermissions.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/FsShellPermissions.java
deleted file mode 100644
index 7fbcd8fef..000000000
--- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/FsShellPermissions.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package eu.dnetlib.dhp.common;
-
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.LinkedList;
-
-import org.apache.hadoop.conf.Configurable;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.FsShell;
-import org.springframework.beans.BeanUtils;
-import org.springframework.util.ClassUtils;
-import org.springframework.util.ReflectionUtils;
-
-/**
- * Extracted from:
- * https://github.com/spring-projects/spring-hadoop/blob/master/spring-hadoop-core/src/main/java/org/springframework/data/hadoop/fs/FsShellPermissions.java
- *
- * Utility class for accessing Hadoop FsShellPermissions (which is not public)
- * without having to duplicate its code.
- * @author Costin Leau
- *
- */
-public class FsShellPermissions {
-
- private static boolean IS_HADOOP_20X = ClassUtils.isPresent("org.apache.hadoop.fs.FsShellPermissions$Chmod",
- FsShellPermissions.class.getClassLoader());
-
- public enum Op {
- CHOWN("-chown"), CHMOD("-chmod"), CHGRP("-chgrp");
-
- private final String cmd;
-
- Op(String cmd) {
- this.cmd = cmd;
- }
-
- public String getCmd() {
- return cmd;
- }
- }
-
- // TODO: move this into Spring Core (but add JDK 1.5 compatibility first)
- @SafeVarargs
- static T[] concatAll(T[] first, T[]... rest) {
- // can add some sanity checks
- int totalLength = first.length;
- for (T[] array : rest) {
- totalLength += array.length;
- }
- T[] result = Arrays.copyOf(first, totalLength);
- int offset = first.length;
- for (T[] array : rest) {
- System.arraycopy(array, 0, result, offset, array.length);
- offset += array.length;
- }
- return result;
- }
-
- public static void changePermissions(FileSystem fs, Configuration config,
- Op op, boolean recursive, String group, String uri) {
- changePermissions(fs, config, op, recursive, group, new String[] {uri});
- }
-
- public static void changePermissions(FileSystem fs, Configuration config,
- Op op, boolean recursive, String group, String... uris) {
- String[] argvs;
- if (recursive) {
- argvs = new String[1];
- argvs[0] = "-R";
- } else {
- argvs = new String[0];
- }
- argvs = concatAll(argvs, new String[] { group }, uris);
-
- // Hadoop 1.0.x
- if (!IS_HADOOP_20X) {
- Class> cls = ClassUtils.resolveClassName("org.apache.hadoop.fs.FsShellPermissions", config.getClass().getClassLoader());
- Object[] args = new Object[] { fs, op.getCmd(), argvs, 0, new FsShell(config) };
-
- Method m = ReflectionUtils.findMethod(cls, "changePermissions", FileSystem.class, String.class, String[].class, int.class, FsShell.class);
- ReflectionUtils.makeAccessible(m);
- ReflectionUtils.invokeMethod(m, null, args);
- }
- // Hadoop 2.x
- else {
- Class> cmd = ClassUtils.resolveClassName("org.apache.hadoop.fs.shell.Command", config.getClass().getClassLoader());
- Class> targetClz = ClassUtils.resolveClassName("org.apache.hadoop.fs.FsShellPermissions$Chmod", config.getClass().getClassLoader());
- Configurable target = (Configurable) BeanUtils.instantiate(targetClz);
- target.setConf(config);
- // run(String...) swallows the exceptions - re-implement it here
- //
- LinkedList args = new LinkedList(Arrays.asList(argvs));
- try {
- Method m = ReflectionUtils.findMethod(cmd, "processOptions", LinkedList.class);
- ReflectionUtils.makeAccessible(m);
- ReflectionUtils.invokeMethod(m, target, args);
- m = ReflectionUtils.findMethod(cmd, "processRawArguments", LinkedList.class);
- ReflectionUtils.makeAccessible(m);
- ReflectionUtils.invokeMethod(m, target, args);
- } catch (IllegalStateException ex){
- throw new RuntimeException("Cannot change permissions/ownership " + ex);
- }
- }
- }
-}
diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/InfoSpaceConstants.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/InfoSpaceConstants.java
deleted file mode 100644
index 1ce7cd426..000000000
--- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/InfoSpaceConstants.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package eu.dnetlib.dhp.common;
-
-import java.io.UnsupportedEncodingException;
-
-/**
- * InfoSpaceConstants constants.
- *
- * @author mhorst
- *
- */
-public final class InfoSpaceConstants {
-
- public static final float CONFIDENCE_TO_TRUST_LEVEL_FACTOR = 0.9f;
-
- public static final String ENCODING_UTF8 = "utf-8";
-
- public static final char ROW_PREFIX_SEPARATOR = '|';
-
- public static final String ID_NAMESPACE_SEPARATOR = "::";
- public static final String CLASSIFICATION_HIERARCHY_SEPARATOR = ID_NAMESPACE_SEPARATOR;
- public static final String INFERENCE_PROVENANCE_SEPARATOR = ID_NAMESPACE_SEPARATOR;
-
- public static final String ROW_PREFIX_RESULT = "50|";
- public static final String ROW_PREFIX_PROJECT = "40|";
- public static final String ROW_PREFIX_PERSON = "30|";
- public static final String ROW_PREFIX_ORGANIZATION = "20|";
- public static final String ROW_PREFIX_DATASOURCE = "10|";
-
- public static final String QUALIFIER_BODY_STRING = "body";
- public static final byte[] QUALIFIER_BODY;
-
- public static final String SEMANTIC_CLASS_MAIN_TITLE = "main title";
- public static final String SEMANTIC_CLASS_PUBLICATION = "publication";
- public static final String SEMANTIC_CLASS_UNKNOWN = "UNKNOWN";
-
- public static final String SEMANTIC_SCHEME_DNET_PERSON_ROLES = "dnet:personroles";
- public static final String SEMANTIC_SCHEME_DNET_RELATIONS_RESULT_RESULT = "dnet:result_result_relations";
- public static final String SEMANTIC_SCHEME_DNET_RELATIONS_RESULT_PROJECT = "dnet:result_project_relations";
-
- public static final String SEMANTIC_SCHEME_DNET_TITLE = "dnet:dataCite_title";
- public static final String SEMANTIC_SCHEME_DNET_TITLE_TYPOLOGIES = "dnet:title_typologies";
- public static final String SEMANTIC_SCHEME_DNET_RESULT_TYPOLOGIES = "dnet:result_typologies";
- public static final String SEMANTIC_SCHEME_DNET_PROVENANCE_ACTIONS = "dnet:provenanceActions";
- public static final String SEMANTIC_SCHEME_DNET_LANGUAGES = "dnet:languages";
- public static final String SEMANTIC_SCHEME_DNET_PID_TYPES = "dnet:pid_types";
- public static final String SEMANTIC_SCHEME_DNET_CLASSIFICATION_TAXONOMIES = "dnet:subject_classification_typologies";
-
- // resultResult citation and similarity related
- public static final String SEMANTIC_SCHEME_DNET_DATASET_PUBLICATION_RELS = "dnet:dataset_publication_rels";
-
- public static final String SEMANTIC_CLASS_TAXONOMIES_ARXIV = "arxiv";
- public static final String SEMANTIC_CLASS_TAXONOMIES_WOS = "wos";
- public static final String SEMANTIC_CLASS_TAXONOMIES_DDC = "ddc";
- public static final String SEMANTIC_CLASS_TAXONOMIES_MESHEUROPMC = "mesheuropmc";
- public static final String SEMANTIC_CLASS_TAXONOMIES_ACM = "acm";
-
- public static final String EXTERNAL_ID_TYPE_INSTANCE_URL = "dnet:instance-url";
- public static final String EXTERNAL_ID_TYPE_UNKNOWN = "unknown";
-
- // publication types class ids
- public static final String SEMANTIC_CLASS_INSTANCE_TYPE_ARTICLE = "0001";
- public static final String SEMANTIC_CLASS_INSTANCE_TYPE_DATASET = "0021";
-
- static {
- try {
- QUALIFIER_BODY = QUALIFIER_BODY_STRING.getBytes(ENCODING_UTF8);
-
- } catch (UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
- }
-
- private InfoSpaceConstants() {
- }
-}
diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/WorkflowRuntimeParameters.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/WorkflowRuntimeParameters.java
deleted file mode 100644
index e71d69027..000000000
--- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/WorkflowRuntimeParameters.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package eu.dnetlib.dhp.common;
-
-import java.util.Map;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.hadoop.conf.Configuration;
-
-/**
- * Utility class holding parameter names and method simplifying access to parameters from hadoop context.
- * @author mhorst
- *
- */
-public final class WorkflowRuntimeParameters {
-
- public static final String OOZIE_ACTION_OUTPUT_FILENAME = "oozie.action.output.properties";
-
- public static final char DEFAULT_CSV_DELIMITER = ',';
-
- public static final String UNDEFINED_NONEMPTY_VALUE = "$UNDEFINED$";
-
- // default values
- public static final String DNET_SERVICE_READ_TIMEOUT_DEFAULT_VALUE = "60000";
- public static final String DNET_SERVICE_CONNECTION_TIMEOUT_DEFAULT_VALUE = "60000";
- // parameter names
- public static final String DNET_SERVICE_CLIENT_READ_TIMEOUT = "dnet.service.client.read.timeout";
- public static final String DNET_SERVICE_CLIENT_CONNECTION_TIMEOUT = "dnet.service.client.connection.timeout";
-
- // ----------------- CONSTRUCTORS -----------------------------
-
- private WorkflowRuntimeParameters() {}
-
- /**
- * Retrieves parameter from hadoop context configuration when set to value different than {@link WorkflowRuntimeParameters#UNDEFINED_NONEMPTY_VALUE}.
- */
- public static String getParamValue(String paramName, Configuration configuration) {
- String paramValue = configuration.get(paramName);
- if (StringUtils.isNotBlank(paramValue) && !UNDEFINED_NONEMPTY_VALUE.equals(paramValue)) {
- return paramValue;
- } else {
- return null;
- }
- }
-
- /**
- * Retrieves {@link Integer} parameter from hadoop context configuration when set to non-empty value different than {@link WorkflowRuntimeParameters#UNDEFINED_NONEMPTY_VALUE}.
- * Null is returned when parameter was not set.
- * @throws {@link NumberFormatException} if parameter value does not contain a parsable integer
- */
- public static Integer getIntegerParamValue(String paramName, Configuration configuration) throws NumberFormatException {
- String paramValue = getParamValue(paramName, configuration);
- return paramValue!=null?Integer.valueOf(paramValue):null;
- }
-
- /**
- * Retrieves parameter from hadoop context configuration when set to value different than {@link WorkflowRuntimeParameters#UNDEFINED_NONEMPTY_VALUE}.
- * If requested parameter was not set, fallback parameter is retrieved using the same logic.
- */
- public static String getParamValue(String paramName, String fallbackParamName, Configuration configuration) {
- String resultCandidate = getParamValue(paramName, configuration);
- return resultCandidate!=null?resultCandidate:getParamValue(fallbackParamName, configuration);
- }
-
- /**
- * Provides parameter value. Returns default value when entry not found among parameters.
- *
- * @param paramName parameter name
- * @param defaultValue parameter default value to be returned when entry not found among parameters
- * @param parameters map of parameters
- */
- public static String getParamValue(String paramName, String defaultValue, Map parameters) {
- return parameters.containsKey(paramName)?parameters.get(paramName):defaultValue;
- }
-
-}
diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/counter/NamedCounters.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/counter/NamedCounters.java
deleted file mode 100644
index 5b37d31f1..000000000
--- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/counter/NamedCounters.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package eu.dnetlib.dhp.common.counter;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Map;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Maps;
-
-/**
- * Class that groups several counters which are identified by name (String value).
- *
- * @author madryk
- */
-public class NamedCounters implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
-
- private final Map counters;
-
-
- //------------------------ CONSTRUCTORS --------------------------
-
- /**
- * Creates {@link NamedCounters} with empty initial counters.
- */
- public NamedCounters() {
- this.counters = Maps.newHashMap();
- }
-
- /**
- * Creates {@link NamedCounters} with initial counters.
- * Starting value of initial counters is zero.
- *
- * @param initialCounterNames - names of initial counters
- */
- public NamedCounters(String[] initialCounterNames) {
- Preconditions.checkNotNull(initialCounterNames);
-
- this.counters = Maps.newHashMap();
-
- for (String initialCounterName : initialCounterNames) {
- this.counters.put(initialCounterName, 0L);
- }
- }
-
- /**
- * Creates {@link NamedCounters} with initial counters.
- * Starting value of initial counters is zero.
- *
- * @param initialCounterNamesEnumClass - enum class providing names of initial counters
- */
- public > NamedCounters(Class initialCounterNamesEnumClass) {
- Preconditions.checkNotNull(initialCounterNamesEnumClass);
-
- this.counters = Maps.newHashMap();
- Enum>[] enumConstants = initialCounterNamesEnumClass.getEnumConstants();
-
- for (int i=0; i
- * Internally uses {@link #increment(String, Long)}
- */
- public void increment(String counterName) {
- increment(counterName, 1L);
- }
-
- /**
- * Increments value of a counter with the name specified as parameter by the given value.
- * If current instance of {@link NamedCounters} does not contain counter
- * with provided name, then before incrementing counter will be created with starting
- * value equal to zero.
- */
- public void increment(String counterName, Long incrementValue) {
-
- long oldValue = counters.getOrDefault(counterName, 0L);
- counters.put(counterName, oldValue + incrementValue);
- }
-
- /**
- * Returns current value of a counter with the name specified as parameter.
- *
- * @throws IllegalArgumentException when {@link NamedCounters} does not contain counter
- * with provided name
- */
- public long currentValue(String counterName) {
-
- if (!counters.containsKey(counterName)) {
- throw new IllegalArgumentException("Couldn't find counter with name: " + counterName);
- }
-
- return counters.get(counterName);
- }
-
- /**
- * Returns names of currently tracked counters.
- */
- public Collection counterNames() {
- return counters.keySet();
- }
-
-}
diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/counter/NamedCountersAccumulableParam.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/counter/NamedCountersAccumulableParam.java
deleted file mode 100644
index 6686432dd..000000000
--- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/counter/NamedCountersAccumulableParam.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package eu.dnetlib.dhp.common.counter;
-
-import org.apache.spark.AccumulableParam;
-
-import scala.Tuple2;
-
-/**
- * Spark {@link AccumulableParam} for tracking multiple counter values using {@link NamedCounters}.
- *
- * @author madryk
- */
-public class NamedCountersAccumulableParam implements AccumulableParam> {
-
- private static final long serialVersionUID = 1L;
-
-
- //------------------------ LOGIC --------------------------
-
- /**
- * Increments {@link NamedCounters} counter with the name same as the first element of passed incrementValue tuple
- * by value defined in the second element of incrementValue tuple.
- */
- @Override
- public NamedCounters addAccumulator(NamedCounters counters, Tuple2 incrementValue) {
- counters.increment(incrementValue._1, incrementValue._2);
- return counters;
- }
-
- /**
- * Merges two passed {@link NamedCounters}.
- */
- @Override
- public NamedCounters addInPlace(NamedCounters counters1, NamedCounters counters2) {
- for (String counterName2 : counters2.counterNames()) {
- counters1.increment(counterName2, counters2.currentValue(counterName2));
- }
- return counters1;
- }
-
- /**
- * Returns passed initialCounters value without any modifications.
- */
- @Override
- public NamedCounters zero(NamedCounters initialCounters) {
- return initialCounters;
- }
-
-}
diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/counter/NamedCountersFileWriter.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/counter/NamedCountersFileWriter.java
deleted file mode 100644
index bebb82b6e..000000000
--- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/counter/NamedCountersFileWriter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package eu.dnetlib.dhp.common.counter;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Properties;
-
-/**
- * Writer of {@link NamedCounters} object into a properties file.
- *
- * @author madryk
- */
-public class NamedCountersFileWriter {
-
-
- //------------------------ LOGIC --------------------------
-
- /**
- * Writes {@link NamedCounters} as a properties file located under
- * provided filePath.
- *
- * @throws IOException if writing to properties file resulted in an error
- */
- public void writeCounters(NamedCounters counters, String filePath) throws IOException {
-
- Properties counterProperties = buildPropertiesFromCounters(counters);
-
- File file = new File(filePath);
- try (OutputStream os = new FileOutputStream(file)) {
-
- counterProperties.store(os, null);
-
- }
-
- }
-
-
- //------------------------ PRIVATE --------------------------
-
- private Properties buildPropertiesFromCounters(NamedCounters counters) {
-
- Properties properties = new Properties();
-
- for (String counterName : counters.counterNames()) {
- long count = counters.currentValue(counterName);
- properties.put(counterName, String.valueOf(count));
- }
-
- return properties;
- }
-}
diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/fault/FaultUtils.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/fault/FaultUtils.java
deleted file mode 100644
index bcc6494b2..000000000
--- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/fault/FaultUtils.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package eu.dnetlib.dhp.common.fault;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import eu.dnetlib.dhp.audit.schemas.Cause;
-import eu.dnetlib.dhp.audit.schemas.Fault;
-
-/**
- * {@link Fault} related utilities.
- * @author mhorst
- *
- */
-public final class FaultUtils {
-
- // ---------------------- CONSTRUCTORS -------------------
-
- private FaultUtils() {}
-
- // ---------------------- LOGIC --------------------------
-
- /**
- * Generates {@link Fault} instance based on {@link Throwable}.
- * @param entityId entity identifier
- * @param throwable
- * @param auditSupplementaryData
- * @return {@link Fault} instance generated for {@link Throwable}
- */
- public static Fault exceptionToFault(CharSequence entityId, Throwable throwable,
- Map auditSupplementaryData) {
- Fault.Builder faultBuilder = Fault.newBuilder();
- faultBuilder.setInputObjectId(entityId);
- faultBuilder.setTimestamp(System.currentTimeMillis());
- faultBuilder.setCode(throwable.getClass().getName());
- faultBuilder.setMessage(throwable.getMessage());
- StringWriter strWriter = new StringWriter();
- PrintWriter pw = new PrintWriter(strWriter);
- throwable.printStackTrace(pw);
- pw.close();
- faultBuilder.setStackTrace(strWriter.toString());
- if (throwable.getCause()!=null) {
- faultBuilder.setCauses(appendThrowableToCauses(
- throwable.getCause(), new ArrayList()));
- }
- if (auditSupplementaryData!=null && !auditSupplementaryData.isEmpty()) {
- faultBuilder.setSupplementaryData(auditSupplementaryData);
- }
- return faultBuilder.build();
- }
-
- protected static List appendThrowableToCauses(Throwable e, List causes) {
- Cause.Builder causeBuilder = Cause.newBuilder();
- causeBuilder.setCode(e.getClass().getName());
- causeBuilder.setMessage(e.getMessage());
- causes.add(causeBuilder.build());
- if (e.getCause()!=null) {
- return appendThrowableToCauses(
- e.getCause(),causes);
- } else {
- return causes;
- }
- }
-
-}
diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/java/CmdLineParser.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/java/CmdLineParser.java
deleted file mode 100644
index b6106044b..000000000
--- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/java/CmdLineParser.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package eu.dnetlib.dhp.common.java;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.GnuParser;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.commons.lang3.StringUtils;
-
-/**
- *
- * @author Mateusz Kobos
- *
- */
-@SuppressWarnings("deprecation")
-public final class CmdLineParser {
- /** HACK: make the names of various types of parameters of the program
- * more readable, e.g. "--Input_person=..." instead of "-Iperson=...",
- * "--Output_merged=..." instead of "-Omerged=...". I wasn't able to
- * get such notation so far using the Apache CLI. */
- public static final String constructorPrefix = "C";
- public static final String inputPrefix = "I";
- public static final String outputPrefix = "O";
- public static final String specialParametersPrefix = "S";
- /** HACK: This field should be removed since this list of special
- * parameters is empty, thus not used anywhere.*/
- public static final String[] mandatorySpecialParameters = new String[]{};
- public static final String processParametersPrefix = "P";
-
- // ------------------------- CONSTRUCTORS ------------------------------
-
- private CmdLineParser() {}
-
- // ------------------------- LOGIC -------------------------------------
-
- public static CommandLine parse(String[] args) {
- Options options = new Options();
- @SuppressWarnings("static-access")
- Option constructorParams = OptionBuilder.withArgName("STRING")
- .hasArg()
- .withDescription("Constructor parameter")
- .withLongOpt("ConstructorParam")
- .create(constructorPrefix);
- options.addOption(constructorParams);
- @SuppressWarnings("static-access")
- Option inputs = OptionBuilder.withArgName("portName=URI")
- .hasArgs(2)
- .withValueSeparator()
- .withDescription("Path binding for a given input port")
- .withLongOpt("Input")
- .create(inputPrefix);
- options.addOption(inputs);
- @SuppressWarnings("static-access")
- Option outputs = OptionBuilder.withArgName("portName=URI")
- .hasArgs(2)
- .withValueSeparator()
- .withDescription("Path binding for a given output port")
- .create(outputPrefix);
- options.addOption(outputs);
- @SuppressWarnings("static-access")
- Option specialParameter = OptionBuilder.withArgName("parameter_name=string")
- .hasArgs(2)
- .withValueSeparator()
- .withDescription(String.format("Value of special parameter. "
- + "These are the mandatory parameters={%s}",
- StringUtils.join(mandatorySpecialParameters, ",")))
- .create(specialParametersPrefix);
- options.addOption(specialParameter);
- @SuppressWarnings("static-access")
- Option otherParameter = OptionBuilder.withArgName("parameter_name=string")
- .hasArgs(2)
- .withValueSeparator()
- .withDescription(
- String.format("Value of some other parameter."))
- .create(processParametersPrefix);
- options.addOption(otherParameter);
-
- Option help = new Option("help", "print this message");
- options.addOption(help);
-
- CommandLineParser parser = new GnuParser();
- try {
- CommandLine cmdLine = parser.parse(options, args);
- if(cmdLine.hasOption("help")){
- HelpFormatter formatter = new HelpFormatter();
- formatter.printHelp("", options );
- System.exit(1);
- }
- return cmdLine;
- } catch (ParseException e) {
- throw new CmdLineParserException("Parsing command line arguments failed", e);
- }
-
- }
-}
diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/java/CmdLineParserException.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/java/CmdLineParserException.java
deleted file mode 100644
index bbcad8d84..000000000
--- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/java/CmdLineParserException.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package eu.dnetlib.dhp.common.java;
-
-/**
- * Command line parsing exception
- * @author Mateusz Kobos
- *
- */
-public class CmdLineParserException extends RuntimeException {
- /**
- *
- */
- private static final long serialVersionUID = 9219928547611876284L;
-
- public CmdLineParserException(String message){
- super(message);
- }
-
- public CmdLineParserException(String message, Throwable cause){
- super(message, cause);
- }
-}
diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/java/CmdLineParserForProcessConstruction.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/java/CmdLineParserForProcessConstruction.java
deleted file mode 100644
index 2c65d0892..000000000
--- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/java/CmdLineParserForProcessConstruction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package eu.dnetlib.dhp.common.java;
-
-import java.lang.reflect.Constructor;
-
-import org.apache.commons.cli.CommandLine;
-
-/**
- * Handles parsing the command line arguments provided by the Oozie
- * to create a {@link Process}
- * @author Mateusz Kobos
- *
- */
-public class CmdLineParserForProcessConstruction {
- public Process run(CommandLine cmdLine){
- String[] args = cmdLine.getArgs();
- if(args.length != 1){
- throw new CmdLineParserException("The name of the class has "+
- "to be specified as the first agrument");
- }
- String className = args[0];
-
- String[] constructorParams = cmdLine.getOptionValues(
- CmdLineParser.constructorPrefix);
- if(constructorParams == null){
- constructorParams = new String[0];
- }
- try {
- Class> processClass = Class.forName(className);
- Constructor> processConstructor = null;
- if(constructorParams.length == 0){
- try{
- processConstructor = processClass.getConstructor();
- return (Process) processConstructor.newInstance();
- } catch(NoSuchMethodException ex){
- }
- }
- processConstructor = processClass.getConstructor(String[].class);
- return (Process) processConstructor.newInstance(
- (Object)constructorParams);
- } catch (Exception e) {
- throw new CmdLineParserException(String.format(
- "Problem while creating class \"%s\"", className), e);
- }
- }
-}
diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/java/CmdLineParserForProcessRunParameters.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/java/CmdLineParserForProcessRunParameters.java
deleted file mode 100644
index 31db33103..000000000
--- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/java/CmdLineParserForProcessRunParameters.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package eu.dnetlib.dhp.common.java;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.hadoop.fs.Path;
-
-/**
- * Handles parsing parameters passed to the {@link Process}
- * @author Mateusz Kobos
- *
- */
-public class CmdLineParserForProcessRunParameters {
- /** Parse the command line arguments.
- *
- * @param cmdLine command line arguments
- * @param ports names of ports that ought to be extracted from command line
- */
- public ProcessParameters run(CommandLine cmdLine, Ports ports) {
-
- Properties inputProperties = cmdLine.getOptionProperties(
- CmdLineParser.inputPrefix);
- assumePortNamesMatch(CmdLineParser.inputPrefix, inputProperties,
- ports.getInput().keySet());
- Map inputBindings = getBindings(
- inputProperties, ports.getInput().keySet());
-
- Properties outputProperties = cmdLine.getOptionProperties(
- CmdLineParser.outputPrefix);
- assumePortNamesMatch(CmdLineParser.outputPrefix, outputProperties,
- ports.getOutput().keySet());
- Map outputBindings = getBindings(
- outputProperties, ports.getOutput().keySet());
-
- PortBindings bindings = new PortBindings(inputBindings, outputBindings);
-
- Properties specialProperties = cmdLine.getOptionProperties(
- CmdLineParser.specialParametersPrefix);
- assumeContainAllMandatoryParameters(
- specialProperties, CmdLineParser.mandatorySpecialParameters);
-
- Properties rawProperties = cmdLine.getOptionProperties(
- CmdLineParser.processParametersPrefix);
- Map processParameters = new HashMap();
- for(Entry
- *
- *
All the characters from the "Latin-1 Supplement" and "Latin Extended-A"
- * Unicode blocks are mapped to the "Basic Latin" block. Characters from other
- * alphabets are generally left intact, although the decomposable ones may be
- * affected by the procedure.
- *
- * @author Lukasz Bolikowski (bolo@icm.edu.pl)
- *
- * @author Łukasz Dumiszewski /just copied from coansys-commons/
- *
- */
-public final class DiacriticsRemover {
-
- private static final Character[] from = {
- 'Æ', 'Ð', 'Ø', 'Þ', 'ß', 'æ', 'ð', 'ø', 'þ', 'Đ', 'đ', 'Ħ',
- 'ħ', 'ı', 'ĸ', 'Ł', 'ł', 'Ŋ', 'ŋ', 'Œ', 'œ', 'Ŧ', 'ŧ'};
- private static final String[] to = {
- "AE", "D", "O", "Y", "ss", "ae", "d", "o", "y", "D", "d", "H",
- "h", "i", "q", "L", "l", "N", "n", "OE", "oe", "T", "t"};
-
- private static Map lookup = buildLookup();
-
-
- //------------------------ CONSTRUCTORS -------------------
-
-
- private DiacriticsRemover() {}
-
-
- //------------------------ LOGIC --------------------------
-
-
- /**
- * Removes diacritics from a text.
- *
- * @param text Text to process.
- * @return Text without diacritics.
- */
- public static String removeDiacritics(String text) {
- if (text == null) {
- return null;
- }
-
- String tmp = Normalizer.normalize(text, Normalizer.Form.NFKD);
-
- StringBuilder builder = new StringBuilder();
- for (int i = 0; i < tmp.length(); i++) {
- Character ch = tmp.charAt(i);
- if (Character.getType(ch) == Character.NON_SPACING_MARK) {
- continue;
- }
-
- if (lookup.containsKey(ch)) {
- builder.append(lookup.get(ch));
- } else {
- builder.append(ch);
- }
- }
-
- return builder.toString();
- }
-
-
- //------------------------ PRIVATE --------------------------
-
- private static Map buildLookup() {
- if (from.length != to.length) {
- throw new IllegalStateException();
- }
-
- Map _lookup = new HashMap();
- for (int i = 0; i < from.length; i++) {
- _lookup.put(from[i], to[i]);
- }
-
- return _lookup;
- }
-}
diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/string/LenientComparisonStringNormalizer.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/string/LenientComparisonStringNormalizer.java
deleted file mode 100644
index bae64ae38..000000000
--- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/string/LenientComparisonStringNormalizer.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * This file is part of CoAnSys project.
- * Copyright (c) 2012-2015 ICM-UW
- *
- * CoAnSys is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
-
- * CoAnSys is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with CoAnSys. If not, see .
- */
-package eu.dnetlib.dhp.common.string;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.google.common.collect.ImmutableList;
-
-/**
- * An implementation of {@link StringNormalizer} that normalizes strings for non-strict comparisons
- * in which one does not care about characters other than letters and digits or about differently written diacritics.
- *
- * @author Łukasz Dumiszewski
- *
- */
-public final class LenientComparisonStringNormalizer implements StringNormalizer, Serializable {
-
-
- private static final long serialVersionUID = 1L;
-
-
- private List whitelistCharacters;
-
-
- //------------------------ CONSTRUCTORS --------------------------
-
- public LenientComparisonStringNormalizer() {
- this(ImmutableList.of());
- }
-
- /**
- * @param whitelistCharacters - non alphanumeric characters that will not be removed
- * during normalization
- */
- public LenientComparisonStringNormalizer(List whitelistCharacters) {
- this.whitelistCharacters = whitelistCharacters;
- }
-
-
- //------------------------ LOGIC --------------------------
-
-
-
- /**
- * Normalizes the given value.
- * The normalized strings are better suited for non-strict comparisons, in which one does NOT care about characters that are
- * neither letters nor digits; about accidental spaces or different diacritics etc.
- * This method:
- *
- *
Replaces all characters that are not letters or digits with spaces (except those on whitelist characters list)