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

Unrecognized character exception when merging file #166

Open herve-t opened 5 years ago

herve-t commented 5 years ago

maven-minify-plugin 1.7.6 angularJS used on client side.

Hello, I am trying to minify CSS and JS files. If I use <skipMerge>true</skipMerge> my Maven build ends normally, files are correctly minified, one by one.

Now I would like to merge all the files in a single .js and .css files, but Maven build ends with ERROR.

Please find my configuration below


<charset>UTF-8</charset>                        <webappSourceDir>${basedir}/src/main/resources/static</webappSourceDir>
                            <cssSourceDir>css</cssSourceDir>
                            <cssFinalFile>style.css</cssFinalFile>
                            <cssSourceIncludes>
                                <cssSourceInclude>**/*.css</cssSourceInclude>
                            </cssSourceIncludes>
                            <cssSourceExcludes>
                                <cssSourceExclude>**/*.min.css</cssSourceExclude>
                            </cssSourceExcludes>

                            <jsSourceDir>js</jsSourceDir>
                            <jsSourceIncludes>
                                <jsSourceInclude>**/*.js</jsSourceInclude>
                            </jsSourceIncludes>
                            <jsSourceExcludes>
                                <jsSourceExclude>**/*.min.js</jsSourceExclude>
                                <jsSourceExclude>**/*angular*.js</jsSourceExclude>
                            </jsSourceExcludes>
                        <jsFinalFile>script.js</jsFinalFile>
                <webappTargetDir>${project.build.directory}/classes/static</webappTargetDir>
                            <jsEngine>CLOSURE</jsEngine>
                              <closureLanguage>ECMASCRIPT5</closureLanguage>
                            <closureAngularPass>true</closureAngularPass>
                            <!-- <skipMerge>true</skipMerge> -->
                            <nosuffix>true</nosuffix>
                            <verbose>true</verbose>
                        </configuration>

Find below Maven error occuring  as soon as I want to merge the minified files.
Only JS files seems to be implied. 

`[ERROR] Failed to execute goal com.samaxes.maven:minify-maven-plugin:1.7.6:minify (default-minify) on project selfcare: java.lang.IllegalArgumentException: com.google.common.io.BaseEncoding$DecodingException: Unrecognized character: = -> 
[Help 1]                                                                                                                                                                                                                                      
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.samaxes.maven:minify-maven-plugin:1.7.6:minify (default-minify) on project selfcare: java.lang.IllegalArgumentException: com.google.common.io.BaseEncoding$
DecodingException: Unrecognized character: =                                                                                                                                                                                                  
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)                                                                                                                                                    
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)                                                                                                                                                    
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)                                                                                                                                                    
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)                                                                                                                           
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)                                                                                                                            
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)                                                                                                              
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)                                                                                                                                            
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)                                                                                                                                                                     
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)                                                                                                                                                                     
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)                                                                                                                                                                       
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)                                                                                                                                                                           
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)                                                                                                                                                                            
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)                                                                                                                                                                              
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                                                                                                                                                        
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)                                                                                                                                                      
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                                                                                                                                              
        at java.lang.reflect.Method.invoke(Method.java:498)                                                                                                                                                                                   
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)                                                                                                                                                
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)                                                                                                                                                        
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)                                                                                                                                              
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)                                                                                                                                                          
Caused by: org.apache.maven.plugin.MojoExecutionException: java.lang.IllegalArgumentException: com.google.common.io.BaseEncoding$DecodingException: Unrecognized character: =                                                                 
        at com.samaxes.maven.minify.plugin.MinifyMojo.execute(MinifyMojo.java:516)                                                                                                                                                            
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)                                                                                                                                  
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)                                                                                                                                                    
        ... 20 more                                                                                                                                                                                                                           
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: com.google.common.io.BaseEncoding$DecodingException: Unrecognized character: =                                                                        
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)                                                                                                                                                                        
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)                                                                                                                                                                           
        at com.samaxes.maven.minify.plugin.MinifyMojo.execute(MinifyMojo.java:514)                                                                                                                                                            
        ... 22 more                                                                                                                                                                                                                                                                                                                                                                                                                     
`
I did not find anything interesting so far.Any help is welcome.
georgy7 commented 5 years ago

Hi, @herve-t. Please, try to debug ProcessJSFilesTask.minify during the build.