diff --git a/cmd-line-apps/dhp-broker-client/pom.xml b/cmd-line-apps/dhp-broker-client/pom.xml
new file mode 100644
index 00000000..8ed364f3
--- /dev/null
+++ b/cmd-line-apps/dhp-broker-client/pom.xml
@@ -0,0 +1,35 @@
+
+
+
+
+ eu.dnetlib.dhp
+ cmd-line-apps
+ 3.1.8-SNAPSHOT
+ ../
+
+
+ 4.0.0
+
+ dhp-broker-client
+ jar
+
+ dhp-broker-client
+ D-Net Broker - Command Line Client
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+ true
+
+
+
+
+
+
diff --git a/cmd-line-apps/dhp-broker-client/src/main/java/eu/dnetlib/broker/BrokerClientApp.java b/cmd-line-apps/dhp-broker-client/src/main/java/eu/dnetlib/broker/BrokerClientApp.java
new file mode 100644
index 00000000..f10ba999
--- /dev/null
+++ b/cmd-line-apps/dhp-broker-client/src/main/java/eu/dnetlib/broker/BrokerClientApp.java
@@ -0,0 +1,109 @@
+package eu.dnetlib.broker;
+
+import java.io.PrintWriter;
+import java.util.Arrays;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class BrokerClientApp implements CommandLineRunner {
+
+ private static Logger log = LoggerFactory.getLogger(BrokerClientApp.class);
+
+ @Value("${dhp.broker.api.base-url}")
+ private String defaultBrokerApiBaseUrl;
+
+ public static void main(final String[] args) {
+ SpringApplication.run(BrokerClientApp.class, args);
+ }
+
+ @Override
+ public void run(final String... args) {
+ log.info("EXECUTING : command line runner");
+
+ final Options options = new Options();
+
+ options.addOption(Option.builder("v")
+ .required(false)
+ .hasArg(false)
+ .desc("verbose")
+ .build());
+
+ options.addOption(Option.builder("u")
+ .required(true)
+ .hasArg(true)
+ .longOpt("user")
+ .desc("the email of the subscriber")
+ .build());
+
+ options.addOption(Option.builder("bu")
+ .required(false)
+ .hasArg(true)
+ .longOpt("baseurl")
+ .desc("the broker public api baseUrl")
+ .build());
+
+ options.addOption(Option.builder("o")
+ .required(true)
+ .hasArg(true)
+ .longOpt("output")
+ .desc("the output dir")
+ .build());
+
+ try {
+
+ final CommandLineParser parser = new DefaultParser();
+
+ final CommandLine cmd = parser.parse(options, args);
+
+ if (cmd.hasOption("v")) {
+
+ }
+
+ final String user = cmd.getOptionValue("u");
+ final String baseUrl = cmd.getOptionValue("bu", defaultBrokerApiBaseUrl);
+ final String outputDir = cmd.getOptionValue("o");
+
+ log.info("USER: " + user);
+ log.info("BASE_URL: " + baseUrl);
+ log.info("OUPUT DIR: " + outputDir);
+
+ } catch (final ParseException e) {
+ System.err.println("\nERROR: Unable to parse command-line arguments " + Arrays.toString(args) + " due to: " + e);
+ printHelp(options);
+ }
+ }
+
+ private void printHelp(final Options options) {
+ final HelpFormatter formatter = new HelpFormatter();
+
+ final String syntax = "Main";
+ System.out.println("\n=====");
+ System.out.println("USAGE");
+ System.out.println("=====");
+ final PrintWriter pw = new PrintWriter(System.out);
+ formatter.printUsage(pw, 80, syntax, options);
+ pw.flush();
+
+ final String usageHeader = "OpenAIRE Broker - Public API Client\n";
+ final String usageFooter = "\nSee http://.../... for further details.";
+ System.out.println("\n====");
+ System.out.println("HELP");
+ System.out.println("====");
+
+ formatter.printHelp(syntax, options);
+ System.out.println();
+ }
+}
diff --git a/cmd-line-apps/dhp-broker-client/src/main/resources/application.properties b/cmd-line-apps/dhp-broker-client/src/main/resources/application.properties
new file mode 100644
index 00000000..38128821
--- /dev/null
+++ b/cmd-line-apps/dhp-broker-client/src/main/resources/application.properties
@@ -0,0 +1,6 @@
+spring.main.banner-mode=off
+
+logging.level.root=INFO
+
+
+dhp.broker.api.base-url + http://test.it/test
diff --git a/cmd-line-apps/pom.xml b/cmd-line-apps/pom.xml
new file mode 100644
index 00000000..06cfbcfe
--- /dev/null
+++ b/cmd-line-apps/pom.xml
@@ -0,0 +1,58 @@
+
+
+
+ eu.dnetlib.dhp
+ dnet-applications
+ 3.1.8-SNAPSHOT
+ ../
+
+
+ 4.0.0
+ cmd-line-apps
+ pom
+
+
+ dhp-broker-client
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+
+
+
+ commons-cli
+ commons-cli
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+ true
+
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index a11645df..aba8597c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,6 +29,7 @@
libs
apps
+ cmd-line-apps
@@ -144,6 +145,12 @@
${dnet-hadoop-version}
+
+ commons-cli
+ commons-cli
+ 1.4
+
+
org.apache.commons
commons-lang3
@@ -161,13 +168,6 @@
2.4
-
- commons-cli
- commons-cli
- 1.2
- provided
-
-
dom4j
dom4j