Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete transient .tmp file on spot in case of nosuffix = true #35

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 31 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Minify Maven Plugin

## 1.7.1

* Update Google Closure Compiler to v20130411.

## 1.7

* [MINIFY-16] Added nosuffix option to avoid the suffix (.min) on the minified output filename.
* [MINIFY-16] Added `nosuffix` option to avoid the suffix (.min) on the minified output filename.
* [MINIFY-17] Option to use same subdirectory on target as in source.
* [MINIFY-19] Build should fail if compiler can't parse/compile source files.
* Assumes UTF-8 as the default charset.
* Logs compression gains.
* Requires Java 7.
* Add `UTF-8` as the default charset.
* Log compression gains.
* Require Java SE 7 for better resource management. See [AutoCloseable](http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html) interface and [try-with-resources](http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html) statements.

## 1.6

* [MINIFY-14] Added support for Google Closure Compiler for JavaScript compression.
* [MINIFY-14] Add support for [Google Closure Compiler](https://developers.google.com/closure/compiler/) for JavaScript compression.

## 1.5.2

Expand All @@ -26,10 +30,10 @@

## 1.5

* [MINIFY-1] Fixed charset issue.
* Updated Maven site skin.
* [MINIFY-1] Fix charset issue.
* Update Maven site skin.
* Use `ExecutorService` to wait for all tasks to finish.
* Added support for CLI-based configuration and Maven 2.2.1. From [Configuring Plugin Goals in Maven 3](http://www.sonatype.com/people/2011/03/configuring-plugin-goals-in-maven-3/):
* Add support for CLI-based configuration and Maven 2.2.1. From [Configuring Plugin Goals in Maven 3](http://www.sonatype.com/people/2011/03/configuring-plugin-goals-in-maven-3/):

> For many plugin parameters it is occasionally convenient to specify their values from the command line via system properties. In the past, this was limited to parameters of simple types like `String` or `Boolean`. The latest Maven release finally allows plugin users to configure collections or arrays from the command line via comma-separated strings. Take for example a plugin parameter like this:
>
Expand All @@ -44,45 +48,50 @@

## 1.4

* Moved from http://code.google.com/p/maven-samaxes-plugin/ to https://github.com/samaxes/minify-maven-plugin.
* Renamed project from Maven Minify Plugin to Minify Maven Plugin.
* Added Maven Integration for Eclipse (M2E) lifecycle mapping metadata.
* Move from http://code.google.com/p/maven-samaxes-plugin/ to https://github.com/samaxes/minify-maven-plugin.
* Add Maven Integration for Eclipse (M2E) lifecycle mapping metadata.
* Rename project from Maven Minify Plugin to Minify Maven Plugin:

> Artifact Ids of the format maven-___-plugin are reserved for
> plugins in the Group Id org.apache.maven.plugins
> Please change your artifactId to the format ___-maven-plugin
> In the future this error will break the build.

## 1.3.5

* Lifted restriction that prevented the final filename to be the same as an existing source filename.
* Lift restriction that prevented the final filename to be the same as an existing source filename.

## 1.3.4

* Updated YUI Compressor to version 2.4.6.
* Update YUI Compressor to version 2.4.6.

## 1.3.3

* Added debug messages for wrong source file names and source directory paths.
* Add debug messages for wrong source file names and source directory paths.

## 1.3.2

* Added cssTargetDir, jsTargetDir, suffix, and charset parameters.
* Add `cssTargetDir`, `jsTargetDir`, `suffix`, and `charset` parameters.

## 1.3.1

* Class 'java.util.List' cannot be instantiated while running minify goal with Maven versions before 3.
* Class `java.util.List` cannot be instantiated while running Maven minify goal with versions previous to 3.0.

## 1.3

* Exclude/include patterns changed from a comma separated String to List<String>. Also included a custom file comparator that only compares the file name instead of the full file path.
* Updated YUI Compressor dependency to version 2.4.2.
* Change exclude/include patterns from a comma separated `String` to `List<String>`. Also included a custom file comparator that only compares the file name instead of the full file path.
* Update [YUI Compressor](http://developer.yahoo.com/yui/compressor/) dependency to version 2.4.2.

## 1.2.1

* Doesn't crash anymore with an IndexOutOfBoundsException when a source file does not exist.
* Don't crash with an `IndexOutOfBoundsException` when a source file does not exist.
* More accurate logging.
* Configure POM to inherit from Sonatype OSS Parent POM.

## 1.2

* Exclude/include patterns added, with the caveat that the developer must name their source files so their lexicographical order is correct for minifying.
* Add exclude/include patterns, with the caveat that the developer must name their source files so their lexicographical order is correct for minifying.
* Don't minify a file type if the list of files to process is empty.
* Make JavaScript minify error messages clearer.
* Make file extensions configurable (e.g. it's now possible to save a JavaScript file as *.jsp or *.php).
* Compiled against JDK 1.5 instead of JDK 1.6.
* Make file extensions configurable (e.g. it's now possible to save a JavaScript file as `*.jsp` or `*.php`).
* Compile against JDK 1.5 instead of JDK 1.6.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@ Configure your project's `pom.xml` to run the plugin during the project's build
</build>
```

For more information, check the plugin [documentation](http://samaxes.github.com/minify-maven-plugin/) and the [demo application](https://github.com/downloads/samaxes/minify-maven-plugin/minify-maven-plugin-demo-1.7-src.zip).
For more information, check the plugin [documentation](http://samaxes.github.com/minify-maven-plugin/) and the [demo application](https://github.com/downloads/samaxes/minify-maven-plugin/minify-maven-plugin-demo-1.7-src.zip).
**Note:** For version 1.7 or greater of Minify Maven Plugin, Java SE 7 is required. If you need to support older versions of Java please use the version 1.6 of this plugin.

## License

This distribution is licensed under the terms of the Apache License, Version 2.0 (see LICENSE.txt).
8 changes: 4 additions & 4 deletions demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin-demo</artifactId>
<version>1.7</version>
<version>1.7.1-SNAPSHOT</version>
<packaging>war</packaging>

<name>Minify Maven Plugin Demo</name>
Expand All @@ -30,7 +30,7 @@
<version>3.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.source}</target>
<target>${maven.compiler.target}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
Expand Down Expand Up @@ -74,7 +74,7 @@
<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin</artifactId>
<version>1.7</version>
<version>1.7.1-SNAPSHOT</version>
<executions>
<execution>
<id>default-minify</id>
Expand Down Expand Up @@ -105,7 +105,7 @@
<github.global.server>github</github.global.server>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.resourceEncoding>ISO-8859-1</project.build.resourceEncoding>
<maven.compiler.target>1.5</maven.compiler.target>
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>
</properties>
</project>
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>r2388</version>
<version>v20130411</version>
<optional>true</optional>
</dependency>
</dependencies>
Expand Down Expand Up @@ -256,8 +256,8 @@
<properties>
<github.global.server>github</github.global.server>
<project.build.resourceEncoding>ISO-8859-1</project.build.resourceEncoding>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.plugin.version>2.9</maven.plugin.version>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ public Object call() throws IOException {
: FileUtils.basename(mergedFilename) + suffix + FileUtils.getExtension(mergedFilename));
minify(mergedFile, minifiedFile);
if (nosuffix) {
mergedFile.deleteOnExit();
if (!mergedFile.delete()) {
mergedFile.deleteOnExit();
}
}
}
log.info("");
Expand Down