From a97e8bc06a48e8b6ca9d24df5150e08189b6d934 Mon Sep 17 00:00:00 2001 From: agabrys Date: Fri, 1 Jul 2016 23:37:09 +0200 Subject: [PATCH 01/15] bump version to 1.3.1 and correct description --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index af36752..b926221 100644 --- a/pom.xml +++ b/pom.xml @@ -5,9 +5,9 @@ biz.gabrys.maven plugin-utils - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT Maven Plugin Utils - The Maven Plugin Utils is a Java library which contains utilities for the Maven 2 plugins. + A Java library which contains utilities for Maven 2 plugins. http://maven-plugin-utils.projects.gabrys.biz/LATEST/ 2015 From 972849c6799852ace97bcada23d6576933904e3f Mon Sep 17 00:00:00 2001 From: agabrys Date: Sun, 3 Jul 2016 22:25:01 +0200 Subject: [PATCH 02/15] download page: use ${project.artifactId} instead of hardcoded strings --- xdocs/download.xml.vm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xdocs/download.xml.vm b/xdocs/download.xml.vm index 6b57060..fd8a754 100644 --- a/xdocs/download.xml.vm +++ b/xdocs/download.xml.vm @@ -8,7 +8,7 @@ #set($snapshot = $project.version.contains("SNAPSHOT")) -
+
@@ -19,11 +19,11 @@ #if (!$snapshot) style="vertical-align: middle;" #end - >plugin-utils-${project.version}.jar + >${project.artifactId}-${project.version}.jar @@ -32,11 +32,11 @@ #if (!$snapshot) style="vertical-align: middle;" #end - >plugin-utils-${project.version}-javadoc.jar + >${project.artifactId}-${project.version}-javadoc.jar @@ -45,11 +45,11 @@ #if (!$snapshot) style="vertical-align: middle;" #end - >plugin-utils-${project.version}-sources.jar + >${project.artifactId}-${project.version}-sources.jar From 8eb20a9460c8969848a70b92f9fd84f4ccd7dba0 Mon Sep 17 00:00:00 2001 From: agabrys Date: Wed, 6 Jul 2016 22:27:18 +0200 Subject: [PATCH 03/15] #5 correct invalid URL in copyright headers --- header-license-template.txt | 2 +- .../java/biz/gabrys/maven/plugin/util/io/AntFileScanner.java | 2 +- .../biz/gabrys/maven/plugin/util/io/DestinationFileCreator.java | 2 +- src/main/java/biz/gabrys/maven/plugin/util/io/FileScanner.java | 2 +- src/main/java/biz/gabrys/maven/plugin/util/io/LoggerUtils.java | 2 +- .../gabrys/maven/plugin/util/io/LoggingDirectoryScanner.java | 2 +- .../java/biz/gabrys/maven/plugin/util/io/LoggingFileFilter.java | 2 +- .../java/biz/gabrys/maven/plugin/util/io/RegexFileFilter.java | 2 +- .../gabrys/maven/plugin/util/io/RegexFileFilterException.java | 2 +- .../java/biz/gabrys/maven/plugin/util/io/RegexFileScanner.java | 2 +- .../java/biz/gabrys/maven/plugin/util/io/ScannerFactory.java | 2 +- .../biz/gabrys/maven/plugin/util/io/ScannerPatternFormat.java | 2 +- src/main/java/biz/gabrys/maven/plugin/util/io/package-info.java | 2 +- .../maven/plugin/util/parameter/ParametersLogBuilder.java | 2 +- .../parameter/converter/AbstractValueToStringConverter.java | 2 +- .../plugin/util/parameter/converter/ArrayToStringConverter.java | 2 +- .../util/parameter/converter/CollectionToStringConverter.java | 2 +- .../util/parameter/converter/DefaultValueToStringConverter.java | 2 +- .../util/parameter/converter/ObjectToStringConverter.java | 2 +- .../plugin/util/parameter/converter/ValueToStringConverter.java | 2 +- .../maven/plugin/util/parameter/converter/package-info.java | 2 +- .../biz/gabrys/maven/plugin/util/parameter/package-info.java | 2 +- .../util/parameter/sanitizer/AbstractSimpleSanitizer.java | 2 +- .../plugin/util/parameter/sanitizer/AlwaysValidSanitizer.java | 2 +- .../plugin/util/parameter/sanitizer/LazySimpleSanitizer.java | 2 +- .../maven/plugin/util/parameter/sanitizer/SimpleSanitizer.java | 2 +- .../maven/plugin/util/parameter/sanitizer/ValueSanitizer.java | 2 +- .../maven/plugin/util/parameter/sanitizer/package-info.java | 2 +- .../java/biz/gabrys/maven/plugin/util/timer/SystemTimer.java | 2 +- src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java | 2 +- src/main/java/biz/gabrys/maven/plugin/util/timer/Timer.java | 2 +- .../java/biz/gabrys/maven/plugin/util/timer/package-info.java | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/header-license-template.txt b/header-license-template.txt index b82ac79..54d2ced 100644 --- a/header-license-template.txt +++ b/header-license-template.txt @@ -1,5 +1,5 @@ ${project.name} -http://maven-project-utils.projects.gabrys.biz/ +http://maven-plugin-utils.projects.gabrys.biz/ Copyright (c) ${project.inceptionYear} ${owner} diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/AntFileScanner.java b/src/main/java/biz/gabrys/maven/plugin/util/io/AntFileScanner.java index 865a97a..65d23e9 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/AntFileScanner.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/AntFileScanner.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/DestinationFileCreator.java b/src/main/java/biz/gabrys/maven/plugin/util/io/DestinationFileCreator.java index defa95c..0c250fa 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/DestinationFileCreator.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/DestinationFileCreator.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/FileScanner.java b/src/main/java/biz/gabrys/maven/plugin/util/io/FileScanner.java index f4fbcab..7647e61 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/FileScanner.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/FileScanner.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/LoggerUtils.java b/src/main/java/biz/gabrys/maven/plugin/util/io/LoggerUtils.java index df1f6ed..125bf38 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/LoggerUtils.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/LoggerUtils.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingDirectoryScanner.java b/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingDirectoryScanner.java index 44763fd..cae019d 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingDirectoryScanner.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingDirectoryScanner.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingFileFilter.java b/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingFileFilter.java index a855f2f..5ca6abf 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingFileFilter.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingFileFilter.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileFilter.java b/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileFilter.java index 999b580..5b30779 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileFilter.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileFilter.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileFilterException.java b/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileFilterException.java index 6a536fd..bd5600e 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileFilterException.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileFilterException.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileScanner.java b/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileScanner.java index ff1cf81..6fce6dc 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileScanner.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileScanner.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/ScannerFactory.java b/src/main/java/biz/gabrys/maven/plugin/util/io/ScannerFactory.java index 2b098a4..c6c99b7 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/ScannerFactory.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/ScannerFactory.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/ScannerPatternFormat.java b/src/main/java/biz/gabrys/maven/plugin/util/io/ScannerPatternFormat.java index 331f0c0..248bd67 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/ScannerPatternFormat.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/ScannerPatternFormat.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/package-info.java b/src/main/java/biz/gabrys/maven/plugin/util/io/package-info.java index 2cabc22..8bc1b18 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/package-info.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/package-info.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/ParametersLogBuilder.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/ParametersLogBuilder.java index 9190f5c..1102ad6 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/ParametersLogBuilder.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/ParametersLogBuilder.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/AbstractValueToStringConverter.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/AbstractValueToStringConverter.java index 9eb9c54..4f76c8f 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/AbstractValueToStringConverter.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/AbstractValueToStringConverter.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/ArrayToStringConverter.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/ArrayToStringConverter.java index e541857..87fb1c7 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/ArrayToStringConverter.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/ArrayToStringConverter.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/CollectionToStringConverter.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/CollectionToStringConverter.java index 6dda685..a172032 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/CollectionToStringConverter.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/CollectionToStringConverter.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/DefaultValueToStringConverter.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/DefaultValueToStringConverter.java index 256965d..d5b5bdf 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/DefaultValueToStringConverter.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/DefaultValueToStringConverter.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/ObjectToStringConverter.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/ObjectToStringConverter.java index a36732e..afb3efe 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/ObjectToStringConverter.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/ObjectToStringConverter.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/ValueToStringConverter.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/ValueToStringConverter.java index bf1d9d0..56efb4c 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/ValueToStringConverter.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/ValueToStringConverter.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/package-info.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/package-info.java index 895af1b..ec55f88 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/package-info.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/converter/package-info.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/package-info.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/package-info.java index 1207029..bbeb7ea 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/package-info.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/package-info.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/AbstractSimpleSanitizer.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/AbstractSimpleSanitizer.java index 9a557e0..11eeeb0 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/AbstractSimpleSanitizer.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/AbstractSimpleSanitizer.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/AlwaysValidSanitizer.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/AlwaysValidSanitizer.java index 6ced56f..dbaa84f 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/AlwaysValidSanitizer.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/AlwaysValidSanitizer.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/LazySimpleSanitizer.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/LazySimpleSanitizer.java index 2e2bc44..5fb15bf 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/LazySimpleSanitizer.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/LazySimpleSanitizer.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/SimpleSanitizer.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/SimpleSanitizer.java index 4aea462..cd95115 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/SimpleSanitizer.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/SimpleSanitizer.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/ValueSanitizer.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/ValueSanitizer.java index b554365..cc40a02 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/ValueSanitizer.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/ValueSanitizer.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/package-info.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/package-info.java index 312ee9b..8392c35 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/package-info.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/package-info.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/timer/SystemTimer.java b/src/main/java/biz/gabrys/maven/plugin/util/timer/SystemTimer.java index 6881929..60dc2da 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/timer/SystemTimer.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/timer/SystemTimer.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java b/src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java index 1cba935..0876af7 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/timer/Timer.java b/src/main/java/biz/gabrys/maven/plugin/util/timer/Timer.java index 3c6609c..90b3fab 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/timer/Timer.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/timer/Timer.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * diff --git a/src/main/java/biz/gabrys/maven/plugin/util/timer/package-info.java b/src/main/java/biz/gabrys/maven/plugin/util/timer/package-info.java index 4f22887..35afc30 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/timer/package-info.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/timer/package-info.java @@ -1,6 +1,6 @@ /* * Maven Plugin Utils - * http://maven-project-utils.projects.gabrys.biz/ + * http://maven-plugin-utils.projects.gabrys.biz/ * * Copyright (c) 2015 Adam Gabryś * From 25227d490d69bf5cfecdb2d3e4e88c15342ddfa6 Mon Sep 17 00:00:00 2001 From: agabrys Date: Sun, 24 Jul 2016 23:42:34 +0200 Subject: [PATCH 04/15] Remove trailing whitespace and change title in README --- README.md | 2 +- xdocs/download.xml.vm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7d2855f..c60d3d6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# About Maven Plugin Utils +# About [![License BSD 3-Clause](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](http://maven-plugin-utils.projects.gabrys.biz/license.txt) [![Build Status](https://travis-ci.org/gabrysbiz/maven-plugin-utils.svg?branch=develop)](https://travis-ci.org/gabrysbiz/maven-plugin-utils) diff --git a/xdocs/download.xml.vm b/xdocs/download.xml.vm index fd8a754..41ace35 100644 --- a/xdocs/download.xml.vm +++ b/xdocs/download.xml.vm @@ -39,7 +39,7 @@
repo.maven.apache.org #end - +
File - gabrys.biz + gabrys.biz #if (!$snapshot) -
repo.maven.apache.org +
repo.maven.apache.org #end
- gabrys.biz + gabrys.biz #if (!$snapshot) -
repo.maven.apache.org +
repo.maven.apache.org #end
- gabrys.biz + gabrys.biz #if (!$snapshot) -
repo.maven.apache.org +
repo.maven.apache.org #end
Date: Sun, 30 Oct 2016 16:01:59 +0100 Subject: [PATCH 05/15] Add ContextClassLoaderExtender and ParameterUtils, small docs fixes --- CHANGELOG.md | 15 +- README.md | 1 + pom.xml | 8 +- .../classpath/ContextClassLoaderExtender.java | 134 ++++++++++++++++++ .../plugin/util/classpath/package-info.java | 18 +++ .../maven/plugin/util/io/AntFileScanner.java | 2 +- .../maven/plugin/util/io/FileScanner.java | 2 +- .../util/io/LoggingDirectoryScanner.java | 6 +- .../plugin/util/io/LoggingFileFilter.java | 11 +- .../plugin/util/io/RegexFileScanner.java | 2 +- .../maven/plugin/util/io/ScannerFactory.java | 6 +- .../maven/plugin/util/io/package-info.java | 2 +- .../plugin/util/parameter/ParameterUtils.java | 43 ++++++ .../util/parameter/ParametersLogBuilder.java | 9 +- .../plugin/util/parameter/package-info.java | 2 +- .../util/parameter/ParameterUtilsTest.java | 39 +++++ xdocs/changelog.xml | 31 +++- xdocs/index.xml.vm | 5 + 18 files changed, 303 insertions(+), 33 deletions(-) create mode 100644 src/main/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.java create mode 100644 src/main/java/biz/gabrys/maven/plugin/util/classpath/package-info.java create mode 100644 src/main/java/biz/gabrys/maven/plugin/util/parameter/ParameterUtils.java create mode 100644 src/test/java/biz/gabrys/maven/plugin/util/parameter/ParameterUtilsTest.java diff --git a/CHANGELOG.md b/CHANGELOG.md index b75c787..b2a3c43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,20 @@ # Maven Plugin Utils Changelog +## 1.4.0 +Features: +* Added [ContextClassLoaderExtender](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.html) responsible for adding Maven project dependencies to classpath +* Added [ParameterUtils](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/parameter/ParameterUtils.html) which provides tools to work with method parameters + ## 1.3.0 Features: -* Added [ParametersLogBuilder](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/parameter/ParametersLogBuilder.html) which allows to log Mojos parameters values -* Added protected method [AntFileScanner#createDirectoryScanner()](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/io/AntFileScanner.html) -* Added protected method [RegexFileScanner#createFileFilter(File, String[], String[])](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/io/RegexFileScanner.html) +* Added [ParametersLogBuilder](http://maven-plugin-utils.projects.gabrys.biz/1.3.0/apidocs/index.html?biz/gabrys/maven/plugin/util/parameter/ParametersLogBuilder.html) which allows to log Mojos parameters values +* Added protected method [AntFileScanner#createDirectoryScanner()](http://maven-plugin-utils.projects.gabrys.biz/1.3.0/apidocs/index.html?biz/gabrys/maven/plugin/util/io/AntFileScanner.html) +* Added protected method [RegexFileScanner#createFileFilter(File, String[], String[])](http://maven-plugin-utils.projects.gabrys.biz/1.3.0/apidocs/index.html?biz/gabrys/maven/plugin/util/io/RegexFileScanner.html) Bugs: -* Fixed incorrect implementation of method [Time#toString()](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/timer/Time.html) +* Fixed incorrect implementation of method [Time#toString()](http://maven-plugin-utils.projects.gabrys.biz/1.3.0/apidocs/index.html?biz/gabrys/maven/plugin/util/timer/Time.html) + +[See documentation](http://maven-plugin-utils.projects.gabrys.biz/1.3.0/) ## 1.2 Features: diff --git a/README.md b/README.md index c60d3d6..3b1d2b2 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Maven Plugin Utils is a Java library which contains utilities for [Maven 2](https://maven.apache.org/) plugins. It contains tools to: * scan directories for files and create a virtual (not physical) destination file in the output directory based on the source (see [biz.gabrys.maven.plugin.util.io](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/io/package-summary.html) package) * log Mojos parameters (see [biz.gabrys.maven.plugin.util.parameter](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/parameter/package-summary.html) package) +* manage classpath (see [biz.gabrys.maven.plugin.util.classpath](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/classpath/package-summary.html) package) * count execution time (see [biz.gabrys.maven.plugin.util.timer](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/timer/package-summary.html) package) Read [API documentation](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/) for more information. diff --git a/pom.xml b/pom.xml index b926221..3f8d424 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ biz.gabrys.maven plugin-utils - 1.3.1-SNAPSHOT + 1.4.0-SNAPSHOT Maven Plugin Utils A Java library which contains utilities for Maven 2 plugins. http://maven-plugin-utils.projects.gabrys.biz/LATEST/ @@ -72,6 +72,12 @@ 2.0 provided + + org.apache.maven + maven-project + 2.0 + provided + org.codehaus.plexus plexus-utils diff --git a/src/main/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.java b/src/main/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.java new file mode 100644 index 0000000..7d9ddbb --- /dev/null +++ b/src/main/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.java @@ -0,0 +1,134 @@ +/* + * Maven Plugin Utils + * http://maven-plugin-utils.projects.gabrys.biz/ + * + * Copyright (c) 2015 Adam Gabryś + * + * This file is licensed under the BSD 3-Clause (the "License"). + * You may not use this file except in compliance with the License. + * You may obtain: + * - a copy of the License at project page + * - a template of the License at https://opensource.org/licenses/BSD-3-Clause + */ +package biz.gabrys.maven.plugin.util.classpath; + +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.project.MavenProject; + +import biz.gabrys.maven.plugin.util.parameter.ParameterUtils; + +/** + * Responsible for adding Maven project dependencies to classpath. + * @since 1.4.0 + */ +public class ContextClassLoaderExtender { + + private final MavenProject project; + private final Log logger; + + /** + * Creates a new instance. + * @param project the Maven project. + * @since 1.4.0 + */ + public ContextClassLoaderExtender(final MavenProject project) { + this(project, null); + } + + /** + * Creates a new instance. + * @param project the Maven project. + * @param logger the logger. + * @since 1.4.0 + */ + public ContextClassLoaderExtender(final MavenProject project, final Log logger) { + this.project = project; + this.logger = logger; + } + + /** + * Adds all dependencies with specified types to context class loader. + * @param types the supported types. + * @since 1.4.0 + */ + public void addDependencies(final String... types) { + ParameterUtils.verifyNotNull("types", types); + addDependencies(new HashSet(Arrays.asList(types))); + } + + /** + * Adds all dependencies with specified types to context class loader. + * @param types the supported types. + * @since 1.4.0 + */ + public void addDependencies(final Collection types) { + ParameterUtils.verifyNotNull("types", types); + @SuppressWarnings("unchecked") + final Set artifacts = project.getArtifacts(); + final List filtered = filterArtifacts(artifacts, types); + final List urls = resolveArtifactsUrls(filtered); + final URLClassLoader classLoader = new URLClassLoader(urls.toArray(new URL[0]), Thread.currentThread().getContextClassLoader()); + Thread.currentThread().setContextClassLoader(classLoader); + } + + /** + * Filters artifacts based on the type. + * @param artifacts the collection which stores artifacts. + * @param types the supported types. + * @return the list with artifacts whose types fit to the supported types. + * @since 1.4.0 + */ + protected List filterArtifacts(final Collection artifacts, final Collection types) { + final List filtered = new LinkedList(); + for (final Artifact artifact : artifacts) { + if (!types.contains(artifact.getType())) { + logger.debug(String.format("Exclude %s", createDisplayString(artifact))); + } else { + logger.debug(String.format("Include %s", createDisplayString(artifact))); + filtered.add(artifact); + } + } + return filtered; + } + + /** + * Returns URLs whose represents artifacts. + * @param artifacts the collection which stores artifacts. + * @return the artifacts' URLs. + * @since 1.4.0 + */ + protected List resolveArtifactsUrls(final Collection artifacts) { + final List urls = new LinkedList(); + for (final Artifact artifact : artifacts) { + try { + urls.add(artifact.getFile().toURI().toURL()); + } catch (final MalformedURLException e) { + // never + throw new IllegalStateException(String.format("Cannot add dependency %s to classpath!", createDisplayString(artifact)), e); + } + } + return urls; + } + + /** + * Creates a text representation of the {@link Artifact}. + * @param artifact the artifact. + * @return the text representation of the {@link Artifact}. + * @since 1.4.0 + */ + protected String createDisplayString(final Artifact artifact) { + return String.format("%s:%s-%s.%s (%s)", artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), + artifact.getScope()); + } +} diff --git a/src/main/java/biz/gabrys/maven/plugin/util/classpath/package-info.java b/src/main/java/biz/gabrys/maven/plugin/util/classpath/package-info.java new file mode 100644 index 0000000..85a5e9a --- /dev/null +++ b/src/main/java/biz/gabrys/maven/plugin/util/classpath/package-info.java @@ -0,0 +1,18 @@ +/* + * Maven Plugin Utils + * http://maven-plugin-utils.projects.gabrys.biz/ + * + * Copyright (c) 2015 Adam Gabryś + * + * This file is licensed under the BSD 3-Clause (the "License"). + * You may not use this file except in compliance with the License. + * You may obtain: + * - a copy of the License at project page + * - a template of the License at https://opensource.org/licenses/BSD-3-Clause + */ +/** + *

