Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
agabrys committed Jul 6, 2016
2 parents 98f575f + ed09a8c commit 3b584a5
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 14 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Maven Plugin Utils Changelog

## 1.1
Bugs:
* Corrected [double-checked locking](https://en.wikipedia.org/wiki/Double-checked_locking)
* Optimization of call logger instructions
* Added missing [JavaDocs](http://maven-plugin-utils.projects.gabrys.biz/1.1/apidocs/)

[See documentation](http://maven-plugin-utils.projects.gabrys.biz/1.1/)

## 1.0
Initial release.

[See documentation](http://maven-plugin-utils.projects.gabrys.biz/1.0/)
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
[![Build Status](https://travis-ci.org/gabrysbiz/maven-plugin-utils.svg?branch=master)](https://travis-ci.org/gabrysbiz/maven-plugin-utils)

The Maven Plugin Utils is a Java library which contains utilities for the [Maven 2](https://maven.apache.org/) plugins.
Read [API documentation](http://maven-plugin-utils.projects.gabrys.biz/1.0/apidocs/) for more information.
Read [API documentation](http://maven-plugin-utils.projects.gabrys.biz/1.1/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/1.0/dependencies.html))
* Third-Party Dependencies ([see list](http://maven-plugin-utils.projects.gabrys.biz/1.1/dependencies.html))

# Download
You can download the library from [this page](http://maven-plugin-utils.projects.gabrys.biz/1.0/download.html)
or using various [dependency management tools](http://maven-plugin-utils.projects.gabrys.biz/1.0/dependency-info.html).
You can download the library from [this page](http://maven-plugin-utils.projects.gabrys.biz/1.1/download.html)
or using various [dependency management tools](http://maven-plugin-utils.projects.gabrys.biz/1.1/dependency-info.html).
57 changes: 55 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

<groupId>biz.gabrys.maven</groupId>
<artifactId>plugin-utils</artifactId>
<version>1.0</version>
<version>1.1</version>
<name>Maven Plugin Utils</name>
<description>A Java library which contains utilities for Maven 2 plugins.</description>
<url>http://maven-plugin-utils.projects.gabrys.biz/1.0/</url>
<url>http://maven-plugin-utils.projects.gabrys.biz/1.1/</url>

<inceptionYear>2015</inceptionYear>
<organization>
Expand Down Expand Up @@ -175,6 +175,47 @@
</mapping>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<configuration>
<rules>
<rule>
<element>CLASS</element>
<excludes>
<exclude>*Test</exclude>
</excludes>
</rule>
</rules>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<versionRange>[0,)</versionRange>
<goals>
<goal>prepare-agent</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>true</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -215,6 +256,18 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<!-- call mvn package site to generate page -->
<artifactId>maven-site-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ public Collection<File> getFiles(final File directory, final String[] includes,
scanner.setIncludes(includes.clone());
scanner.setExcludes(excludes.clone());
scanner.scan();
final Collection<File> files = new ArrayList<File>();
for (final String path : scanner.getIncludedFiles()) {
final String[] paths = scanner.getIncludedFiles();
final Collection<File> files = new ArrayList<File>(paths.length);
for (final String path : paths) {
files.add(new File(directory, path));
}
return files;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class LoggingDirectoryScanner extends DirectoryScanner {
protected boolean isExcluded(final String name) {
final boolean excluded = super.isExcluded(name);
final File file = new File(getBasedir(), name);
if (file.isFile()) {
if (logger.isDebugEnabled() && file.isFile()) {
logger.debug((excluded ? "Exclude " : "Include ") + file.getAbsolutePath());
}
return excluded;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class LoggingFileFilter implements IOFileFilter {

public boolean accept(final File file) {
final boolean accepted = filter.accept(file);
if (file.isFile()) {
if (logger.isDebugEnabled() && file.isFile()) {
logger.debug((accepted ? "Include " : "Exclude ") + file.getAbsolutePath());
}
return accepted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
*/
public class ScannerFactory {

/**
* Constructs a new instance.
* @since 1.0
*/
public ScannerFactory() {
// do nothing
}

/**
* Creates a new scanner related with the pattern format.
* @param patternFormat the scanner pattern format.
Expand All @@ -32,7 +40,7 @@ public FileScanner create(final ScannerPatternFormat patternFormat, final Log lo
if (logger == null) {
throw new IllegalArgumentException("Logger cannot be null");
}
if (ScannerPatternFormat.ANT.equals(patternFormat)) {
if (patternFormat == ScannerPatternFormat.ANT) {
return new AntFileScanner(logger);
}
return new RegexFileScanner(logger);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public enum ScannerPatternFormat {
* Returns a scanner pattern format by name (case insensitive).
* @param name the scanner pattern format name.
* @return the scanner pattern format.
* @since 1.0
* @throws IllegalArgumentException if cannot find search pattern format related with name.
* @since 1.0
*/
public static ScannerPatternFormat toPattern(final String name) {
for (final ScannerPatternFormat pattern : values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class SystemTimer implements Timer {
private final Object mutex = new Object();

private long startTime;
private Time time;
private volatile Time time;

/**
* Constructs a new instance.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/biz/gabrys/maven/plugin/util/timer/Time.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public long toMilliseconds() {
}

@Override
public synchronized String toString() {
public String toString() {
final long seconds = milliseconds / 1000 % 60;
final long millis = milliseconds % 1000;
return String.format("%s.%03d seconds", seconds, millis);
Expand Down
1 change: 1 addition & 0 deletions src/site/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<menu name="Overview">
<item name="Introduction" href="index.html" />
<item name="Download" href="download.html" />
<item name="Changelog" href="changelog.html" />
</menu>

<menu ref="reports" />
Expand Down
23 changes: 23 additions & 0 deletions xdocs/changelog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">

<properties>
<title>Changelog</title>
</properties>

<body>
<section id="release-1.1" name="Release 1.1">
<p>Bugs:</p>
<ul>
<li>Corrected <a href="https://en.wikipedia.org/wiki/Double-checked_locking">double-checked locking</a></li>
<li>Optimization of call logger instructions</li>
<li>Added missing <a href="apidocs/">JavaDocs</a></li>
</ul>
</section>
<section id="release-1.0" name="Release 1.0">
<p>Initial release.</p>
<p><a href="http://maven-plugin-utils.projects.gabrys.biz/1.0/">See documentation</a></p>
</section>
</body>
</document>

0 comments on commit 3b584a5

Please sign in to comment.