samaxes / minify-maven-plugin

Combine and minimize JavaScript and CSS files for faster page loading.
http://samaxes.github.com/minify-maven-plugin
Apache License 2.0
222 stars 91 forks source link

Exception 'Failed to concatenate files' raised in linux build #139

Open GregDomjan opened 7 years ago

GregDomjan commented 7 years ago

Had issue with our desired layout, came up with solution to get files to root folder when running build on Windows <jsTargetDir>js/..</jsTargetDir> <!-- if empty takes the jsSourceDir value -->

When running build on Linux for clean build get the following issue - doesn't happen on subsequent non-clean build.

[INFO] Processing source file [foo.js]. [ERROR] Failed to concatenate files. java.io.FileNotFoundException: /home/someapp/target/someapp-0.0.1-0-SNAPSHOT/js/../mergedfoo.js (No such file or directory) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(FileOutputStream.java:270) at java.io.FileOutputStream.(FileOutputStream.java:213) at java.io.FileOutputStream.(FileOutputStream.java:162) at com.samaxes.maven.minify.plugin.ProcessFilesTask.merge(ProcessFilesTask.java:203) at com.samaxes.maven.minify.plugin.ProcessFilesTask.call(ProcessFilesTask.java:175) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Is there a better way to address the jsTarget to the root rather than a subfolder and not match the jsSourceDir?

samaxes commented 7 years ago

Which version of the plugin are you using?

GregDomjan commented 7 years ago

Sorry I hadn't actually checked for an update before dropping the issue

<plugin>
    <groupId>com.samaxes.maven</groupId>
    <artifactId>minify-maven-plugin</artifactId>
    <version>1.7.4</version>

I should probably update to 1.7.6 anyway, but don't see reference to my underlying issue in changlog.

samaxes commented 7 years ago

I did some some work regarding that error in version 1.7.5:

Clearer error message when target directory creation fails (#42, #87, #116).

Can you please try again with the last version of the plugin?

GregDomjan commented 7 years ago

Thanks for that info. My linux host has just failed before I could check, will get back to you once recovered.