+ * Contains tools to operate on classpath. + *

+ */ +package biz.gabrys.maven.plugin.util.classpath; diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/AntFileScanner.java b/src/main/java/biz/gabrys/maven/plugin/util/io/AntFileScanner.java index 65d23e9..02f0694 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/AntFileScanner.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/AntFileScanner.java @@ -56,7 +56,7 @@ public Collection getFiles(final File directory, final String[] includes, } /** - * Creates a {@link DirectoryScanner} which will be used to find all files which match filters. + * Creates a {@link DirectoryScanner} which will be used to find all files whose match filters. * @return a not initialized instance of the {@link DirectoryScanner} or its subclass. * @since 1.3.0 * @see #getFiles(File, String[], String[]) diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/FileScanner.java b/src/main/java/biz/gabrys/maven/plugin/util/io/FileScanner.java index 7647e61..d29e80b 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/FileScanner.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/FileScanner.java @@ -17,7 +17,7 @@ /** *

- * Responsible for scanning a directory for files which match certain criteria. + * Responsible for scanning a directory for files whose match certain criteria. *

*

* Example: diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingDirectoryScanner.java b/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingDirectoryScanner.java index cae019d..a5dcf26 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingDirectoryScanner.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingDirectoryScanner.java @@ -17,6 +17,8 @@ import org.apache.maven.plugin.logging.Log; import org.codehaus.plexus.util.DirectoryScanner; +import biz.gabrys.maven.plugin.util.parameter.ParameterUtils; + /** * Extended version of the {@link DirectoryScanner} which adds logger instructions in debug mode. * @since 1.2 @@ -32,9 +34,7 @@ public class LoggingDirectoryScanner extends DirectoryScanner { * @since 1.2 */ public LoggingDirectoryScanner(final Log logger) { - if (logger == null) { - throw new IllegalArgumentException("Logger cannot be null"); - } + ParameterUtils.verifyNotNull("logger", logger); this.logger = logger; } diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingFileFilter.java b/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingFileFilter.java index 5ca6abf..17b5395 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingFileFilter.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/LoggingFileFilter.java @@ -17,6 +17,8 @@ import org.apache.commons.io.filefilter.IOFileFilter; import org.apache.maven.plugin.logging.Log; +import biz.gabrys.maven.plugin.util.parameter.ParameterUtils; + /** * Decorator which adds logger instructions (in debug mode) to an instance of the {@link IOFileFilter}. * @since 1.2 @@ -34,12 +36,9 @@ public class LoggingFileFilter implements IOFileFilter { * @since 1.2 */ public LoggingFileFilter(final IOFileFilter filter, final Log logger) { - if (filter == null) { - throw new IllegalArgumentException("Filter cannot be null"); - } - if (logger == null) { - throw new IllegalArgumentException("Logger cannot be null"); - } + ParameterUtils.verifyNotNull("filter", filter); + ParameterUtils.verifyNotNull("logger", logger); + this.filter = filter; this.logger = logger; } diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileScanner.java b/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileScanner.java index 6fce6dc..397bfc8 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileScanner.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/RegexFileScanner.java @@ -54,7 +54,7 @@ public Collection getFiles(final File directory, final String[] includes, } /** - * Creates a {@link IOFileFilter} which will be used to find all files which match filters. + * Creates a {@link IOFileFilter} which will be used to find all files whose match filters. * @param directory the directory to be scanned. * @param includes an array of include patterns. * @param excludes an array of exclude patterns diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/ScannerFactory.java b/src/main/java/biz/gabrys/maven/plugin/util/io/ScannerFactory.java index c6c99b7..16e5caf 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/ScannerFactory.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/ScannerFactory.java @@ -14,6 +14,8 @@ import org.apache.maven.plugin.logging.Log; +import biz.gabrys.maven.plugin.util.parameter.ParameterUtils; + /** * Responsible for creating new instances of the {@link FileScanner} by the {@link ScannerPatternFormat}. * @since 1.0 @@ -38,9 +40,7 @@ public ScannerFactory() { * @since 1.0 */ public FileScanner create(final ScannerPatternFormat patternFormat, final Log logger) { - if (logger == null) { - throw new IllegalArgumentException("Logger cannot be null"); - } + ParameterUtils.verifyNotNull("logger", logger); if (patternFormat == ScannerPatternFormat.ANT) { return new AntFileScanner(logger); } diff --git a/src/main/java/biz/gabrys/maven/plugin/util/io/package-info.java b/src/main/java/biz/gabrys/maven/plugin/util/io/package-info.java index 8bc1b18..bd6b494 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/io/package-info.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/io/package-info.java @@ -15,7 +15,7 @@ * Contains classes related with I/O operations. It provides tools to: *

*
    - *
  • scan directories for files which match certain criteria (see {@link biz.gabrys.maven.plugin.util.io.FileScanner + *
  • scan directories for files whose match certain criteria (see {@link biz.gabrys.maven.plugin.util.io.FileScanner * FileScanner})
  • *
  • create a virtual (not physical) destination file in the output directory based on the source directory, the * source file and the output file name pattern (see {@link biz.gabrys.maven.plugin.util.io.DestinationFileCreator diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/ParameterUtils.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/ParameterUtils.java new file mode 100644 index 0000000..411b7d9 --- /dev/null +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/ParameterUtils.java @@ -0,0 +1,43 @@ +/* + * Maven Plugin Utils + * http://maven-plugin-utils.projects.gabrys.biz/ + * + * Copyright (c) 2015 Adam Gabryś + * + * This file is licensed under the BSD 3-Clause (the "License"). + * You may not use this file except in compliance with the License. + * You may obtain: + * - a copy of the License at project page + * - a template of the License at https://opensource.org/licenses/BSD-3-Clause + */ +package biz.gabrys.maven.plugin.util.parameter; + +/** + * Provides tools to work with method parameters. + * @since 1.4.0 + */ +public final class ParameterUtils { + + private ParameterUtils() { + // blocks the possibility of create a new instance + } + + /** + * Verifies that a parameter value is not {@code null}. + * @param name the parameter name. + * @param value the parameter value. + * @throws IllegalArgumentException if the parameter value is equal to {@code null}. + * @since 1.4.0 + */ + public static void verifyNotNull(final String name, final Object value) { + if (value == null) { + final String message; + if (name == null) { + message = "Parameter is null"; + } else { + message = String.format("Parameter \"%s\" is null", name); + } + throw new IllegalArgumentException(message); + } + } +} diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/ParametersLogBuilder.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/ParametersLogBuilder.java index 1102ad6..a055f7f 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/ParametersLogBuilder.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/ParametersLogBuilder.java @@ -163,13 +163,10 @@ public ParametersLogBuilder(final Log logger) { * @since 1.3.0 */ protected ParametersLogBuilder(final Map parameters, final Log logger) { - if (parameters == null) { - throw new IllegalArgumentException("Parameters cannot be null"); - } + ParameterUtils.verifyNotNull("parameters", parameters); + ParameterUtils.verifyNotNull("logger", logger); + this.parameters = parameters; - if (logger == null) { - throw new IllegalArgumentException("Logger cannot be null"); - } this.logger = logger; } diff --git a/src/main/java/biz/gabrys/maven/plugin/util/parameter/package-info.java b/src/main/java/biz/gabrys/maven/plugin/util/parameter/package-info.java index bbeb7ea..567143b 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/parameter/package-info.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/parameter/package-info.java @@ -11,6 +11,6 @@ * - a template of the License at https://opensource.org/licenses/BSD-3-Clause */ /** - * Contains utilities to operate on Mojos parameters. + * Contains utilities to operate on Mojos and methods parameters. */ package biz.gabrys.maven.plugin.util.parameter; diff --git a/src/test/java/biz/gabrys/maven/plugin/util/parameter/ParameterUtilsTest.java b/src/test/java/biz/gabrys/maven/plugin/util/parameter/ParameterUtilsTest.java new file mode 100644 index 0000000..7a0ece3 --- /dev/null +++ b/src/test/java/biz/gabrys/maven/plugin/util/parameter/ParameterUtilsTest.java @@ -0,0 +1,39 @@ +package biz.gabrys.maven.plugin.util.parameter; + +import java.util.ArrayList; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public final class ParameterUtilsTest { + + @Rule + public final ExpectedException expectedException = ExpectedException.none(); + + @Test + public void verifyNotNull_parameterValueIsNotNull_doNothing() { + ParameterUtils.verifyNotNull(null, "value"); + ParameterUtils.verifyNotNull(null, Boolean.FALSE); + ParameterUtils.verifyNotNull(null, new ArrayList()); + ParameterUtils.verifyNotNull("name", "value"); + ParameterUtils.verifyNotNull("name", Boolean.FALSE); + ParameterUtils.verifyNotNull("name", new ArrayList()); + } + + @Test + public void verifyNotNull_parameterNameAndValueAreNull_throwException() { + expectedException.expect(IllegalArgumentException.class); + expectedException.expectMessage("Parameter is null"); + + ParameterUtils.verifyNotNull(null, null); + } + + @Test + public void verifyNotNull_parameterNameIsNotNullAndValueIsNull_throwException() { + expectedException.expect(IllegalArgumentException.class); + expectedException.expectMessage("Parameter \"name\" is null"); + + ParameterUtils.verifyNotNull("name", null); + } +} diff --git a/xdocs/changelog.xml b/xdocs/changelog.xml index 135859d..1e87163 100644 --- a/xdocs/changelog.xml +++ b/xdocs/changelog.xml @@ -7,25 +7,44 @@ +
    +

    Features:

    + +

    Features:

    +

    See documentation

    +

    Features:

      @@ -49,6 +69,7 @@ package
    +

    See documentation

    Bugs:

    diff --git a/xdocs/index.xml.vm b/xdocs/index.xml.vm index 5ba0787..10c2e20 100644 --- a/xdocs/index.xml.vm +++ b/xdocs/index.xml.vm @@ -24,6 +24,11 @@ biz.gabrys.maven.plugin.util.parameter package)
  • +
  • + manage classpath (see + biz.gabrys.maven.plugin.util.classpath + package) +
  • count execution time (see biz.gabrys.maven.plugin.util.timer From 5cc346368a5a29c2d248f64bf6edc09effbe5fa3 Mon Sep 17 00:00:00 2001 From: agabrys Date: Sun, 30 Oct 2016 16:12:58 +0100 Subject: [PATCH 06/15] Upgrade license-maven-plugin to 3.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3f8d424..41a57a7 100644 --- a/pom.xml +++ b/pom.xml @@ -175,7 +175,7 @@ com.mycila license-maven-plugin - 2.11 + 3.0
    header-license-template.txt
    From b901456035363019e06e29da8e0a52a7c3a90bab Mon Sep 17 00:00:00 2001 From: agabrys Date: Mon, 31 Oct 2016 23:30:39 +0100 Subject: [PATCH 07/15] Add tests for ContextClassLoaderExtender --- .../classpath/ContextClassLoaderExtender.java | 34 +++-- .../ContextClassLoaderExtenderTest.java | 128 ++++++++++++++++++ .../AbstractValueToStringConverterTest.java | 4 +- .../AbstractSimpleSanitizerTest.java | 2 +- .../sanitizer/LazySimpleSanitizerTest.java | 20 ++- 5 files changed, 171 insertions(+), 17 deletions(-) create mode 100644 src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java diff --git a/src/main/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.java b/src/main/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.java index 7d9ddbb..57c78e2 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.java @@ -15,6 +15,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -40,6 +41,7 @@ public class ContextClassLoaderExtender { /** * Creates a new instance. * @param project the Maven project. + * @throws IllegalArgumentException if the Maven project is equal to {@code null}. * @since 1.4.0 */ public ContextClassLoaderExtender(final MavenProject project) { @@ -50,9 +52,11 @@ public ContextClassLoaderExtender(final MavenProject project) { * Creates a new instance. * @param project the Maven project. * @param logger the logger. + * @throws IllegalArgumentException if the Maven project is equal to {@code null}. * @since 1.4.0 */ public ContextClassLoaderExtender(final MavenProject project, final Log logger) { + ParameterUtils.verifyNotNull("project", project); this.project = project; this.logger = logger; } @@ -60,6 +64,7 @@ public ContextClassLoaderExtender(final MavenProject project, final Log logger) /** * Adds all dependencies with specified types to context class loader. * @param types the supported types. + * @throws IllegalArgumentException if the types are equal to {@code null}. * @since 1.4.0 */ public void addDependencies(final String... types) { @@ -70,6 +75,7 @@ public void addDependencies(final String... types) { /** * Adds all dependencies with specified types to context class loader. * @param types the supported types. + * @throws IllegalArgumentException if the types collection is equal to {@code null}. * @since 1.4.0 */ public void addDependencies(final Collection types) { @@ -78,8 +84,7 @@ public void addDependencies(final Collection types) { final Set artifacts = project.getArtifacts(); final List filtered = filterArtifacts(artifacts, types); final List urls = resolveArtifactsUrls(filtered); - final URLClassLoader classLoader = new URLClassLoader(urls.toArray(new URL[0]), Thread.currentThread().getContextClassLoader()); - Thread.currentThread().setContextClassLoader(classLoader); + addToContextClassLoader(urls); } /** @@ -92,11 +97,13 @@ public void addDependencies(final Collection types) { protected List filterArtifacts(final Collection artifacts, final Collection types) { final List filtered = new LinkedList(); for (final Artifact artifact : artifacts) { - if (!types.contains(artifact.getType())) { - logger.debug(String.format("Exclude %s", createDisplayString(artifact))); - } else { - logger.debug(String.format("Include %s", createDisplayString(artifact))); + if (types.contains(artifact.getType())) { + if (logger != null && logger.isDebugEnabled()) { + logger.debug(String.format("Include %s", createDisplayString(artifact))); + } filtered.add(artifact); + } else if (logger != null && logger.isDebugEnabled()) { + logger.debug(String.format("Exclude %s", createDisplayString(artifact))); } } return filtered; @@ -109,18 +116,29 @@ protected List filterArtifacts(final Collection artifacts, f * @since 1.4.0 */ protected List resolveArtifactsUrls(final Collection artifacts) { - final List urls = new LinkedList(); + final List urls = new ArrayList(artifacts.size()); for (final Artifact artifact : artifacts) { try { urls.add(artifact.getFile().toURI().toURL()); } catch (final MalformedURLException e) { // never - throw new IllegalStateException(String.format("Cannot add dependency %s to classpath!", createDisplayString(artifact)), e); + throw new IllegalStateException(String.format("Cannot add %s to the classpath!", createDisplayString(artifact)), e); } } return urls; } + /** + * Adds artifacts URLs to context class loader. + * @param urls the artifacts URLs. + * @since 1.4.0 + */ + protected void addToContextClassLoader(final List urls) { + final Thread currentThread = Thread.currentThread(); + final URLClassLoader classLoader = new URLClassLoader(urls.toArray(new URL[0]), currentThread.getContextClassLoader()); + currentThread.setContextClassLoader(classLoader); + } + /** * Creates a text representation of the {@link Artifact}. * @param artifact the artifact. diff --git a/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java b/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java new file mode 100644 index 0000000..7801f81 --- /dev/null +++ b/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java @@ -0,0 +1,128 @@ +package biz.gabrys.maven.plugin.util.classpath; + +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.project.MavenProject; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Matchers; +import org.mockito.Mockito; + +public final class ContextClassLoaderExtenderTest { + + private ContextClassLoaderExtender extender; + private MavenProject project; + private Log logger; + + @Before + public void setup() { + project = Mockito.mock(MavenProject.class); + logger = Mockito.mock(Log.class); + extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); + } + + @Test(expected = IllegalArgumentException.class) + public void addDependencies_arrayIsNull_throwException() { + extender.addDependencies((String[]) null); + } + + @Test + public void addDependencies_arrayIsNotNull_executeAddDependencies() { + final String[] types = new String[] { "jar", "duplicated", "duplicated", "war" }; + Mockito.doNothing().when(extender).addDependencies(Matchers.anySetOf(String.class)); + + extender.addDependencies(types); + + Mockito.verify(extender).addDependencies(types); + Mockito.verify(extender).addDependencies(Matchers.anySetOf(String.class)); + Mockito.verifyNoMoreInteractions(extender); + Mockito.verifyZeroInteractions(logger); + } + + @Test(expected = IllegalArgumentException.class) + public void addDependencies_collectionIsNull_throwException() { + extender.addDependencies((Collection) null); + } + + @Test + public void addDependencies_collectionIsNotNull_executeInternalLogic() { + final Set artifacts = new HashSet(); + Mockito.when(project.getArtifacts()).thenReturn(artifacts); + + final Collection types = Arrays.asList("jar", "war"); + final List filtered = new ArrayList(); + Mockito.doReturn(filtered).when(extender).filterArtifacts(artifacts, types); + + final List urls = new ArrayList(); + Mockito.doReturn(urls).when(extender).resolveArtifactsUrls(filtered); + + extender.addDependencies(types); + + Mockito.verify(extender).addDependencies(types); + Mockito.verify(extender).filterArtifacts(artifacts, types); + Mockito.verify(extender).resolveArtifactsUrls(filtered); + Mockito.verify(extender).addToContextClassLoader(urls); + Mockito.verifyNoMoreInteractions(extender); + Mockito.verifyZeroInteractions(logger); + } + + @Test + public void filterArtifacts_threeArtifactsAndOneShouldBeIgnored_returnTwoArtifacts() { + final Artifact artifact1 = Mockito.mock(Artifact.class); + Mockito.doReturn("artifact1").when(extender).createDisplayString(artifact1); + Mockito.when(artifact1.getType()).thenReturn("include"); + final Artifact artifact2 = Mockito.mock(Artifact.class); + Mockito.doReturn("artifact2").when(extender).createDisplayString(artifact2); + Mockito.when(artifact2.getType()).thenReturn("exclude"); + final Artifact artifact3 = Mockito.mock(Artifact.class); + Mockito.doReturn("artifact3").when(extender).createDisplayString(artifact3); + Mockito.when(artifact3.getType()).thenReturn("include"); + + final List artifacts = Arrays.asList(artifact1, artifact2, artifact3); + final List types = Arrays.asList("include"); + + Mockito.when(logger.isDebugEnabled()).thenReturn(Boolean.TRUE); + + final List filtered = extender.filterArtifacts(artifacts, types); + Assert.assertNotNull("Filtered collection instance", filtered); + Assert.assertEquals("Filtered collection size", 2, filtered.size()); + Assert.assertTrue("Filtered collection contains artifact1", filtered.contains(artifact1)); + Assert.assertTrue("Filtered collection contains artifact3", filtered.contains(artifact3)); + + Mockito.verify(extender).filterArtifacts(artifacts, types); + Mockito.verify(extender).createDisplayString(artifact1); + Mockito.verify(logger, Mockito.times(3)).isDebugEnabled(); + Mockito.verify(logger).debug("Include artifact1"); + Mockito.verify(extender).createDisplayString(artifact2); + Mockito.verify(logger).debug("Exclude artifact2"); + Mockito.verify(extender).createDisplayString(artifact3); + Mockito.verify(logger).debug("Include artifact3"); + Mockito.verifyNoMoreInteractions(extender, logger); + } + + @Test + public void createDisplayString() { + final Artifact artifact = Mockito.mock(Artifact.class); + Mockito.when(artifact.getGroupId()).thenReturn("groupId"); + Mockito.when(artifact.getArtifactId()).thenReturn("artifactId"); + Mockito.when(artifact.getVersion()).thenReturn("1.0"); + Mockito.when(artifact.getType()).thenReturn("jar"); + Mockito.when(artifact.getScope()).thenReturn("compile"); + + final String text = extender.createDisplayString(artifact); + Assert.assertEquals("Text representation", "groupId:artifactId-1.0.jar (compile)", text); + + Mockito.verify(extender).createDisplayString(artifact); + Mockito.verifyNoMoreInteractions(extender); + Mockito.verifyZeroInteractions(logger); + } +} diff --git a/src/test/java/biz/gabrys/maven/plugin/util/parameter/converter/AbstractValueToStringConverterTest.java b/src/test/java/biz/gabrys/maven/plugin/util/parameter/converter/AbstractValueToStringConverterTest.java index 48a2d62..25a4517 100644 --- a/src/test/java/biz/gabrys/maven/plugin/util/parameter/converter/AbstractValueToStringConverterTest.java +++ b/src/test/java/biz/gabrys/maven/plugin/util/parameter/converter/AbstractValueToStringConverterTest.java @@ -46,7 +46,7 @@ public void convert_nullConverterAndNotNullObject_returnsString() { Mockito.verifyNoMoreInteractions(converter); } - private static class NotNullConverter extends AbstractValueToStringConverter { + public static class NotNullConverter extends AbstractValueToStringConverter { private static final String RETURNED_VALUE = "not null"; @@ -56,7 +56,7 @@ protected String convert2(final Object value) { } } - private static class NullConverter extends AbstractValueToStringConverter { + public static class NullConverter extends AbstractValueToStringConverter { @Override protected String convert2(final Object value) { diff --git a/src/test/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/AbstractSimpleSanitizerTest.java b/src/test/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/AbstractSimpleSanitizerTest.java index ac4b782..17a3493 100644 --- a/src/test/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/AbstractSimpleSanitizerTest.java +++ b/src/test/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/AbstractSimpleSanitizerTest.java @@ -49,7 +49,7 @@ public void sanitize_conditionIsFalse_executesSanitize2() { Mockito.verifyZeroInteractions(value); } - private static class SimpleSanitizerImpl extends AbstractSimpleSanitizer { + public static class SimpleSanitizerImpl extends AbstractSimpleSanitizer { protected SimpleSanitizerImpl(final boolean valid) { super(valid); diff --git a/src/test/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/LazySimpleSanitizerTest.java b/src/test/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/LazySimpleSanitizerTest.java index e62d8d0..6ab55fe 100644 --- a/src/test/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/LazySimpleSanitizerTest.java +++ b/src/test/java/biz/gabrys/maven/plugin/util/parameter/sanitizer/LazySimpleSanitizerTest.java @@ -11,12 +11,7 @@ public final class LazySimpleSanitizerTest { @Test public void sanitize2() { final Object sanitizedValue = Mockito.mock(Object.class); - final ValueContainer container = Mockito.spy(new ValueContainer() { - - public Object getValue() { - return sanitizedValue; - } - }); + final ValueContainer container = Mockito.spy(new ValueContainerImpl(sanitizedValue)); final LazySimpleSanitizer sanitizer = new LazySimpleSanitizer(true, container); final Object value = Mockito.mock(Object.class); @@ -27,4 +22,17 @@ public Object getValue() { Mockito.verifyNoMoreInteractions(container); Mockito.verifyZeroInteractions(sanitizedValue, value); } + + public static class ValueContainerImpl implements ValueContainer { + + private final Object value; + + public ValueContainerImpl(final Object value) { + this.value = value; + } + + public Object getValue() { + return value; + } + } } From 55722ebedda565cc7cf124a69f245c85385ce48f Mon Sep 17 00:00:00 2001 From: agabrys Date: Mon, 31 Oct 2016 23:51:27 +0100 Subject: [PATCH 08/15] Extends ContextClassLoaderExtenderTest --- .../ContextClassLoaderExtenderTest.java | 46 +++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java b/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java index 7801f81..de0d3a9 100644 --- a/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java +++ b/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java @@ -19,7 +19,6 @@ public final class ContextClassLoaderExtenderTest { - private ContextClassLoaderExtender extender; private MavenProject project; private Log logger; @@ -27,16 +26,19 @@ public final class ContextClassLoaderExtenderTest { public void setup() { project = Mockito.mock(MavenProject.class); logger = Mockito.mock(Log.class); - extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); } @Test(expected = IllegalArgumentException.class) public void addDependencies_arrayIsNull_throwException() { + final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); + extender.addDependencies((String[]) null); } @Test public void addDependencies_arrayIsNotNull_executeAddDependencies() { + final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); + final String[] types = new String[] { "jar", "duplicated", "duplicated", "war" }; Mockito.doNothing().when(extender).addDependencies(Matchers.anySetOf(String.class)); @@ -50,11 +52,15 @@ public void addDependencies_arrayIsNotNull_executeAddDependencies() { @Test(expected = IllegalArgumentException.class) public void addDependencies_collectionIsNull_throwException() { + final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); + extender.addDependencies((Collection) null); } @Test public void addDependencies_collectionIsNotNull_executeInternalLogic() { + final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); + final Set artifacts = new HashSet(); Mockito.when(project.getArtifacts()).thenReturn(artifacts); @@ -76,7 +82,9 @@ public void addDependencies_collectionIsNotNull_executeInternalLogic() { } @Test - public void filterArtifacts_threeArtifactsAndOneShouldBeIgnored_returnTwoArtifacts() { + public void filterArtifacts_logggerIsNotNullThreeArtifactsAndOneShouldBeIgnored_returnTwoArtifacts() { + final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); + final Artifact artifact1 = Mockito.mock(Artifact.class); Mockito.doReturn("artifact1").when(extender).createDisplayString(artifact1); Mockito.when(artifact1.getType()).thenReturn("include"); @@ -109,8 +117,40 @@ public void filterArtifacts_threeArtifactsAndOneShouldBeIgnored_returnTwoArtifac Mockito.verifyNoMoreInteractions(extender, logger); } + @Test + public void filterArtifacts_loggerIsNullThreeArtifactsAndOneShouldBeIgnored_returnTwoArtifacts() { + final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project)); + + final Artifact artifact1 = Mockito.mock(Artifact.class); + Mockito.doReturn("artifact1").when(extender).createDisplayString(artifact1); + Mockito.when(artifact1.getType()).thenReturn("include"); + final Artifact artifact2 = Mockito.mock(Artifact.class); + Mockito.doReturn("artifact2").when(extender).createDisplayString(artifact2); + Mockito.when(artifact2.getType()).thenReturn("exclude"); + final Artifact artifact3 = Mockito.mock(Artifact.class); + Mockito.doReturn("artifact3").when(extender).createDisplayString(artifact3); + Mockito.when(artifact3.getType()).thenReturn("include"); + + final List artifacts = Arrays.asList(artifact1, artifact2, artifact3); + final List types = Arrays.asList("include"); + + Mockito.when(logger.isDebugEnabled()).thenReturn(Boolean.TRUE); + + final List filtered = extender.filterArtifacts(artifacts, types); + Assert.assertNotNull("Filtered collection instance", filtered); + Assert.assertEquals("Filtered collection size", 2, filtered.size()); + Assert.assertTrue("Filtered collection contains artifact1", filtered.contains(artifact1)); + Assert.assertTrue("Filtered collection contains artifact3", filtered.contains(artifact3)); + + Mockito.verify(extender).filterArtifacts(artifacts, types); + Mockito.verifyNoMoreInteractions(extender, logger); + Mockito.verifyZeroInteractions(logger); + } + @Test public void createDisplayString() { + final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); + final Artifact artifact = Mockito.mock(Artifact.class); Mockito.when(artifact.getGroupId()).thenReturn("groupId"); Mockito.when(artifact.getArtifactId()).thenReturn("artifactId"); From c3856b4a6c0854b7d708506f5591ae3d44362617 Mon Sep 17 00:00:00 2001 From: agabrys Date: Fri, 4 Nov 2016 12:57:59 +0100 Subject: [PATCH 09/15] refactor ContextClassLoaderExtender (logger cannot be null, rename method createDisplayString). --- .../classpath/ContextClassLoaderExtender.java | 25 +++------- .../ContextClassLoaderExtenderTest.java | 50 ++++--------------- 2 files changed, 18 insertions(+), 57 deletions(-) diff --git a/src/main/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.java b/src/main/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.java index 57c78e2..bfee048 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.java @@ -38,25 +38,16 @@ public class ContextClassLoaderExtender { private final MavenProject project; private final Log logger; - /** - * Creates a new instance. - * @param project the Maven project. - * @throws IllegalArgumentException if the Maven project is equal to {@code null}. - * @since 1.4.0 - */ - public ContextClassLoaderExtender(final MavenProject project) { - this(project, null); - } - /** * Creates a new instance. * @param project the Maven project. * @param logger the logger. - * @throws IllegalArgumentException if the Maven project is equal to {@code null}. + * @throws IllegalArgumentException if the Maven project or/and the logger is equal to {@code null}. * @since 1.4.0 */ public ContextClassLoaderExtender(final MavenProject project, final Log logger) { ParameterUtils.verifyNotNull("project", project); + ParameterUtils.verifyNotNull("logger", logger); this.project = project; this.logger = logger; } @@ -98,12 +89,12 @@ protected List filterArtifacts(final Collection artifacts, f final List filtered = new LinkedList(); for (final Artifact artifact : artifacts) { if (types.contains(artifact.getType())) { - if (logger != null && logger.isDebugEnabled()) { - logger.debug(String.format("Include %s", createDisplayString(artifact))); + if (logger.isDebugEnabled()) { + logger.debug(String.format("Include %s", createDisplayText(artifact))); } filtered.add(artifact); - } else if (logger != null && logger.isDebugEnabled()) { - logger.debug(String.format("Exclude %s", createDisplayString(artifact))); + } else if (logger.isDebugEnabled()) { + logger.debug(String.format("Exclude %s", createDisplayText(artifact))); } } return filtered; @@ -122,7 +113,7 @@ protected List resolveArtifactsUrls(final Collection artifacts) { urls.add(artifact.getFile().toURI().toURL()); } catch (final MalformedURLException e) { // never - throw new IllegalStateException(String.format("Cannot add %s to the classpath!", createDisplayString(artifact)), e); + throw new IllegalStateException(String.format("Cannot add %s to the classpath!", createDisplayText(artifact)), e); } } return urls; @@ -145,7 +136,7 @@ protected void addToContextClassLoader(final List urls) { * @return the text representation of the {@link Artifact}. * @since 1.4.0 */ - protected String createDisplayString(final Artifact artifact) { + protected String createDisplayText(final Artifact artifact) { return String.format("%s:%s-%s.%s (%s)", artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getScope()); } diff --git a/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java b/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java index de0d3a9..9651120 100644 --- a/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java +++ b/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java @@ -82,17 +82,17 @@ public void addDependencies_collectionIsNotNull_executeInternalLogic() { } @Test - public void filterArtifacts_logggerIsNotNullThreeArtifactsAndOneShouldBeIgnored_returnTwoArtifacts() { + public void filterArtifacts_threeArtifactsAndOneShouldBeIgnored_returnTwoArtifacts() { final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); final Artifact artifact1 = Mockito.mock(Artifact.class); - Mockito.doReturn("artifact1").when(extender).createDisplayString(artifact1); + Mockito.doReturn("artifact1").when(extender).createDisplayText(artifact1); Mockito.when(artifact1.getType()).thenReturn("include"); final Artifact artifact2 = Mockito.mock(Artifact.class); - Mockito.doReturn("artifact2").when(extender).createDisplayString(artifact2); + Mockito.doReturn("artifact2").when(extender).createDisplayText(artifact2); Mockito.when(artifact2.getType()).thenReturn("exclude"); final Artifact artifact3 = Mockito.mock(Artifact.class); - Mockito.doReturn("artifact3").when(extender).createDisplayString(artifact3); + Mockito.doReturn("artifact3").when(extender).createDisplayText(artifact3); Mockito.when(artifact3.getType()).thenReturn("include"); final List artifacts = Arrays.asList(artifact1, artifact2, artifact3); @@ -107,48 +107,18 @@ public void filterArtifacts_logggerIsNotNullThreeArtifactsAndOneShouldBeIgnored_ Assert.assertTrue("Filtered collection contains artifact3", filtered.contains(artifact3)); Mockito.verify(extender).filterArtifacts(artifacts, types); - Mockito.verify(extender).createDisplayString(artifact1); + Mockito.verify(extender).createDisplayText(artifact1); Mockito.verify(logger, Mockito.times(3)).isDebugEnabled(); Mockito.verify(logger).debug("Include artifact1"); - Mockito.verify(extender).createDisplayString(artifact2); + Mockito.verify(extender).createDisplayText(artifact2); Mockito.verify(logger).debug("Exclude artifact2"); - Mockito.verify(extender).createDisplayString(artifact3); + Mockito.verify(extender).createDisplayText(artifact3); Mockito.verify(logger).debug("Include artifact3"); Mockito.verifyNoMoreInteractions(extender, logger); } @Test - public void filterArtifacts_loggerIsNullThreeArtifactsAndOneShouldBeIgnored_returnTwoArtifacts() { - final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project)); - - final Artifact artifact1 = Mockito.mock(Artifact.class); - Mockito.doReturn("artifact1").when(extender).createDisplayString(artifact1); - Mockito.when(artifact1.getType()).thenReturn("include"); - final Artifact artifact2 = Mockito.mock(Artifact.class); - Mockito.doReturn("artifact2").when(extender).createDisplayString(artifact2); - Mockito.when(artifact2.getType()).thenReturn("exclude"); - final Artifact artifact3 = Mockito.mock(Artifact.class); - Mockito.doReturn("artifact3").when(extender).createDisplayString(artifact3); - Mockito.when(artifact3.getType()).thenReturn("include"); - - final List artifacts = Arrays.asList(artifact1, artifact2, artifact3); - final List types = Arrays.asList("include"); - - Mockito.when(logger.isDebugEnabled()).thenReturn(Boolean.TRUE); - - final List filtered = extender.filterArtifacts(artifacts, types); - Assert.assertNotNull("Filtered collection instance", filtered); - Assert.assertEquals("Filtered collection size", 2, filtered.size()); - Assert.assertTrue("Filtered collection contains artifact1", filtered.contains(artifact1)); - Assert.assertTrue("Filtered collection contains artifact3", filtered.contains(artifact3)); - - Mockito.verify(extender).filterArtifacts(artifacts, types); - Mockito.verifyNoMoreInteractions(extender, logger); - Mockito.verifyZeroInteractions(logger); - } - - @Test - public void createDisplayString() { + public void createDisplayText() { final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); final Artifact artifact = Mockito.mock(Artifact.class); @@ -158,10 +128,10 @@ public void createDisplayString() { Mockito.when(artifact.getType()).thenReturn("jar"); Mockito.when(artifact.getScope()).thenReturn("compile"); - final String text = extender.createDisplayString(artifact); + final String text = extender.createDisplayText(artifact); Assert.assertEquals("Text representation", "groupId:artifactId-1.0.jar (compile)", text); - Mockito.verify(extender).createDisplayString(artifact); + Mockito.verify(extender).createDisplayText(artifact); Mockito.verifyNoMoreInteractions(extender); Mockito.verifyZeroInteractions(logger); } From f78cc979bfb4dce2b3017d47969dfb8665b2997e Mon Sep 17 00:00:00 2001 From: agabrys Date: Fri, 4 Nov 2016 14:44:47 +0100 Subject: [PATCH 10/15] change Time#tostring method logic --- CHANGELOG.md | 1 + pom.xml | 2 +- .../gabrys/maven/plugin/util/timer/Time.java | 64 +++++++++++++------ .../ContextClassLoaderExtenderTest.java | 10 +-- .../maven/plugin/util/timer/TimeTest.java | 26 ++++---- xdocs/changelog.xml | 7 ++ 6 files changed, 73 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2a3c43..31b5e81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Features: * Added [ContextClassLoaderExtender](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.html) responsible for adding Maven project dependencies to classpath * Added [ParameterUtils](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/parameter/ParameterUtils.html) which provides tools to work with method parameters +* Separation of the seconds and milliseconds in the [Time#toString()](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/timer/Time.html) method ## 1.3.0 Features: diff --git a/pom.xml b/pom.xml index 41a57a7..4e7c1ef 100644 --- a/pom.xml +++ b/pom.xml @@ -144,7 +144,7 @@ https://maven.apache.org/ref/2.0.11/apidocs http://codehaus-plexus.github.io/plexus-utils/apidocs - http://commons.apache.org/proper/commons-io/javadocs/api-2.2 + https://commons.apache.org/proper/commons-io/javadocs/api-2.2
    diff --git a/src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java b/src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java index 0876af7..2897a41 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java @@ -63,18 +63,19 @@ public boolean equals(final Object obj) { * Returns a string representation of the time in human-readable format. Examples: * *
    -     * 0.000 seconds
    -     * 0.589 seconds
    -     * 1.000 second
    -     * 57.042 seconds
    -     * 1 minute 0.000 seconds
    -     * 7 minutes 1.000 second
    -     * 12 minutes 28.321 seconds
    -     * 1 hour 0 minutes 0.000 seconds
    -     * 5 hours 0 minutes 0.000 seconds
    -     * 5 hours 1 minute 1.000 second
    -     * 5 hours 1 minute 54.132 seconds
    -     * 5 hours 9 minutes 4.123 seconds
    +     * 0 seconds
    +     * 589 milliseconds
    +     * 1 second
    +     * 57 seconds 42 milliseconds
    +     * 1 minute
    +     * 2 minutes 1 millisecond
    +     * 7 minutes 1 second
    +     * 12 minutes 28 seconds 321 milliseconds
    +     * 1 hour
    +     * 5 hours
    +     * 5 hours 1 second
    +     * 5 hours 1 minute 54 seconds 132 milliseconds
    +     * 5 hours 9 minutes 4 seconds 123 milliseconds
          * 
    * * @return a string representation of the time in human-readable format. @@ -95,14 +96,39 @@ public String toString() { final StringBuilder time = new StringBuilder(); if (hours > 0) { - time.append(hours); - time.append(String.format(" hour%s ", hours == 1 ? "" : "s")); + appendTimeWithUnit(time, hours, "hour"); } - if (hours > 0 || minutes > 0) { - time.append(minutes); - time.append(String.format(" minute%s ", minutes == 1 ? "" : "s")); + if (minutes > 0) { + appendTimeWithUnit(time, minutes, "minute"); + } + if (seconds > 0) { + appendTimeWithUnit(time, seconds, "second"); + } + if (millis > 0) { + appendTimeWithUnit(time, millis, "millisecond"); + } + final String text = time.toString(); + if (text.length() == 0) { + return createText(0, "second"); + } + return text; + } + + private static void appendTimeWithUnit(final StringBuilder text, final long time, final String unit) { + if (text.length() > 0) { + text.append(' '); + } + text.append(createText(time, unit)); + } + + private static String createText(final long value, final String unit) { + final StringBuilder text = new StringBuilder(); + text.append(value); + text.append(' '); + text.append(unit); + if (value != 1) { + text.append('s'); } - time.append(String.format("%s.%03d second%s", seconds, millis, seconds == 1 && millis == 0 ? "" : "s")); - return time.toString(); + return text.toString(); } } diff --git a/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java b/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java index 9651120..cb10e07 100644 --- a/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java +++ b/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java @@ -101,10 +101,10 @@ public void filterArtifacts_threeArtifactsAndOneShouldBeIgnored_returnTwoArtifac Mockito.when(logger.isDebugEnabled()).thenReturn(Boolean.TRUE); final List filtered = extender.filterArtifacts(artifacts, types); - Assert.assertNotNull("Filtered collection instance", filtered); - Assert.assertEquals("Filtered collection size", 2, filtered.size()); - Assert.assertTrue("Filtered collection contains artifact1", filtered.contains(artifact1)); - Assert.assertTrue("Filtered collection contains artifact3", filtered.contains(artifact3)); + Assert.assertNotNull("Filtered collection instance.", filtered); + Assert.assertEquals("Filtered collection size.", 2, filtered.size()); + Assert.assertTrue("Filtered collection contains artifact1.", filtered.contains(artifact1)); + Assert.assertTrue("Filtered collection contains artifact3.", filtered.contains(artifact3)); Mockito.verify(extender).filterArtifacts(artifacts, types); Mockito.verify(extender).createDisplayText(artifact1); @@ -129,7 +129,7 @@ public void createDisplayText() { Mockito.when(artifact.getScope()).thenReturn("compile"); final String text = extender.createDisplayText(artifact); - Assert.assertEquals("Text representation", "groupId:artifactId-1.0.jar (compile)", text); + Assert.assertEquals("Text representation.", "groupId:artifactId-1.0.jar (compile)", text); Mockito.verify(extender).createDisplayText(artifact); Mockito.verifyNoMoreInteractions(extender); diff --git a/src/test/java/biz/gabrys/maven/plugin/util/timer/TimeTest.java b/src/test/java/biz/gabrys/maven/plugin/util/timer/TimeTest.java index 014496e..99d00f6 100644 --- a/src/test/java/biz/gabrys/maven/plugin/util/timer/TimeTest.java +++ b/src/test/java/biz/gabrys/maven/plugin/util/timer/TimeTest.java @@ -18,19 +18,21 @@ public void equals() { @Test public void testToString() { - Assert.assertEquals("0 seconds.", "0.000 seconds", new Time(0L).toString()); - Assert.assertEquals("589 milliseconds.", "0.589 seconds", new Time(589L).toString()); - Assert.assertEquals("1 second.", "1.000 second", new Time(1000L).toString()); - Assert.assertEquals("57 seconds 42 milliseconds.", "57.042 seconds", new Time(57042L).toString()); - Assert.assertEquals("1 minute.", "1 minute 0.000 seconds", new Time(60000L).toString()); - Assert.assertEquals("7 minutes 1 second.", "7 minutes 1.000 second", new Time(421000L).toString()); - Assert.assertEquals("12 minutes 28 seconds 321 milliseconds.", "12 minutes 28.321 seconds", new Time(748321L).toString()); - Assert.assertEquals("1 hour.", "1 hour 0 minutes 0.000 seconds", new Time(3600000L).toString()); - Assert.assertEquals("5 hours.", "5 hours 0 minutes 0.000 seconds", new Time(18000000L).toString()); - Assert.assertEquals("5 hours 1 minute 1 second.", "5 hours 1 minute 1.000 second", new Time(18061000L).toString()); - Assert.assertEquals("5 hours 1 minute 54 seconds 132 milliseconds.", "5 hours 1 minute 54.132 seconds", + Assert.assertEquals("0 seconds.", "0 seconds", new Time(0L).toString()); + Assert.assertEquals("589 milliseconds.", "589 milliseconds", new Time(589L).toString()); + Assert.assertEquals("1 second.", "1 second", new Time(1000L).toString()); + Assert.assertEquals("57 seconds 42 milliseconds.", "57 seconds 42 milliseconds", new Time(57042L).toString()); + Assert.assertEquals("1 minute.", "1 minute", new Time(60000L).toString()); + Assert.assertEquals("2 minutes 1 millisecond.", "2 minutes 1 millisecond", new Time(120001L).toString()); + Assert.assertEquals("7 minutes 1 second.", "7 minutes 1 second", new Time(421000L).toString()); + Assert.assertEquals("12 minutes 28 seconds 321 milliseconds.", "12 minutes 28 seconds 321 milliseconds", + new Time(748321L).toString()); + Assert.assertEquals("1 hour.", "1 hour", new Time(3600000L).toString()); + Assert.assertEquals("5 hours.", "5 hours", new Time(18000000L).toString()); + Assert.assertEquals("5 hours 1 second.", "5 hours 1 second", new Time(18001000L).toString()); + Assert.assertEquals("5 hours 1 minute 54 seconds 132 milliseconds.", "5 hours 1 minute 54 seconds 132 milliseconds", new Time(18114132L).toString()); - Assert.assertEquals("5 hours 9 minutes 4 seconds 123 milliseconds.", "5 hours 9 minutes 4.123 seconds", + Assert.assertEquals("5 hours 9 minutes 4 seconds 123 milliseconds.", "5 hours 9 minutes 4 seconds 123 milliseconds", new Time(18544123L).toString()); } } diff --git a/xdocs/changelog.xml b/xdocs/changelog.xml index 1e87163..ead69b2 100644 --- a/xdocs/changelog.xml +++ b/xdocs/changelog.xml @@ -24,6 +24,13 @@ which provides tools to work with method parameters
  • +
  • + Separation of the seconds and milliseconds in the + + Time#toString() + + method +
From dd1642991b56cc1dbef4366a63b490d6568eaa4d Mon Sep 17 00:00:00 2001 From: agabrys Date: Fri, 4 Nov 2016 14:49:39 +0100 Subject: [PATCH 11/15] upgrade maven-compiler-plugin to 3.6.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4e7c1ef..d774910 100644 --- a/pom.xml +++ b/pom.xml @@ -119,7 +119,7 @@ maven-compiler-plugin - 3.5.1 + 3.6.0 maven-deploy-plugin From 388e26f1f43f0b83e12121f2c813e79dce3bab61 Mon Sep 17 00:00:00 2001 From: agabrys Date: Fri, 4 Nov 2016 16:44:14 +0100 Subject: [PATCH 12/15] extends ContextClassLoaderExtenderTest --- .../ContextClassLoaderExtenderTest.java | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java b/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java index cb10e07..29edd92 100644 --- a/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java +++ b/src/test/java/biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtenderTest.java @@ -82,7 +82,7 @@ public void addDependencies_collectionIsNotNull_executeInternalLogic() { } @Test - public void filterArtifacts_threeArtifactsAndOneShouldBeIgnored_returnTwoArtifacts() { + public void filterArtifacts_loggerEnabledAndThreeArtifactsAndOneShouldBeIgnored_logsDataAndReturnTwoArtifacts() { final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); final Artifact artifact1 = Mockito.mock(Artifact.class); @@ -117,6 +117,36 @@ public void filterArtifacts_threeArtifactsAndOneShouldBeIgnored_returnTwoArtifac Mockito.verifyNoMoreInteractions(extender, logger); } + @Test + public void filterArtifacts_loggerDisabledAndThreeArtifactsAndOneShouldBeIgnored_logsDataAndReturnTwoArtifacts() { + final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); + + final Artifact artifact1 = Mockito.mock(Artifact.class); + Mockito.doReturn("artifact1").when(extender).createDisplayText(artifact1); + Mockito.when(artifact1.getType()).thenReturn("include"); + final Artifact artifact2 = Mockito.mock(Artifact.class); + Mockito.doReturn("artifact2").when(extender).createDisplayText(artifact2); + Mockito.when(artifact2.getType()).thenReturn("exclude"); + final Artifact artifact3 = Mockito.mock(Artifact.class); + Mockito.doReturn("artifact3").when(extender).createDisplayText(artifact3); + Mockito.when(artifact3.getType()).thenReturn("include"); + + final List artifacts = Arrays.asList(artifact1, artifact2, artifact3); + final List types = Arrays.asList("include"); + + Mockito.when(logger.isDebugEnabled()).thenReturn(Boolean.FALSE); + + final List filtered = extender.filterArtifacts(artifacts, types); + Assert.assertNotNull("Filtered collection instance.", filtered); + Assert.assertEquals("Filtered collection size.", 2, filtered.size()); + Assert.assertTrue("Filtered collection contains artifact1.", filtered.contains(artifact1)); + Assert.assertTrue("Filtered collection contains artifact3.", filtered.contains(artifact3)); + + Mockito.verify(extender).filterArtifacts(artifacts, types); + Mockito.verify(logger, Mockito.times(3)).isDebugEnabled(); + Mockito.verifyNoMoreInteractions(extender, logger); + } + @Test public void createDisplayText() { final ContextClassLoaderExtender extender = Mockito.spy(new ContextClassLoaderExtender(project, logger)); From ad900a74f75dd9f9a00c6e59a74d609690b5e013 Mon Sep 17 00:00:00 2001 From: agabrys Date: Fri, 4 Nov 2016 16:58:21 +0100 Subject: [PATCH 13/15] prepare changelog to 1.4.0 release --- CHANGELOG.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31b5e81..a4a4c90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,11 @@ ## 1.4.0 Features: -* Added [ContextClassLoaderExtender](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.html) responsible for adding Maven project dependencies to classpath -* Added [ParameterUtils](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/parameter/ParameterUtils.html) which provides tools to work with method parameters -* Separation of the seconds and milliseconds in the [Time#toString()](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/timer/Time.html) method +* Added [ContextClassLoaderExtender](http://maven-plugin-utils.projects.gabrys.biz/1.4.0/apidocs/index.html?biz/gabrys/maven/plugin/util/classpath/ContextClassLoaderExtender.html) responsible for adding Maven project dependencies to classpath +* Added [ParameterUtils](http://maven-plugin-utils.projects.gabrys.biz/1.4.0/apidocs/index.html?biz/gabrys/maven/plugin/util/parameter/ParameterUtils.html) which provides tools to work with method parameters +* Separation of the seconds and milliseconds in the [Time#toString()](http://maven-plugin-utils.projects.gabrys.biz/1.4.0/apidocs/index.html?biz/gabrys/maven/plugin/util/timer/Time.html) method + +[See documentation](http://maven-plugin-utils.projects.gabrys.biz/1.4.0/) ## 1.3.0 Features: From 311e8b9fef9643908e84f89f24d77fc4bbbb2803 Mon Sep 17 00:00:00 2001 From: agabrys Date: Fri, 4 Nov 2016 17:08:16 +0100 Subject: [PATCH 14/15] Correct @since for Time#toString --- src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java b/src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java index 2897a41..3dd5729 100644 --- a/src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java +++ b/src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java @@ -79,7 +79,7 @@ public boolean equals(final Object obj) { * * * @return a string representation of the time in human-readable format. - * @since 1.3.0 + * @since 1.4.0 */ @Override public String toString() { From 17c4ee9bc9531036623e99600d21e450f1fb0077 Mon Sep 17 00:00:00 2001 From: agabrys Date: Fri, 4 Nov 2016 17:09:19 +0100 Subject: [PATCH 15/15] Release 1.4.0 --- README.md | 18 +++++++++--------- pom.xml | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3b1d2b2..f0fbebe 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ # About [![License BSD 3-Clause](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](http://maven-plugin-utils.projects.gabrys.biz/license.txt) -[![Build Status](https://travis-ci.org/gabrysbiz/maven-plugin-utils.svg?branch=develop)](https://travis-ci.org/gabrysbiz/maven-plugin-utils) +[![Build Status](https://travis-ci.org/gabrysbiz/maven-plugin-utils.svg?branch=release%2F1.4.0)](https://travis-ci.org/gabrysbiz/maven-plugin-utils) Maven Plugin Utils is a Java library which contains utilities for [Maven 2](https://maven.apache.org/) plugins. It contains tools to: -* scan directories for files and create a virtual (not physical) destination file in the output directory based on the source (see [biz.gabrys.maven.plugin.util.io](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/io/package-summary.html) package) -* log Mojos parameters (see [biz.gabrys.maven.plugin.util.parameter](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/parameter/package-summary.html) package) -* manage classpath (see [biz.gabrys.maven.plugin.util.classpath](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/classpath/package-summary.html) package) -* count execution time (see [biz.gabrys.maven.plugin.util.timer](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/index.html?biz/gabrys/maven/plugin/util/timer/package-summary.html) package) +* scan directories for files and create a virtual (not physical) destination file in the output directory based on the source (see [biz.gabrys.maven.plugin.util.io](http://maven-plugin-utils.projects.gabrys.biz/1.4.0/apidocs/index.html?biz/gabrys/maven/plugin/util/io/package-summary.html) package) +* log Mojos parameters (see [biz.gabrys.maven.plugin.util.parameter](http://maven-plugin-utils.projects.gabrys.biz/1.4.0/apidocs/index.html?biz/gabrys/maven/plugin/util/parameter/package-summary.html) package) +* manage classpath (see [biz.gabrys.maven.plugin.util.classpath](http://maven-plugin-utils.projects.gabrys.biz/1.4.0/apidocs/index.html?biz/gabrys/maven/plugin/util/classpath/package-summary.html) package) +* count execution time (see [biz.gabrys.maven.plugin.util.timer](http://maven-plugin-utils.projects.gabrys.biz/1.4.0/apidocs/index.html?biz/gabrys/maven/plugin/util/timer/package-summary.html) package) -Read [API documentation](http://maven-plugin-utils.projects.gabrys.biz/LATEST/apidocs/) for more information. +Read [API documentation](http://maven-plugin-utils.projects.gabrys.biz/1.4.0/apidocs/) for more information. # Requirements The library to run requires: * Java 5.0 or higher -* Third-Party Dependencies ([see list](http://maven-plugin-utils.projects.gabrys.biz/LATEST/dependencies.html)) +* Third-Party Dependencies ([see list](http://maven-plugin-utils.projects.gabrys.biz/1.4.0/dependencies.html)) # Download -You can download the library from [this page](http://maven-plugin-utils.projects.gabrys.biz/LATEST/download.html) -or using various [dependency management tools](http://maven-plugin-utils.projects.gabrys.biz/LATEST/dependency-info.html). +You can download the library from [this page](http://maven-plugin-utils.projects.gabrys.biz/1.4.0/download.html) +or using various [dependency management tools](http://maven-plugin-utils.projects.gabrys.biz/1.4.0/dependency-info.html). diff --git a/pom.xml b/pom.xml index d774910..981a55f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,10 +5,10 @@ biz.gabrys.maven plugin-utils - 1.4.0-SNAPSHOT + 1.4.0 Maven Plugin Utils A Java library which contains utilities for Maven 2 plugins. - http://maven-plugin-utils.projects.gabrys.biz/LATEST/ + http://maven-plugin-utils.projects.gabrys.biz/1.4.0/ 2015