-
Notifications
You must be signed in to change notification settings - Fork 5
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
outputFileName doesn't affect resulting merged file name #52
Comments
outputFilename should be used as the final minified and merged filename, rather than the default of script.js being forced.
Hi, thanks for reporting it. I see you also submitted a fix, I appreciate that. However, I'm not quite sure I understand the problem. I tried to reproduce the issue by adding a new test, but it works fine for me (with and without merge/minify), see the example below. Click to see working example with outputFilename<plugin>
<groupId>com.github.blutorange</groupId>
<artifactId>closure-compiler-maven-plugin</artifactId>
<version>2.9.0</version>
<configuration>
<baseSourceDir>${project.basedir}</baseSourceDir>
<baseTargetDir>${project.build.directory}</baseTargetDir>
</configuration>
<executions>
<execution>
<id>default-minify</id>
<phase>generate-resources</phase>
<goals>
<goal>minify</goal>
</goals>
<configuration>
<skipMerge>false</skipMerge>
<skipMinify>false</skipMinify>
<outputFilename>merge+minify.js</outputFilename>
</configuration>
</execution>
<execution>
<id>minify-only</id>
<phase>generate-resources</phase>
<goals>
<goal>minify</goal>
</goals>
<configuration>
<skipMerge>true</skipMerge>
<skipMinify>false</skipMinify>
<outputFilename>minify-only-#{basename}.js</outputFilename>
</configuration>
</execution>
<execution>
<id>merge-only</id>
<phase>generate-resources</phase>
<goals>
<goal>minify</goal>
</goals>
<configuration>
<skipMerge>false</skipMerge>
<skipMinify>true</skipMinify>
<outputFilename>merge-only.js</outputFilename>
</configuration>
</execution>
<execution>
<id>neither-merge-nor-minify</id>
<phase>generate-resources</phase>
<goals>
<goal>minify</goal>
</goals>
<configuration>
<skipMerge>true</skipMerge>
<skipMinify>true</skipMinify>
<outputFilename>no-merge-no-minify-#{basename}.js</outputFilename>
</configuration>
</execution>
</executions>
</plugin> Run against two input files,
|
Oh, I think the issue is that the option needs to be spelled I'll update the documentation. Does it work for you if you spell it |
I realised after a while that the param was spelt differently, however, what I was trying to do was just pass the filename I wanted, without the tokens, and bypass the interpolator in that scenario. Maybe I was just using it wrong :) |
Hmm, thanks for checking. Just passing a filename should work, see the example above (if there are no placeholders, nothing is interpolated). How did you configure the plugin in the <configuration>
<skipMerge>false</skipMerge>
<skipMinify>false</skipMinify>
<outputFilename>merge+minify.js</outputFilename>
</configuration> |
You're totall right! I must have got tangled up when using outputFileName and written that code at that point, before trying outputFilename. I'm closing this. Thanks for the good work on this project, keeping up with the latest Closure version. |
I'm glad it works now for you. But thanks anyway, I updated the docs to clear up the confusion with the name. |
If you set outputFileName you would expect that the final, merged and minified file would be called that, but it is always script.min.js. This means I have to apply another maven plugin to change that name and it is non descriptive.
The text was updated successfully, but these errors were encountered: