diff --git a/.classpath b/.classpath deleted file mode 100644 index fae1a2b..0000000 --- a/.classpath +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.gitignore b/.gitignore index eb5a316..d5ea5a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ target +/.classpath diff --git a/.settings/.gitignore b/.settings/.gitignore new file mode 100644 index 0000000..3b1537c --- /dev/null +++ b/.settings/.gitignore @@ -0,0 +1 @@ +/org.eclipse.jdt.core.prefs diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 714351a..0000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,5 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/gcube/extra-resources/META-INF/plugin.properties b/gcube/extra-resources/META-INF/plugin.properties new file mode 100644 index 0000000..27b1aba --- /dev/null +++ b/gcube/extra-resources/META-INF/plugin.properties @@ -0,0 +1,4 @@ +groupId=${groupId} +artifactId=${artifactId} +version=${version} +description=${description} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8850e90..ecf784a 100644 --- a/pom.xml +++ b/pom.xml @@ -35,14 +35,14 @@ org.gcube.distribution gcube-bom - LATEST + 2.0.0-SNAPSHOT pom import org.gcube.distribution gcube-smartgears-bom - LATEST + 2.0.0-SNAPSHOT pom import @@ -102,7 +102,7 @@ org.gcube.vremanagement smart-executor-api - [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) + [3.0.0-SNAPSHOT, 4.0.0-SNAPSHOT) org.gcube.dvos @@ -153,19 +153,60 @@ ${apache.http.version} - + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.1 + + + copy-dependencies + compile + + copy-dependencies + + + runtime + ${basedir}${file.separator}target${file.separator}libs + false + false + true + war + false + + + + org.apache.maven.plugins maven-assembly-plugin - make-uberjar - install + uberjar + + true + + uberjar.xml + + + package + + single + - make-servicearchive - install + tar.gz + + false + + tar-gz.xml + + + package + + single + diff --git a/src/main/java/org/gcube/socialnetworking/socialdataindexer/SocialDataIndexerPlugin.java b/src/main/java/org/gcube/socialnetworking/socialdataindexer/SocialDataIndexerPlugin.java index 8c4d9a7..8d36ab7 100644 --- a/src/main/java/org/gcube/socialnetworking/socialdataindexer/SocialDataIndexerPlugin.java +++ b/src/main/java/org/gcube/socialnetworking/socialdataindexer/SocialDataIndexerPlugin.java @@ -46,9 +46,10 @@ import org.slf4j.LoggerFactory; /** * The SocialDataIndexerPlugin synchronizes and indexes data coming from the cassandra * cluster in the elasticsearch engine. - * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it) + * @author Costantino Perciante at ISTI-CNR + * @author Luca Frosini (ISTI-CNR) */ -public class SocialDataIndexerPlugin extends Plugin{ +public class SocialDataIndexerPlugin extends Plugin { //Logger private static Logger logger = LoggerFactory.getLogger(SocialDataIndexerPlugin.class); @@ -62,11 +63,8 @@ public class SocialDataIndexerPlugin extends Plugin getSupportedCapabilities() { - Map discoveredCapabilities = new HashMap(); - // No capabilities to discover - return discoveredCapabilities; - } - - /**{@inheritDoc}*/ - @Override - public Class> getPluginImplementation() { - return SocialDataIndexerPlugin.class; - } - - @Override - public String toString(){ - return String.format("%s : %s - %s - %s - %s - %s", - this.getClass().getSimpleName(), - getName(), getVersion(), getDescription(), - getSupportedCapabilities(), - getPluginImplementation().getClass().getSimpleName()); - } - -} diff --git a/src/main/java/org/gcube/socialnetworking/socialdataindexer/utils/SendNotification.java b/src/main/java/org/gcube/socialnetworking/socialdataindexer/utils/SendNotification.java index 1c428b5..fbefd29 100644 --- a/src/main/java/org/gcube/socialnetworking/socialdataindexer/utils/SendNotification.java +++ b/src/main/java/org/gcube/socialnetworking/socialdataindexer/utils/SendNotification.java @@ -76,9 +76,9 @@ public class SendNotification extends PluginStateNotification { try(CloseableHttpClient httpClient = HttpClientBuilder.create().build()){ JSONObject obj = new JSONObject(); - obj.put("job_id", pluginStateEvolution.getUuid().toString()); + obj.put("job_id", pluginStateEvolution.getUUID().toString()); obj.put("recipient", recipient); - obj.put("job_name", pluginStateEvolution.getPluginDeclaration().getName()); + obj.put("job_name", pluginStateEvolution.getPluginDefinition().getName()); obj.put("service_name", SERVICE_NAME); // if(pluginStateEvolution.getPluginState().equals(PluginState.DONE)) // obj.put("status", "SUCCEEDED"); diff --git a/src/main/resources/META-INF/services/org.gcube.vremanagement.executor.plugin.PluginDeclaration b/src/main/resources/META-INF/services/org.gcube.vremanagement.executor.plugin.Plugin similarity index 81% rename from src/main/resources/META-INF/services/org.gcube.vremanagement.executor.plugin.PluginDeclaration rename to src/main/resources/META-INF/services/org.gcube.vremanagement.executor.plugin.Plugin index a369147..0914cb1 100644 --- a/src/main/resources/META-INF/services/org.gcube.vremanagement.executor.plugin.PluginDeclaration +++ b/src/main/resources/META-INF/services/org.gcube.vremanagement.executor.plugin.Plugin @@ -1 +1 @@ -org.gcube.socialnetworking.socialdataindexer.SocialDataIndexerPluginDeclaration \ No newline at end of file +org.gcube.socialnetworking.socialdataindexer.SocialDataIndexerPlugin \ No newline at end of file diff --git a/src/test/java/org/gcube/socialnetworking/socialdataindexer/Tests.java b/src/test/java/org/gcube/socialnetworking/socialdataindexer/Tests.java index a7c9084..d2bf05d 100644 --- a/src/test/java/org/gcube/socialnetworking/socialdataindexer/Tests.java +++ b/src/test/java/org/gcube/socialnetworking/socialdataindexer/Tests.java @@ -20,7 +20,7 @@ public class Tests { logger.debug("Starting to test launch"); Map inputs = new HashMap(); inputs.put("scope", "gcube"); - SocialDataIndexerPlugin plugin = new SocialDataIndexerPlugin(null); + SocialDataIndexerPlugin plugin = new SocialDataIndexerPlugin(); //uncomment for testing purpose //plugin.launch(inputs); logger.debug("-------------- launch test finished"); diff --git a/tar-gz.xml b/tar-gz.xml new file mode 100644 index 0000000..e41c0e6 --- /dev/null +++ b/tar-gz.xml @@ -0,0 +1,24 @@ + + tar.gz + + tar.gz + + ${file.separator} + + + target${file.separator}libs + ${file.separator} + true + 755 + + + + + target${file.separator}${project.artifactId}-${project.version}.jar + true + + + \ No newline at end of file diff --git a/uberjar.xml b/uberjar.xml new file mode 100644 index 0000000..5348cf9 --- /dev/null +++ b/uberjar.xml @@ -0,0 +1,24 @@ + + uberjar + + jar + + ${file.separator} + + + target${file.separator}libs + ${file.separator} + true + 755 + + + target${file.separator}classes + ${file.separator} + true + 755 + + + \ No newline at end of file