From 61b894867deb01f308882497b81ce2506b8836d1 Mon Sep 17 00:00:00 2001 From: agabrys Date: Sun, 15 May 2016 15:22:01 +0200 Subject: [PATCH 01/15] Correct travis badge. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 029d413..ea1a188 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Directory Content Maven Plugin [![License BSD 3-Clause](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](https://directory-content-maven-plugin.projects.gabrys.biz/license.txt) -[![Build Status](https://travis-ci.org/gabrysbiz/directory-content-maven-plugin.svg?branch=master)](https://travis-ci.org/gabrysbiz/directory-content-maven-plugin) +[![Build Status](https://travis-ci.org/gabrysbiz/directory-content-maven-plugin.svg?branch=develop)](https://travis-ci.org/gabrysbiz/directory-content-maven-plugin) Provides a collection of tools for working with directories. From c00e610bd13372d6c476c4a2d7578102d90b69b3 Mon Sep 17 00:00:00 2001 From: agabrys Date: Sun, 15 May 2016 15:30:53 +0200 Subject: [PATCH 02/15] Prepare for next development iteration and upgrade Maven plugins --- CHANGELOG.md | 6 ++++++ pom.xml | 14 +++++++------- src/site/site.xml | 1 + xdocs/changelog.xml | 15 +++++++++++++++ 4 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 xdocs/changelog.xml diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f872ca9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Directory Content Maven Plugin Changelog + +## 1.0 +Initial release. + +[See documentation](http://directory-content-maven-plugin.projects.gabrys.biz/1.0/) \ No newline at end of file diff --git a/pom.xml b/pom.xml index e9c636c..6015700 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ biz.gabrys.maven.plugins directory-content-maven-plugin - 1.0-SNAPSHOT + 1.1-SNAPSHOT maven-plugin Directory Content Maven Plugin Provides a collection of tools for working with directories. @@ -136,7 +136,7 @@ maven-compiler-plugin - 3.3 + 3.5.1 maven-deploy-plugin @@ -163,7 +163,7 @@ maven-project-info-reports-plugin - 2.8.1 + 2.9 maven-resources-plugin @@ -171,15 +171,15 @@ maven-site-plugin - 3.4 + 3.5.1 maven-source-plugin - 2.4 + 3.0.0 maven-surefire-plugin - 2.19 + 2.19.1 com.mycila @@ -201,7 +201,7 @@ org.jacoco jacoco-maven-plugin - 0.7.5.201505241946 + 0.7.6.201602180812 diff --git a/src/site/site.xml b/src/site/site.xml index 1a9a057..7bcede6 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -33,6 +33,7 @@ + diff --git a/xdocs/changelog.xml b/xdocs/changelog.xml new file mode 100644 index 0000000..e18dd79 --- /dev/null +++ b/xdocs/changelog.xml @@ -0,0 +1,15 @@ + + + + + Changelog + + + +
+

Initial release.

+

See documentation

+
+ +
\ No newline at end of file From 2965f10c7b6e0ff919f2c07516527249ad440adc Mon Sep 17 00:00:00 2001 From: agabrys Date: Sun, 15 May 2016 15:36:45 +0200 Subject: [PATCH 03/15] Upgrade maven-fluido-skin to 1.5 --- src/site/site.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site/site.xml b/src/site/site.xml index 7bcede6..b4c8fa5 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -9,7 +9,7 @@ org.apache.maven.skins maven-fluido-skin - 1.4 + 1.5 From a87c1c5b0cb97ab08427f1842b121a0e94361468 Mon Sep 17 00:00:00 2001 From: agabrys Date: Sun, 15 May 2016 15:55:14 +0200 Subject: [PATCH 04/15] Use http protocol in license badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea1a188..84d8ee2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Directory Content Maven Plugin -[![License BSD 3-Clause](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](https://directory-content-maven-plugin.projects.gabrys.biz/license.txt) +[![License BSD 3-Clause](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](http://directory-content-maven-plugin.projects.gabrys.biz/license.txt) [![Build Status](https://travis-ci.org/gabrysbiz/directory-content-maven-plugin.svg?branch=develop)](https://travis-ci.org/gabrysbiz/directory-content-maven-plugin) Provides a collection of tools for working with directories. From 66d53c010bd618af7f824374b81bc69dc81dd0a7 Mon Sep 17 00:00:00 2001 From: agabrys Date: Thu, 7 Jul 2016 20:16:08 +0200 Subject: [PATCH 05/15] add URL to main page --- src/site/site.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/site/site.xml b/src/site/site.xml index b4c8fa5..dc75f1e 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -4,6 +4,7 @@ ${projectName} + ../ From 4cb98c4b4436794cf7ca50f7dfd393209207e06c Mon Sep 17 00:00:00 2001 From: agabrys Date: Thu, 7 Jul 2016 20:22:22 +0200 Subject: [PATCH 06/15] add download page --- pom.xml | 26 ++++++++++++++ src/site/site.xml | 1 + xdocs/download.xml.vm | 80 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 xdocs/download.xml.vm diff --git a/pom.xml b/pom.xml index 6015700..9ecac6f 100644 --- a/pom.xml +++ b/pom.xml @@ -130,6 +130,10 @@ + + maven-antrun-plugin + 1.8 + maven-clean-plugin 3.0.0 @@ -296,11 +300,33 @@ + maven-site-plugin true + + maven-antrun-plugin + + + site + + run + + + + + + + + + + + + + + diff --git a/src/site/site.xml b/src/site/site.xml index dc75f1e..c130904 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -33,6 +33,7 @@ +
diff --git a/xdocs/download.xml.vm b/xdocs/download.xml.vm new file mode 100644 index 0000000..eb6a5a4 --- /dev/null +++ b/xdocs/download.xml.vm @@ -0,0 +1,80 @@ + + + + + Download + + + + #set($snapshot = $project.version.contains("SNAPSHOT")) +
+ + + + + + + + + + + + + + #if (!$snapshot) + + + + + + + + + #end +
FileDownload
${project.artifactId}-${project.version}.jar + gabrys.biz + #if (!$snapshot) +
repo.maven.apache.org + #end +
${project.artifactId}-${project.version}-sources.jar + gabrys.biz + #if (!$snapshot) +
repo.maven.apache.org + #end +
Source code (zip) + github.com +
Source code (tar.gz) + github.com +
+
+
+

+ Dependency information page describes how to include the library using various dependency management tools. + If you want to use snapshot, then you need to add the oss.sonatype.org + repository, e.g. for Maven: +

+
<repositories>
+    <repository>
+        <id>sonatype-nexus-snapshots</id>
+        <name>Sonatype's SNAPSHOT repository</name>
+        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+        <releases>
+            <enabled>false</enabled>
+        </releases>
+        <snapshots>
+            <enabled>true</enabled>
+        </snapshots>
+    </repository>
+</repositories>
+
+ +
\ No newline at end of file From fac04965cb9ca62d4458e4e3fe7355e615bee9da Mon Sep 17 00:00:00 2001 From: agabrys Date: Thu, 7 Jul 2016 20:23:57 +0200 Subject: [PATCH 07/15] use correct semantic versioning --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9ecac6f..ebcd383 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ biz.gabrys.maven.plugins directory-content-maven-plugin - 1.1-SNAPSHOT + 1.0.1-SNAPSHOT maven-plugin Directory Content Maven Plugin Provides a collection of tools for working with directories. From 4b216b4de4c1815cddd11b88f995069a7e003aa9 Mon Sep 17 00:00:00 2001 From: agabrys Date: Thu, 7 Jul 2016 20:28:56 +0200 Subject: [PATCH 08/15] update maven plugins --- pom.xml | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index ebcd383..bc4cb0e 100644 --- a/pom.xml +++ b/pom.xml @@ -156,7 +156,7 @@
maven-jar-plugin - 2.6 + 3.0.2 maven-jxr-plugin @@ -171,7 +171,7 @@ maven-resources-plugin - 2.7 + 3.0.1 maven-site-plugin @@ -179,7 +179,7 @@ maven-source-plugin - 3.0.0 + 3.0.1 maven-surefire-plugin @@ -205,7 +205,7 @@ org.jacoco jacoco-maven-plugin - 0.7.6.201602180812 + 0.7.7.201606060606 @@ -239,21 +239,6 @@ - - - org.jacoco - jacoco-maven-plugin - [0,) - - prepare-agent - - - - - true - - - From 3d9490c4486f28d1ab9f5ed807b0d78ab4d888a5 Mon Sep 17 00:00:00 2001 From: agabrys Date: Thu, 7 Jul 2016 20:44:27 +0200 Subject: [PATCH 09/15] use spaces instead of tabs --- xdocs/index.xml.vm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xdocs/index.xml.vm b/xdocs/index.xml.vm index 0740dc8..58ce926 100644 --- a/xdocs/index.xml.vm +++ b/xdocs/index.xml.vm @@ -9,7 +9,7 @@

- Provides a collection of tools for working with directories. + Provides a collection of tools for working with directories.

From 4ac09387a405f29af72a3a136bf2b0d31c404c4a Mon Sep 17 00:00:00 2001 From: agabrys Date: Sun, 10 Jul 2016 23:02:24 +0200 Subject: [PATCH 10/15] #3 upgrade maven plugin utils to 1.3.0 --- pom.xml | 2 +- .../directory/content/AbstractPluginMojo.java | 42 ++++++++----------- .../content/AbstractTransformMojo.java | 19 +++++---- .../plugins/directory/content/CopyMojo.java | 6 ++- .../directory/content/TransformListMojo.java | 11 +++-- .../content/TransformMetadataMojo.java | 8 ++-- 6 files changed, 44 insertions(+), 44 deletions(-) diff --git a/pom.xml b/pom.xml index bc4cb0e..4b1d7d9 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ biz.gabrys.maven plugin-utils - 1.2 + 1.3.0 diff --git a/src/main/java/biz/gabrys/maven/plugins/directory/content/AbstractPluginMojo.java b/src/main/java/biz/gabrys/maven/plugins/directory/content/AbstractPluginMojo.java index d9bd9fd..54e794b 100644 --- a/src/main/java/biz/gabrys/maven/plugins/directory/content/AbstractPluginMojo.java +++ b/src/main/java/biz/gabrys/maven/plugins/directory/content/AbstractPluginMojo.java @@ -13,8 +13,6 @@ package biz.gabrys.maven.plugins.directory.content; import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import org.apache.maven.plugin.AbstractMojo; @@ -24,8 +22,8 @@ import biz.gabrys.maven.plugin.util.io.FileScanner; import biz.gabrys.maven.plugin.util.io.ScannerFactory; import biz.gabrys.maven.plugin.util.io.ScannerPatternFormat; -import biz.gabrys.maven.plugin.util.timer.SystemTimer; -import biz.gabrys.maven.plugin.util.timer.Timer; +import biz.gabrys.maven.plugin.util.parameter.ParametersLogBuilder; +import biz.gabrys.maven.plugin.util.parameter.sanitizer.SimpleSanitizer; /** * Parent class for all plugin goals. @@ -66,8 +64,7 @@ abstract class AbstractPluginMojo extends AbstractMojo { /** * Defines inclusion and exclusion fileset patterns format. Available options: * * @since 1.0 @@ -95,24 +92,23 @@ abstract class AbstractPluginMojo extends AbstractMojo { protected String[] excludes = new String[0]; private void logParameters() { - if (getLog().isDebugEnabled()) { - getLog().debug("Job parameters:"); - getLog().debug("\tskip = " + skip); - getLog().debug(String.format("\tverbose = %s (calculated: true)", verbose)); - getLog().debug("\tsourceDirectory = " + sourceDirectory); - getLog().debug("\tfilesetPatternFormat = " + filesetPatternFormat); - getLog().debug("\tincludes = " + Arrays.toString(includes)); - getLog().debug("\texcludes = " + Arrays.toString(excludes)); - final Collection parameters = new ArrayList(); - fillParametersForLogger(parameters); - for (final String parameter : parameters) { - getLog().debug('\t' + parameter); - } - getLog().debug(""); + if (!getLog().isDebugEnabled()) { + return; } + + final ParametersLogBuilder logger = new ParametersLogBuilder(getLog()); + logger.append("skip", skip); + logger.append("verbose", verbose, new SimpleSanitizer(verbose, Boolean.TRUE)); + logger.append("force", force); + logger.append("sourceDirectory", sourceDirectory); + logger.append("filesetPatternFormat", filesetPatternFormat); + logger.append("includes", includes); + logger.append("excludes", excludes); + fillParameters(logger); + logger.debug(); } - protected abstract void fillParametersForLogger(Collection parameters); + protected abstract void fillParameters(ParametersLogBuilder logger); private void calculateParameters() { if (getLog().isDebugEnabled()) { @@ -121,7 +117,6 @@ private void calculateParameters() { } public final void execute() throws MojoFailureException { - final Timer timer = SystemTimer.getStartedTimer(); logParameters(); if (skip) { getLog().info("Skipping job execution"); @@ -138,9 +133,6 @@ public final void execute() throws MojoFailureException { return; } execute(files); - if (verbose) { - getLog().info("Finished in " + timer.stop()); - } } private Collection getFiles() { diff --git a/src/main/java/biz/gabrys/maven/plugins/directory/content/AbstractTransformMojo.java b/src/main/java/biz/gabrys/maven/plugins/directory/content/AbstractTransformMojo.java index 62894be..8f3e618 100644 --- a/src/main/java/biz/gabrys/maven/plugins/directory/content/AbstractTransformMojo.java +++ b/src/main/java/biz/gabrys/maven/plugins/directory/content/AbstractTransformMojo.java @@ -18,6 +18,9 @@ import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Parameter; +import biz.gabrys.maven.plugin.util.parameter.ParametersLogBuilder; +import biz.gabrys.maven.plugin.util.parameter.sanitizer.SimpleSanitizer; + /** * Parent class for all goals related with XSLT transformation. * @since 1.0 @@ -47,15 +50,15 @@ abstract class AbstractTransformMojo extends AbstractPluginMojo { protected String separator; @Override - protected void fillParametersForLogger(final Collection parameters) { - parameters.add("encoding = " + encoding); - if (separator != null) { - parameters.add("separator = " + separator); - } else { - parameters.add(String.format("separator = null (calculated: %s)", File.separator)); - } + protected final void fillParameters(final ParametersLogBuilder logger) { + logger.append("xsltFile", xsltFile); + logger.append("encoding", encoding); + logger.append("separator", separator, new SimpleSanitizer(separator != null, File.separator)); + fillParameters2(logger); } + protected abstract void fillParameters2(ParametersLogBuilder logger); + @Override protected final void execute(final Collection files) throws MojoFailureException { if (separator == null) { @@ -64,5 +67,5 @@ protected final void execute(final Collection files) throws MojoFailureExc execute2(files); } - protected abstract void execute2(final Collection files) throws MojoFailureException; + protected abstract void execute2(Collection files) throws MojoFailureException; } diff --git a/src/main/java/biz/gabrys/maven/plugins/directory/content/CopyMojo.java b/src/main/java/biz/gabrys/maven/plugins/directory/content/CopyMojo.java index 0ead999..1154fc5 100644 --- a/src/main/java/biz/gabrys/maven/plugins/directory/content/CopyMojo.java +++ b/src/main/java/biz/gabrys/maven/plugins/directory/content/CopyMojo.java @@ -22,6 +22,7 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; +import biz.gabrys.maven.plugin.util.parameter.ParametersLogBuilder; import biz.gabrys.maven.plugin.util.timer.SystemTimer; import biz.gabrys.maven.plugin.util.timer.Timer; @@ -40,8 +41,8 @@ public class CopyMojo extends AbstractPluginMojo { protected File outputDirectory; @Override - protected void fillParametersForLogger(final Collection parameters) { - parameters.add("outputDirectory = " + outputDirectory); + protected void fillParameters(final ParametersLogBuilder logger) { + logger.append("outputDirectory", outputDirectory); } @Override @@ -69,6 +70,7 @@ private void copy(final File source, final File destination) throws MojoFailureE Timer timer = null; if (verbose) { getLog().info("Coping the file: " + source.getAbsolutePath()); + getLog().info("Saving to " + destination.getAbsolutePath()); timer = SystemTimer.getStartedTimer(); } try { diff --git a/src/main/java/biz/gabrys/maven/plugins/directory/content/TransformListMojo.java b/src/main/java/biz/gabrys/maven/plugins/directory/content/TransformListMojo.java index 0da3f5f..f9f8a98 100644 --- a/src/main/java/biz/gabrys/maven/plugins/directory/content/TransformListMojo.java +++ b/src/main/java/biz/gabrys/maven/plugins/directory/content/TransformListMojo.java @@ -22,6 +22,7 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; +import biz.gabrys.maven.plugin.util.parameter.ParametersLogBuilder; import biz.gabrys.maven.plugins.directory.content.file.FileMetadata; import biz.gabrys.maven.plugins.directory.content.file.FileMetadataFactory; import biz.gabrys.maven.plugins.directory.content.file.FileMetadataFactoryConfiguration; @@ -84,9 +85,8 @@ public class TransformListMojo extends AbstractTransformMojo { protected File outputFile; @Override - protected void fillParametersForLogger(final Collection parameters) { - super.fillParametersForLogger(parameters); - parameters.add("outputFile = " + outputFile); + protected void fillParameters2(final ParametersLogBuilder logger) { + logger.append("outputFile", outputFile); } @Override @@ -103,8 +103,11 @@ protected void execute2(final Collection files) throws MojoFailureExceptio } private boolean isTransformationRequired(final Collection files) { + if (force || !outputFile.exists()) { + return true; + } for (final File file : files) { - if (force || !outputFile.exists() || file.lastModified() >= outputFile.lastModified()) { + if (file.lastModified() >= outputFile.lastModified()) { return true; } } diff --git a/src/main/java/biz/gabrys/maven/plugins/directory/content/TransformMetadataMojo.java b/src/main/java/biz/gabrys/maven/plugins/directory/content/TransformMetadataMojo.java index fd1c31b..d18561d 100644 --- a/src/main/java/biz/gabrys/maven/plugins/directory/content/TransformMetadataMojo.java +++ b/src/main/java/biz/gabrys/maven/plugins/directory/content/TransformMetadataMojo.java @@ -23,6 +23,7 @@ import org.apache.maven.plugins.annotations.Parameter; import biz.gabrys.maven.plugin.util.io.DestinationFileCreator; +import biz.gabrys.maven.plugin.util.parameter.ParametersLogBuilder; import biz.gabrys.maven.plugin.util.timer.SystemTimer; import biz.gabrys.maven.plugin.util.timer.Timer; import biz.gabrys.maven.plugins.directory.content.file.FileMetadata; @@ -92,10 +93,9 @@ public class TransformMetadataMojo extends AbstractTransformMojo { protected String outputFileFormat; @Override - protected void fillParametersForLogger(final Collection parameters) { - super.fillParametersForLogger(parameters); - parameters.add("outputDirectory = " + outputDirectory); - parameters.add("outputFileFormat = " + outputFileFormat); + protected void fillParameters2(final ParametersLogBuilder logger) { + logger.append("outputDirectory", outputDirectory); + logger.append("outputFileFormat", outputFileFormat); } @Override From 5030aeb8eebb1d0df7464f5d463a4efafc87e268 Mon Sep 17 00:00:00 2001 From: agabrys Date: Mon, 25 Jul 2016 22:20:22 +0200 Subject: [PATCH 11/15] Add changelog and remove counting times (Timer) --- CHANGELOG.md | 6 ++++++ README.md | 2 +- .../maven/plugins/directory/content/CopyMojo.java | 13 +++---------- .../directory/content/TransformMetadataMojo.java | 12 +----------- xdocs/changelog.xml | 6 ++++++ 5 files changed, 17 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f872ca9..8e9e7d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Directory Content Maven Plugin Changelog +## 1.0.1 +Bugs: +* Fixed logging Mojo parameters + +[See documentation](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/) + ## 1.0 Initial release. diff --git a/README.md b/README.md index 84d8ee2..e765905 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Directory Content Maven Plugin +# About [![License BSD 3-Clause](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](http://directory-content-maven-plugin.projects.gabrys.biz/license.txt) [![Build Status](https://travis-ci.org/gabrysbiz/directory-content-maven-plugin.svg?branch=develop)](https://travis-ci.org/gabrysbiz/directory-content-maven-plugin) diff --git a/src/main/java/biz/gabrys/maven/plugins/directory/content/CopyMojo.java b/src/main/java/biz/gabrys/maven/plugins/directory/content/CopyMojo.java index 1154fc5..471f0bc 100644 --- a/src/main/java/biz/gabrys/maven/plugins/directory/content/CopyMojo.java +++ b/src/main/java/biz/gabrys/maven/plugins/directory/content/CopyMojo.java @@ -23,8 +23,6 @@ import org.apache.maven.plugins.annotations.Parameter; import biz.gabrys.maven.plugin.util.parameter.ParametersLogBuilder; -import biz.gabrys.maven.plugin.util.timer.SystemTimer; -import biz.gabrys.maven.plugin.util.timer.Timer; /** * Copies files from source to output directory. @@ -67,19 +65,14 @@ private void copy(final File source, final File destination) throws MojoFailureE return; } - Timer timer = null; if (verbose) { - getLog().info("Coping the file: " + source.getAbsolutePath()); - getLog().info("Saving to " + destination.getAbsolutePath()); - timer = SystemTimer.getStartedTimer(); + getLog().info(String.format("Copying %s to %s", source.getAbsolutePath(), destination.getAbsolutePath())); } try { FileUtils.copyFile(source, destination); } catch (final IOException e) { - throw new MojoFailureException("Cannot copy file to: " + destination.getAbsolutePath(), e); - } - if (timer != null) { - getLog().info("Finished in " + timer.stop()); + final String message = String.format("Cannot copy %s to %s", source.getAbsolutePath(), destination.getAbsolutePath()); + throw new MojoFailureException(message, e); } } } diff --git a/src/main/java/biz/gabrys/maven/plugins/directory/content/TransformMetadataMojo.java b/src/main/java/biz/gabrys/maven/plugins/directory/content/TransformMetadataMojo.java index d18561d..299827c 100644 --- a/src/main/java/biz/gabrys/maven/plugins/directory/content/TransformMetadataMojo.java +++ b/src/main/java/biz/gabrys/maven/plugins/directory/content/TransformMetadataMojo.java @@ -24,8 +24,6 @@ import biz.gabrys.maven.plugin.util.io.DestinationFileCreator; import biz.gabrys.maven.plugin.util.parameter.ParametersLogBuilder; -import biz.gabrys.maven.plugin.util.timer.SystemTimer; -import biz.gabrys.maven.plugin.util.timer.Timer; import biz.gabrys.maven.plugins.directory.content.file.FileMetadata; import biz.gabrys.maven.plugins.directory.content.file.FileMetadataFactory; import biz.gabrys.maven.plugins.directory.content.file.FileMetadataFactoryConfiguration; @@ -116,18 +114,10 @@ private void transformFile(final File file) throws MojoFailureException { return; } - Timer timer = null; - if (verbose) { - getLog().info("Transforming metadata of the file: " + file.getAbsolutePath()); - timer = SystemTimer.getStartedTimer(); - } - + getLog().info("Transforming metadata of the file: " + file.getAbsolutePath()); final FileMetadata metadata = createMetadata(file); final String document = transformMetadata(metadata); saveDocument(document, destination); - if (timer != null) { - getLog().info("Finished in " + timer.stop()); - } } private FileMetadata createMetadata(final File file) { diff --git a/xdocs/changelog.xml b/xdocs/changelog.xml index e18dd79..f9f9198 100644 --- a/xdocs/changelog.xml +++ b/xdocs/changelog.xml @@ -7,6 +7,12 @@ +
+

Bugs:

+
    +
  • Fixed logging Mojo parameters
  • +
+

Initial release.

See documentation

From c7c112604228746d0dc1906d0a823f55fe623ef2 Mon Sep 17 00:00:00 2001 From: agabrys Date: Mon, 25 Jul 2016 22:35:45 +0200 Subject: [PATCH 12/15] #4 convert examples page to new layout --- src/site/site.xml | 13 ++++++------- xdocs/download.xml.vm | 2 +- xdocs/examples.xml.vm | 44 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 xdocs/examples.xml.vm diff --git a/src/site/site.xml b/src/site/site.xml index c130904..5c580ce 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -34,17 +34,16 @@ + + + + + + - - - - - - - diff --git a/xdocs/download.xml.vm b/xdocs/download.xml.vm index eb6a5a4..7ec5822 100644 --- a/xdocs/download.xml.vm +++ b/xdocs/download.xml.vm @@ -26,7 +26,7 @@
repo.maven.apache.org #end - + + + + + Examples + + + +
+

+ List of available examples: +

+ + + + + + + + + + + + + + + + + + + + + +
DocumentDescription
Using include/exclude patternsThis example shows how to filter source files.
Copies filesThis example describes how to use a copy goal.
Transform files list + This example shows example shows how to use a transformList goal to generate + a import-scripts.jsp file with JavaScript imports. +
Transform files metadata + This example describes how use a transformMetadata goal to generate + download pages for all files from src/main/webapp/files. +
+
+ +
\ No newline at end of file From 90798ce6cc3b03c570231831399d4e69f054032e Mon Sep 17 00:00:00 2001 From: agabrys Date: Tue, 26 Jul 2016 22:17:50 +0200 Subject: [PATCH 13/15] Simplify Ant href --- xdocs/examples/patterns.xml.vm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xdocs/examples/patterns.xml.vm b/xdocs/examples/patterns.xml.vm index a389e8c..c72109b 100644 --- a/xdocs/examples/patterns.xml.vm +++ b/xdocs/examples/patterns.xml.vm @@ -15,9 +15,8 @@

- Ant patterns - is a default format. The following example includes files with js extension, but which are not located - in ignored directory. + Ant patterns is a default format. The following + example includes files with js extension, but which are not located in ignored directory.

<project>
    ...

From 0de0159065f2134b01ac9265df6d154ed21cdb00 Mon Sep 17 00:00:00 2001
From: agabrys 
Date: Wed, 3 Aug 2016 21:08:25 +0200
Subject: [PATCH 14/15] Change "a goal" to "the goal"

---
 xdocs/examples.xml.vm                    | 9 ++++++---
 xdocs/examples/copy.xml.vm               | 6 +++---
 xdocs/examples/transform-list.xml.vm     | 6 +++---
 xdocs/examples/transform-metadata.xml.vm | 6 +++---
 4 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/xdocs/examples.xml.vm b/xdocs/examples.xml.vm
index 22520ab..8862644 100644
--- a/xdocs/examples.xml.vm
+++ b/xdocs/examples.xml.vm
@@ -22,23 +22,26 @@
                 
                 
                     Copies files
-                    This example describes how to use a copy goal.
+                    This example describes how to use the copy goal.
                 
                 
                     Transform files list
                     
-                        This example shows example shows how to use a transformList goal to generate
+                        This example shows example shows how to use the transformList goal to generate
                         a import-scripts.jsp file with JavaScript imports.
                     
                 
                 
                     Transform files metadata
                     
-                        This example describes how use a transformMetadata goal to generate
+                        This example describes how use the transformMetadata goal to generate
                         download pages for all files from src/main/webapp/files.
                     
                 
             
+            

+ You can also fetch example projects from GitHub. +

\ No newline at end of file diff --git a/xdocs/examples/copy.xml.vm b/xdocs/examples/copy.xml.vm index c79911d..9f42ae9 100644 --- a/xdocs/examples/copy.xml.vm +++ b/xdocs/examples/copy.xml.vm @@ -9,9 +9,9 @@

- This example shows how use a copy goal to copy all files without - ignored extension from src/files to - \${project.build.directory}/\${project.artifactId}-\${project.version}/files directory. + This example shows how use the copy goal to copy all files without + ignored extension from src/files to + \${project.build.directory}/\${project.artifactId}-\${project.version}/files directory.

<project>
    ...
diff --git a/xdocs/examples/transform-list.xml.vm b/xdocs/examples/transform-list.xml.vm
index 362a478..272cb55 100644
--- a/xdocs/examples/transform-list.xml.vm
+++ b/xdocs/examples/transform-list.xml.vm
@@ -9,9 +9,9 @@
     
         

- This example shows how to use a transformList goal to generate - a import-scripts.jsp file with JavaScript imports. POM define application which - can be build in two modes: + This example shows how to use the transformList goal to generate + a import-scripts.jsp file with JavaScript imports. POM define application which + can be build in two modes:

  1. production - merge and minify all JavaScript files to one file (all.js)
  2. diff --git a/xdocs/examples/transform-metadata.xml.vm b/xdocs/examples/transform-metadata.xml.vm index 387eff8..0ccc14b 100644 --- a/xdocs/examples/transform-metadata.xml.vm +++ b/xdocs/examples/transform-metadata.xml.vm @@ -9,9 +9,9 @@

    - This example shows how use a transformMetadata goal to generate - download pages for all files from src/main/webapp/files. Pages will be saved in - \${project.build.directory}/\${project.artifactId}-\${project.version}/download directory. + This example shows how use the transformMetadata goal to generate + download pages for all files from src/main/webapp/files. Pages will be saved in + \${project.build.directory}/\${project.artifactId}-\${project.version}/download directory.

    <project>
        ...
    
    From b6dbd979ce2e26d26eaad041877a1b9e512c962d Mon Sep 17 00:00:00 2001
    From: agabrys 
    Date: Wed, 3 Aug 2016 21:20:23 +0200
    Subject: [PATCH 15/15] Release 1.0.1
    
    ---
     CHANGELOG.md |  2 +-
     README.md    | 22 +++++++++++-----------
     pom.xml      |  4 ++--
     3 files changed, 14 insertions(+), 14 deletions(-)
    
    diff --git a/CHANGELOG.md b/CHANGELOG.md
    index 8e9e7d5..1ede73e 100644
    --- a/CHANGELOG.md
    +++ b/CHANGELOG.md
    @@ -4,7 +4,7 @@
     Bugs:
     * Fixed logging Mojo parameters
     
    -[See documentation](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/)
    +[See documentation](http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/)
     
     ## 1.0
     Initial release.
    diff --git a/README.md b/README.md
    index e765905..ee126f7 100644
    --- a/README.md
    +++ b/README.md
    @@ -1,13 +1,13 @@
     # About
     [![License BSD 3-Clause](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](http://directory-content-maven-plugin.projects.gabrys.biz/license.txt)
    -[![Build Status](https://travis-ci.org/gabrysbiz/directory-content-maven-plugin.svg?branch=develop)](https://travis-ci.org/gabrysbiz/directory-content-maven-plugin)
    +[![Build Status](https://travis-ci.org/gabrysbiz/directory-content-maven-plugin.svg?branch=release%2F1.0.1)](https://travis-ci.org/gabrysbiz/directory-content-maven-plugin)
     
     Provides a collection of tools for working with directories.
     
     # Goals Overview
    -* [directory-content:copy](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/copy-mojo.html) - copies files to directory
    -* [directory-content:transformList](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/transformList-mojo.html) - transforms files list to a document using [XSLT](http://www.w3.org/TR/xslt) technology
    -* [directory-content:transformMetadata](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/transformMetadata-mojo.html) - transforms files metadata to documents using [XSLT](http://www.w3.org/TR/xslt) technology
    +* [directory-content:copy](http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/copy-mojo.html) - copies files to directory
    +* [directory-content:transformList](http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/transformList-mojo.html) - transforms files list to a document using [XSLT](http://www.w3.org/TR/xslt) technology
    +* [directory-content:transformMetadata](http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/transformMetadata-mojo.html) - transforms files metadata to documents using [XSLT](http://www.w3.org/TR/xslt) technology
     
     # Requirements
     The plugin to run requires:
    @@ -15,17 +15,17 @@ The plugin to run requires:
     * Maven 2.0.11 or higher
     
     # Usage
    -General instructions on how to use the Directory Content Maven Plugin can be found on the [usage](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/usage.html) page. Some more specific use cases are described in the examples given below. Last but not least, users occasionally contribute additional examples, tips or errata to the plugin's [wiki](https://github.com/gabrysbiz/directory-content-maven-plugin/wiki) page.
    +General instructions on how to use the Directory Content Maven Plugin can be found on the [usage](http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/usage.html) page. Some more specific use cases are described in the examples given below. Last but not least, users occasionally contribute additional examples, tips or errata to the plugin's [wiki](https://github.com/gabrysbiz/directory-content-maven-plugin/wiki) page.
     
    -In case you still have questions regarding the plugin's usage, please have a look at the [FAQ](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/faq.html).
    +In case you still have questions regarding the plugin's usage, please have a look at the [FAQ](http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/faq.html).
     
    -If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in the [issue tracker](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/issue-tracking.html). When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from the [source repository](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/source-repository.html) and will find supplementary information in the [guide to helping with Maven](http://maven.apache.org/guides/development/guide-helping.html).
    +If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in the [issue tracker](http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/issue-tracking.html). When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from the [source repository](http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/source-repository.html) and will find supplementary information in the [guide to helping with Maven](http://maven.apache.org/guides/development/guide-helping.html).
     
     # Examples
     To provide you with better understanding of some usages of the Directory Content Maven Plugin, you can take a look into the following examples:
    -* [Using include/exclude patterns](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/examples/patterns.html)
    -* [Copies files from source to output directory](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/examples/copy.html)
    -* [Transform files list to file with JavaScript imports](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/examples/transform-list.html)
    -* [Transform files metadata to download files](http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/examples/transform-metadata.html)
    +* [Using include/exclude patterns](http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/examples/patterns.html)
    +* [Copies files from source to output directory](http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/examples/copy.html)
    +* [Transform files list to file with JavaScript imports](http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/examples/transform-list.html)
    +* [Transform files metadata to download files](http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/examples/transform-metadata.html)
     
     You can also fetch example projects from [GitHub](https://github.com/gabrysbiz/directory-content-maven-plugin-examples).
    \ No newline at end of file
    diff --git a/pom.xml b/pom.xml
    index 4b1d7d9..de4bd1c 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -5,11 +5,11 @@
     
         biz.gabrys.maven.plugins
         directory-content-maven-plugin
    -    1.0.1-SNAPSHOT
    +    1.0.1
         maven-plugin
         Directory Content Maven Plugin
         Provides a collection of tools for working with directories.
    -    http://directory-content-maven-plugin.projects.gabrys.biz/LATEST/
    +    http://directory-content-maven-plugin.projects.gabrys.biz/1.0.1/
     
         2015