diff --git a/README.md b/README.md index eb486ad..ca748fc 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,13 @@ Utilities to facilitate Java applications development. [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/grycap/coreutils/blob/master/LICENSE) [![Build Status](https://api.travis-ci.org/grycap/coreutils.svg)](https://travis-ci.org/grycap/coreutils/builds) [![Coverage Status](https://coveralls.io/repos/grycap/coreutils/badge.svg?branch=master&service=github)](https://coveralls.io/github/grycap/coreutils?branch=master) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/es.upv.grycap.coreutils/coreutils/badge.svg)](https://maven-badges.herokuapp.com/maven-central/es.upv.grycap.coreutils/coreutils) ## Environment variables -``GRYCAP_TESTS_PRINT_OUTPUT`` set value to ``true`` to print tests output. +``grycap.tests.print.out`` set value to ``true`` to print tests output. + +``grycap.deploy.release`` set value to ``true`` to release the project to the Maven Central repository. ## Installation diff --git a/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/CoreutilsContext.java b/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/CoreutilsContext.java index aa35c26..3ad4721 100644 --- a/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/CoreutilsContext.java +++ b/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/CoreutilsContext.java @@ -115,6 +115,7 @@ public enum CoreutilsContext { /** * Gets a client from the registry. + * @param - specific type of client * @param type - the expected type of client * @return An instance that matches the specified type, or null if no instance with the specified properties is * found in the registry. @@ -126,6 +127,7 @@ public enum CoreutilsContext { /** * Gets a client from the registry. Callers can optionally specify a classifier. + * @param - specific type of client * @param type - the expected type of client * @param classifier - (optional) only clients matching the classifier will be selected * @return An instance that matches the specified type and classifier, or null if no instance with the specified @@ -138,7 +140,8 @@ public enum CoreutilsContext { /** * Gets a client from the registry. In case that no instance with the specified properties is found in the registry, the - * optional supplier will be used to create a new instance that will be registered. + * optional supplier will be used to create a new instance that will be registered. + * @param - specific type of client * @param type - the expected type of client * @param supplier - (optional) client factory * @return An instance that matches the specified type, or a new instance created with the supplier if no instance with @@ -152,6 +155,7 @@ public enum CoreutilsContext { /** * Gets a client from the registry. Callers can optionally specify a classifier. In case that no instance with the specified * properties is found in the registry, the optional supplier will be used to create a new instance that will be registered. + * @param - specific type of client * @param type - the expected type of client * @param classifier - (optional) only clients matching the classifier will be selected * @param supplier - (optional) client factory @@ -165,6 +169,7 @@ public enum CoreutilsContext { /** * Registers a new shutdown listener for the specified type. + * @param - specific type of shutdown listener * @param listener - the listener that will be registered * @param type - the type of the shutdown listener */ @@ -174,6 +179,7 @@ public enum CoreutilsContext { /** * Registers a new shutdown listener for the specified type with an optional classifier. + * @param - specific type of shutdown listener * @param listener - the listener that will be registered * @param type - the type of the shutdown listener * @param classifier - (optional) add this classifier to the registry @@ -186,6 +192,7 @@ public enum CoreutilsContext { /** * Unregister a shutdown listener. + * @param - specific type of shutdown listener * @param type - the type of the shutdown listener */ public void removeShutdownListener(final Class type) { @@ -194,6 +201,7 @@ public enum CoreutilsContext { /** * Unregister a shutdown listener. + * @param - specific type of shutdown listener * @param type - the type of the shutdown listener * @param classifier - (optional) classifier */ diff --git a/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/ShutdownHook.java b/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/ShutdownHook.java index 7f5eb2a..5e58771 100644 --- a/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/ShutdownHook.java +++ b/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/ShutdownHook.java @@ -52,6 +52,7 @@ public class ShutdownHook { /** * Creates an instance of this class and registers it with the JVM. + * @param waitTerminationTimeout - will wait this time on JVM shutdown before raising a timeout exception */ public ShutdownHook(final long waitTerminationTimeout) { final long waitTerminationTimeout2 = WAIT_TERMINATION_TIMEOUT_RANGE.contains(waitTerminationTimeout) ? waitTerminationTimeout diff --git a/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/ShutdownListener.java b/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/ShutdownListener.java index 4d37a1f..ca2ba6e 100644 --- a/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/ShutdownListener.java +++ b/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/ShutdownListener.java @@ -32,7 +32,7 @@ public interface ShutdownListener { /** * Gets the status of the listener. Implementations should check that the value returned by this method is true before entering the stop sequence. - * @return + * @return the current status of this listener */ boolean isRunning(); diff --git a/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/concurrent/TaskRunner.java b/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/concurrent/TaskRunner.java index 2f8835b..214c112 100644 --- a/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/concurrent/TaskRunner.java +++ b/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/concurrent/TaskRunner.java @@ -86,6 +86,7 @@ public class TaskRunner implements ShutdownListener { /** * Submits a new task for execution to the pool of threads managed by this class. + * @param - specific type of supplier * @param supplier - a function returning the value to be used to complete the returned {@link CompletableFuture} * @return a {@link CompletableFuture} that the caller can use to track the execution of the task and to register a callback function. */ diff --git a/pom.xml b/pom.xml index 84956f6..2237328 100644 --- a/pom.xml +++ b/pom.xml @@ -227,34 +227,82 @@ that you distribute must include a readable copy of the "NOTICE" text file. + + + silent + + true + + + + sign-release-artifacts + + + grycap.deploy.release + true + + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + true + + ossrh + https://oss.sonatype.org/ + true + + + + + + + - - - - org.eclipse.m2e - lifecycle-mapping - ${m2e.lifecycle-mapping.version} - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - [1.0.0,) - - enforce - - - - - - - - - - + org.apache.maven.plugins @@ -354,17 +402,7 @@ that you distribute must include a readable copy of the "NOTICE" text file. true - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - - org.apache.maven.plugins - maven-enforcer-plugin - 1.4.1 - + org.apache.maven.plugins maven-source-plugin @@ -380,6 +418,11 @@ that you distribute must include a readable copy of the "NOTICE" text file. maven-gpg-plugin 1.6 + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.6 + @@ -393,59 +436,7 @@ that you distribute must include a readable copy of the "NOTICE" text file. org.eluder.coveralls coveralls-maven-plugin 4.0.0 - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar-no-fork - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - jar - - - - - - - org.apache.maven.plugins - maven-gpg-plugin - - - sign-artifacts - verify - - sign - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.6 - true - - ossrh - https://oss.sonatype.org/ - true - - + diff --git a/src/main/scripts/ossrh-deploy.sh b/src/main/scripts/ossrh-deploy.sh index b29666d..1505847 100755 --- a/src/main/scripts/ossrh-deploy.sh +++ b/src/main/scripts/ossrh-deploy.sh @@ -33,6 +33,9 @@ # http://central.sonatype.org/pages/apache-maven.html # http://central.sonatype.org/pages/ossrh-guide.html # +# Note that if autoReleaseAfterClose value is set to true in your POM file, +# then the project will be also released to the Maven Central Repository. +# # Recommended use: 1) change to the root directory of your project; and # 2) execute this script. ### @@ -42,7 +45,7 @@ read -p "Confirm deployment of current Maven project to OSSRH (yes/no)? " if [ "$REPLY" == "yes" ] ; then ssh-add ~/.ssh/id_rsa ssh-add -l - mvn clean deploy | tee target/ossrh-deploy.log + mvn -Dgrycap.deploy.release=true clean deploy | tee ossrh-deploy.log ssh-add -D else echo "Exit without deploy"