richfaces-resource-optimizer-maven-plugin throws a syntax error
franc.rovett0 Jun 19, 2015 4:23 AMHello
I'm trying to use the richfaces-resource-optimizer-maven-plugin:
<plugin>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-resource-optimizer-maven-plugin</artifactId>
<version>4.5.1.Final</version>
<configuration>
<skins>
<skin>blue</skin>
</skins>
<excludedFiles>
<exclude>^\Qorg.richfaces.renderkit.html.images.\E.*</exclude>
<exclude>^\Qorg.richfaces.renderkit.html.iconimages.\E.*</exclude>
</excludedFiles>
<includedContentTypes>
<include>application/javascript</include>
<include>text/css</include>
<include>image/.+</include>
</includedContentTypes>
<fileNameMappings>
<property>
<name>^.*showcase.*/([^/]+\.css)$</name>
<value>org.richfaces.showcase.css/$1</value>
</property>
<property>
<name>^.+/([^/]+\.(png|gif|jpg))$</name>
<value>org.richfaces.images/$1</value>
</property>
<property>
<name>^.+/([^/]+\.css)$</name>
<value>org.richfaces.css/$1</value>
</property>
</fileNameMappings>
</configuration>
<executions>
<execution>
<id>process-resources</id>
<goals>
<goal>process</goal>
</goals>
<configuration>
<!-- default RichFaces mapping file, can be anywhere on the classpath,
but then you will will need to configure Resource Mapping configuration file
location in web.xml, refer to RichFaces Developer Guide -->
<staticResourceMappingFile>${project.build.outputDirectory}/META-INF/richfaces/static-resource-mappings.properties</staticResourceMappingFile>
<!-- resources will be placed in JAR/META-INF/resources/com.acme.staticResources/
or WAR/WEB-INF/classes/META-INF/resources/com.acme.staticResources/ depending
on packaging of this project -->
<resourcesOutputDir>${project.build.outputDirectory}/META-INF/resources/org.richfaces.staticResource/${richfaces.version}/PackedCompressed/</resourcesOutputDir>
<!-- resources will be located under JSF_RESOURCE_ROOT/com.acme.staticResources
(e.g. JAR/META-INF/com.acme.staticResources) -->
<staticResourcePrefix>org.richfaces.staticResource/${richfaces.version}/PackedCompressed</staticResourcePrefix>
<!-- resources will be packaged into a file with given filename, refer
to RichFaces Developer Guide -->
<pack>packed</pack>
<!-- resources will be compressed, refer to RichFaces Developer Guide -->
<compress>true</compress>
<excludedFiles>
<exclude>^javax.faces</exclude>
<exclude>^\Qorg.richfaces.renderkit.html.images.\E.*</exclude>
<exclude>^\Qorg.richfaces.renderkit.html.iconimages.\E.*</exclude>
<exclude>^jquery\.js$</exclude>
</excludedFiles>
</configuration>
</execution>
</executions>
</plugin>
Unfortunatelly, I get a exception. Do I have to exclude the *.js Files?
Here is the exception log:
{code}
[ERROR] Exception rendering resorce flot:jquery.flot.axislabels.js: Compilation produced 7 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 7 syntax errors.
at org.richfaces.resource.optimizer.resource.writer.impl.MavenLogErrorReporter.runtimeError(MavenLogErrorReporter.java:60)
at org.mozilla.javascript.Parser.parse(Parser.java:402)
at org.mozilla.javascript.Parser.parse(Parser.java:347)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:532)
at org.richfaces.resource.optimizer.resource.writer.impl.JavaScriptCompressingProcessor.process(JavaScriptCompressingProcessor.java:74)
at org.richfaces.resource.optimizer.resource.writer.impl.ResourceWriterImpl.writePackedResource(ResourceWriterImpl.java:165)
at org.richfaces.resource.optimizer.task.ResourceTaskFactoryImpl$ResourcesRendererCallable.renderResource(ResourceTaskFactoryImpl.java:96)
at org.richfaces.resource.optimizer.task.ResourceTaskFactoryImpl$ResourcesRendererCallable.call(ResourceTaskFactoryImpl.java:170)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
…
{code}