1 2 Previous Next 17 Replies Latest reply on Jun 15, 2009 10:35 AM by Pramod Nair

    JS/CSS resource optimization

    Stephan B Newbie

      Hi!

      I want to optimize the usage of RichFaces' JS/CSS resources in my application.

      - When I let RichFaces load only the resources it really needs, I get the smallest possible total file size, but like a dozen separate HTTP requests.
      - When I tell RichFaces to load ALL resources at once, I get only 2 HTTP requests but a HUGE download on the landing page (yet only once).

      I read somewhere that the resource package can be customized with a Maven plugin (https://www.jboss.org/community/docs/DOC-13329) in order to only contain actually used resources.
      Yet despite the extensive wiki page information I can't get it to work.

      My plugin config looks like this:

      <plugin>
       <artifactId>maven-resource-dependency-plugin</artifactId>
       <groupId>org.richfaces.cdk</groupId>
       <version>3.3.1.BETA5</version>
       <executions>
       <execution>
       <phase>process-resources</phase>
       <goals>
       <goal>assembly-resources</goal>
       </goals>
       <configuration>
       <scriptFileName>all.js</scriptFileName>
       <styleFileName>all.xcss</styleFileName>
       </configuration>
       </execution>
       </executions>
      </plugin>
      


      When executed it scans all my xhtml files; however, afterwards no output is generated. The wiki page says it should end up in '${basedir}/src/main/webapp', but nothing ever appears. I also tried setting the , still no output.
      The maving logging isn't too helpful either, no info if anything failed or worked.

      I'm not sure if I use it right. Can anybody give me some pointers?

      Cheers,
      Stephan

        • 1. Re: JS/CSS resource optimization
          Anton Belevich Novice

          Hi stephanos,

          There is an error in article.

          Mergerd styles/scripts default output dir is ${basedir}/src/main/webapp/WEB-INF/classes.

          • 2. Re: JS/CSS resource optimization
            Stephan B Newbie

            Thanks for your answer!

            Well, I can't find any output in ${basedir}/src/main/webapp/WEB-INF/classes either!

            What could be there reason therefore? - the maven process simply reads my xhtmls but doesn't say anything. Maybe it can't read my xhtml-files properly, here is an example:

            <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:a="http://richfaces.org/a4j"
             xmlns:c="http://java.sun.com/jstl/core"
             xmlns:rich="http://richfaces.org/rich"
             xmlns:s="http://jboss.com/products/seam/taglib">
            <ui:composition>
             <a:status .../>
            </ui:composition>
            </html>


            (Had to use tag to make Netbeans read my xhtmls properly).

            What do you think?

            • 3. Re: JS/CSS resource optimization
              Stephan B Newbie

              PS: just tried it without the -tag, doesn't produce any output either.

              • 4. Re: JS/CSS resource optimization
                Anton Belevich Novice

                Could you post maven output?

                • 5. Re: JS/CSS resource optimization
                  Stephan B Newbie

                   

                  [INFO] ------------------------------------------------------------------------
                  [INFO] [resources:resources]
                  [INFO] Using default encoding to copy filtered resources.
                  [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
                  [INFO] Setting property: velocimacro.messages.on => 'false'.
                  [INFO] Setting property: resource.loader => 'classpath,cdk'.
                  [INFO] Setting property: resource.manager.logwhenfound => 'false'.
                  [INFO] Setting property: cdk.resource.loader.class => 'org.ajax4jsf.builder.velocity.ResourceLoader'.
                  [INFO] **************************************************************
                  [INFO] Starting Jakarta Velocity v1.4
                  [INFO] RuntimeInstance initializing.
                  [INFO] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
                  [INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
                  [INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
                  [INFO] ClasspathResourceLoader : initialization starting.
                  [INFO] ClasspathResourceLoader : initialization complete.
                  [INFO] Resource Loader Instantiated: org.ajax4jsf.builder.velocity.ResourceLoader
                  [INFO] ClasspathResourceLoader : initialization starting.
                  [INFO] ClasspathResourceLoader : initialization complete.
                  [INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
                  [INFO] Default ResourceManager initialization complete.
                  [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
                  [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
                  [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
                  [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
                  [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
                  [INFO] Created: 20 parsers.
                  [INFO] Velocimacro : initialization starting.
                  [INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
                  [INFO] Velocimacro : added new VM : #quietnull( a ) : source = VM_global_library.vm
                  [INFO] Velocimacro : added new VM : #tagPropertyMethods12( source ) : source = VM_global_library.vm
                  [INFO] Velocimacro : added new VM : #tagPropertyRelease( source ) : source = VM_global_library.vm
                  [INFO] Velocimacro : VM library template macro registration complete.
                  [INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
                  [INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
                  [INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
                  [INFO] Velocimacro : initialization complete.
                  [INFO] Velocity successfully started.
                  [INFO] [resource-dependency:assembly-resources]
                  [INFO] artifact /home/stephanos/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/logkit/logkit/1.0.1/logkit-1.0.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/metawidget/metawidget/0.7/metawidget-0.7.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/metawidget/metawidget-backend/0.7/metawidget-backend-0.7.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/metawidget/metawidget-frontend/0.7/metawidget-frontend-0.7.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/com/sun/jsf-impl/1.2_10/jsf-impl-1.2_10.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/javax/faces/jsf-api/1.2_10/jsf-api-1.2_10.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/jboss/seam/jboss-seam/2.1.1.GA/jboss-seam-2.1.1.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/jboss/el/jboss-el/1.0_02.CR2/jboss-el-1.0_02.CR2.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/tuckey/urlrewritefilter/3.1.0/urlrewritefilter-3.1.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/hibernate/hibernate-entitymanager/3.4.0.GA/hibernate-entitymanager-3.4.0.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/hibernate/hibernate-commons-annotations/3.1.0.GA/hibernate-commons-annotations-3.1.0.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/hibernate/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/hibernate/hibernate-core/3.3.0.SP1/hibernate-core-3.3.0.SP1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/xml-apis/xml-apis/1.3.03/xml-apis-1.3.03.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/javassist/javassist/3.4.GA/javassist-3.4.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/hibernate/hibernate-validator/3.1.0.GA/hibernate-validator-3.1.0.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/net/sf/ehcache/ehcache/1.5.0/ehcache-1.5.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/backport-util-concurrent/backport-util-concurrent/2.1/backport-util-concurrent-2.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/net/sf/jsr107cache/jsr107cache/1.0/jsr107cache-1.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/hibernate/hibernate-ehcache/3.3.1.GA/hibernate-ehcache-3.3.1.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/hibernate/hibernate-tools/3.2.3.GA/hibernate-tools-3.2.3.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/freemarker/freemarker/2.3.8/freemarker-2.3.8.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/hibernate/jtidy/r8-20060801/jtidy-r8-20060801.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/jboss/envers/jboss-envers/1.2.0.GA-hibernate-3.3/jboss-envers-1.2.0.GA-hibernate-3.3.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/slf4j/slf4j-log4j12/1.5.2/slf4j-log4j12-1.5.2.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/jasypt/jasypt/1.3.1/jasypt-1.3.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/com/ibm/icu/icu4j/3.4.4/icu4j-3.4.4.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/compass-project/compass/2.2.0/compass-2.2.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/lucene/lucene-core/2.4.1/lucene-core-2.4.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/lucene/lucene-analyzers/2.4.1/lucene-analyzers-2.4.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/lucene/lucene-highlighter/2.4.1/lucene-highlighter-2.4.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/net/jawr/jawr/2.7/jawr-2.7.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/opensymphony/quartz/quartz/1.6.1/quartz-1.6.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/testng/testng/5.8/testng-5.8-jdk15.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/junit/junit/3.8/junit-3.8.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/javax/mail/mail/1.4/mail-1.4.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/javax/ws/rs/jsr311-api/1.0/jsr311-api-1.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/com/sun/jersey/jersey-bundle/1.0/jersey-bundle-1.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/jboss/seam/jboss-seam-ui/2.1.1.GA/jboss-seam-ui-2.1.1.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/jboss/seam/jboss-seam-jul/2.1.1.GA/jboss-seam-jul-2.1.1.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/jboss/seam/jboss-seam-mail/2.1.1.GA/jboss-seam-mail-2.1.1.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/jboss/jboss-faces/4.2.3.GA/jboss-faces-4.2.3.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/jboss/jboss-serialization/4.2.2.GA/jboss-serialization-4.2.2.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/trove/trove/1.0.2/trove-1.0.2.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/asm/asm/3.1/asm-3.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/com/sun/messaging/mq/jms/4.2/jms-4.2.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/richfaces/framework/richfaces-impl/3.3.1.CR2/richfaces-impl-3.3.1.CR2.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/richfaces/framework/richfaces-api/3.3.1.CR2/richfaces-api-3.3.1.CR2.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/richfaces/ui/richfaces-ui/3.3.1.CR2/richfaces-ui-3.3.1.CR2.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/nekohtml/nekohtml/1.9.6.2/nekohtml-1.9.6.2.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/xerces/xercesImpl/2.8.1/xercesImpl-2.8.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/jdepend/jdepend/2.9.1/jdepend-2.9.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/mockito/mockito-all/1.7/mockito-all-1.7.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/fest/fest-assert/1.1a1/fest-assert-1.1a1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/fest/fest-util/1.0/fest-util-1.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/com/h2database/h2/1.1.102/h2-1.1.102.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/jboss/jsfunit/jboss-jsfunit-core/1.0.0.GA/jboss-jsfunit-core-1.0.0.GA.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/net/sourceforge/htmlunit/htmlunit/2.4/htmlunit-2.4.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/xalan/xalan/2.7.0/xalan-2.7.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/net/sourceforge/htmlunit/htmlunit-core-js/2.4/htmlunit-core-js-2.4.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/net/sourceforge/nekohtml/nekohtml/1.9.9/nekohtml-1.9.9.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/w3c/css/sac/1.3/sac-1.3.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/cactus/cactus/13-1.7.1/cactus-13-1.7.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/cactus/cactus-ant/13-1.7.1/cactus-ant-13-1.7.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/aspectj/aspectjrt/1.2.1/aspectjrt-1.2.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/cargo/cargo/0.5/cargo-0.5.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/glassfish/embedded/glassfish-embedded-all/3.0-SNAPSHOT/glassfish-embedded-all-3.0-SNAPSHOT.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/openejb/openejb-core/3.0/openejb-core-3.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/openejb/javaee-api/5.0-1/javaee-api-5.0-1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/openejb/openejb-loader/3.0/openejb-loader-3.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/openejb/openejb-javaagent/3.0/openejb-javaagent-3.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/openejb/openejb-jee/3.0/openejb-jee-3.0.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/com/sun/xml/bind/jaxb-impl/2.0.5/jaxb-impl-2.0.5.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/commons-cli/commons-cli/1.1/commons-cli-1.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/activemq/activemq-ra/4.1.1/activemq-ra-4.1.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/activemq/activemq-core/4.1.1/activemq-core-4.1.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/activemq/activeio-core/3.0.0-incubator/activeio-core-3.0.0-incubator.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/net/sourceforge/serp/serp/1.13.1/serp-1.13.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/geronimo/components/geronimo-connector/2.1/geronimo-connector-2.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/geronimo/components/geronimo-transaction/2.1/geronimo-transaction-2.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/objectweb/howl/howl/1.0.1-1/howl-1.0.1-1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/geronimo/javamail/geronimo-javamail_1.4_mail/1.2/geronimo-javamail_1.4_mail-1.2.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/openejb/xbean-reflect/3.4-r636442/xbean-reflect-3.4-r636442.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/openejb/xbean-finder/3.4-r636442/xbean-finder-3.4-r636442.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/xbean/xbean-naming/3.3/xbean-naming-3.3.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/asm/asm-commons/2.2.3/asm-commons-2.2.3.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/asm/asm-tree/2.2.3/asm-tree-2.2.3.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/apache/openejb/commons-dbcp-all/1.3/commons-dbcp-all-1.3.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/codehaus/swizzle/swizzle-stream/1.0.1/swizzle-stream-1.0.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/wsdl4j/wsdl4j/1.6.1/wsdl4j-1.6.1.jar is resolved
                  [INFO] artifact /home/stephanos/dev/workspace/portal.test.ui/pom.xml is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/openqa/selenium/webdriver/webdriver-htmlunit/0.6.964/webdriver-htmlunit-0.6.964.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/openqa/selenium/webdriver/webdriver-common/0.6.964/webdriver-common-0.6.964.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/openqa/selenium/webdriver/webdriver-firefox/0.6.964/webdriver-firefox-0.6.964.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/json/json/20080701/json-20080701.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/openqa/selenium/webdriver/webdriver-support/0.6.964/webdriver-support-0.6.964.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/hamcrest/hamcrest-all/1.1/hamcrest-all-1.1.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/jvnet/mock-javamail/mock-javamail/1.7/mock-javamail-1.7.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1.6.jar is resolved
                  [INFO] artifact /home/stephanos/.m2/repository/org/jboss/seam/jboss-seam-debug/2.1.1.GA/jboss-seam-debug-2.1.1.GA.jar is resolved
                  [INFO] process file: dialogConnection.xhtml
                  [INFO] process file: nonblocking.xhtml
                  [INFO] process file: blocking.xhtml
                  [INFO] process file: home.xhtml
                  


                  PS: I reduced the included xhtml files to just 4 to speed up my trial-and-error cycles with the plugin (yet namespace for rich and a4j are definitely included).

                  • 6. Re: JS/CSS resource optimization
                    Anton Belevich Novice

                    Is this a complete maven output? I couldn't see lines with styles/scripts files process information ...

                    • 7. Re: JS/CSS resource optimization
                      Stephan B Newbie

                      Well I cut out the presumably unimportant part:

                      [INFO] [compiler:compile]
                      [INFO] Compiling 6 source files to /home/stephanos/dev/workspace/myproj/target/classes
                      [INFO] Scanning for projects...

                      But that's it...

                      At the very bottom of the long post above it says:
                      [INFO] process file: dialogConnection.xhtml
                      [INFO] process file: nonblocking.xhtml
                      [INFO] process file: blocking.xhtml
                      [INFO] process file: home.xhtml

                      Do you mean that? - I never saw more than that concerning the resource processing.

                      PS: By the way, did I understand the wiki page correctly that the *.component-dependencies.xml files are read from the richfaces jars? do I need the cdk for that?

                      • 8. Re: JS/CSS resource optimization
                        Anton Belevich Novice

                        after xhtml files is processed

                        [INFO] process file: dialogConnection.xhtml
                        [INFO] process file: nonblocking.xhtml
                        [INFO] process file: blocking.xhtml
                        [INFO] process file: home.xhtml
                        


                        plugin resolve components scripts/styles files ...
                        e.g. maven output should looks like this:
                        [info] process resource : file:/C:/work/repo/org/richfaces/framework/richfaces-i
                        mpl/3.3.1-SNAPSHOT/richfaces-impl-3.3.1-SNAPSHOT.jar!/org/ajax4jsf/javascript/sc
                        ripts/prototype.js
                        [info] process resource : file:/C:/work/repo/org/richfaces/framework/richfaces-i
                        mpl/3.3.1-SNAPSHOT/richfaces-impl-3.3.1-SNAPSHOT.jar!/org/ajax4jsf/javascript/sc
                        ripts/AJAX.js
                        




                        Yes you understand correctly these files (*.component-dependencies.xml) are read from richfaces jars. They are generated during richfaces main build and you don't need cdk for that.


                        • 9. Re: JS/CSS resource optimization
                          Stephan B Newbie

                          I'm trying this for quite some time (from 3.3.1.Beta5 to 3.3.1.CR2), but I never saw anything like "process resource"...

                          hm, so what might have gone wrong?

                          PS:

                          Maven version: 2.0.9
                          Java version: 1.6.0_13
                          OS name: "linux" version: "2.6.28-11-generic" arch: "amd64" Family: "unix"

                          (also got a CentOS CI - 32Bit - server running, which also doesn't generate the output)

                          • 10. Re: JS/CSS resource optimization
                            Frederic Guillermin Newbie

                            Hello,

                            I had the same problem. In fact, i forgot to set the dependencies in the pom.xml :


                            org.richfaces.ui
                            richfaces-ui
                            3.3.1.CR1



                            Best regards,
                            Fred

                            • 11. Re: JS/CSS resource optimization
                              Stephan B Newbie

                              Thanks for the hint!

                              I set my RichFaces-related dependencies like this:

                               <dependency>
                               <groupId>org.richfaces.framework</groupId>
                               <artifactId>richfaces-impl</artifactId>
                               <version>${richfaces.version}</version>
                               <exclusions>
                               <exclusion>
                               <groupId>commons-logging</groupId>
                               <artifactId>commons-logging</artifactId>
                               </exclusion>
                               <exclusion>
                               <groupId>junit</groupId>
                               <artifactId>junit</artifactId>
                               </exclusion>
                               <exclusion>
                               <groupId>javax.faces</groupId>
                               <artifactId>jsf-api</artifactId>
                               </exclusion>
                               <exclusion>
                               <groupId>javax.servlet</groupId>
                               <artifactId>servlet-api</artifactId>
                               </exclusion>
                               </exclusions>
                               </dependency>
                              
                               <dependency>
                               <groupId>org.richfaces.ui</groupId>
                               <artifactId>richfaces-ui</artifactId>
                               <version>${richfaces.version}</version>
                               <exclusions>
                               <exclusion>
                               <groupId>commons-logging</groupId>
                               <artifactId>commons-logging</artifactId>
                               </exclusion>
                               <exclusion>
                               <groupId>javax.faces</groupId>
                               <artifactId>jsf-api</artifactId>
                               </exclusion>
                               </exclusions>
                               </dependency>
                              
                               <dependency>
                               <groupId>org.richfaces.framework</groupId>
                               <artifactId>richfaces-api</artifactId>
                               <version>${richfaces.version}</version>
                               <exclusions>
                               <exclusion>
                               <artifactId>commons-logging</artifactId>
                               <groupId>commons-logging</groupId>
                               </exclusion>
                               <exclusion>
                               <artifactId>junit</artifactId>
                               <groupId>junit</groupId>
                               </exclusion>
                               <exclusion>
                               <artifactId>jsf-api</artifactId>
                               <groupId>javax.faces</groupId>
                               </exclusion>
                               </exclusions>
                               </dependency>
                              
                               <dependency>
                               <groupId>nekohtml</groupId>
                               <artifactId>nekohtml</artifactId>
                               <version>1.9.6.2</version>
                               </dependency>

                               <properties>
                               <richfaces.version>3.3.1.CR2</richfaces.version>
                               </properties>


                              • 12. Re: JS/CSS resource optimization
                                Stephan B Newbie

                                PS: that's my status quo - no changes necessary

                                Anybody got it working or can guess what's wrong?

                                • 13. Re: JS/CSS resource optimization
                                  Frederic Guillermin Newbie

                                  Here the pom.xml i use :

                                  <project xmlns="http://maven.apache.org/POM/4.0.0"
                                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
                                   <modelVersion>4.0.0</modelVersion>
                                   <groupId>fr.cmre.testmvn</groupId>
                                   <artifactId>testMvn</artifactId>
                                   <version>1</version>
                                   <name>test Maven</name>
                                  
                                  
                                   <build>
                                   <plugins>
                                   <plugin>
                                   <artifactId>
                                   maven-resource-dependency-plugin
                                   </artifactId>
                                   <groupId>org.richfaces.cdk</groupId>
                                   <version>3.3.1.CR1</version>
                                   <configuration>
                                  
                                   <webSourceDirectory>
                                   c:/_CMRE/wkspc/testMvnFacelet/WebContent
                                   </webSourceDirectory>
                                  
                                   <scriptFileName>out.js</scriptFileName>
                                   <outputScriptDirectory>
                                   c:/_CMRE/wkspc/testMvnFacelet/WebContent/js
                                   </outputScriptDirectory>
                                  
                                  
                                   <styleFileName>testmvn.css</styleFileName>
                                   <outputStyleDirectory>
                                   c:/_CMRE/wkspc/testMvnFacelet/WebContent/css
                                   </outputStyleDirectory>
                                   <xhtmlIncludes>
                                   <xhtmlInclude>*.jsp</xhtmlInclude>
                                   </xhtmlIncludes>
                                  
                                  
                                  
                                   </configuration>
                                   <executions>
                                   <execution>
                                   <phase>process-resources</phase>
                                   <goals>
                                   <goal>assembly-resources</goal>
                                   </goals>
                                   </execution>
                                   </executions>
                                   </plugin>
                                   </plugins>
                                   </build>
                                   <repositories>
                                   <repository>
                                   <id>maven2-repository.dev.java.net</id>
                                   <name>Java.net Repository for Maven</name>
                                   <url>http://download.java.net/maven/1</url>
                                   <layout>legacy</layout>
                                   <releases>
                                   <updatePolicy>always</updatePolicy>
                                   </releases>
                                   <snapshots>
                                   <enabled>false</enabled>
                                   </snapshots>
                                   </repository>
                                   <repository>
                                   <id>repository.jboss.com</id>
                                   <name>Jboss Repository for Maven</name>
                                   <url>http://repository.jboss.com/maven2/</url>
                                   <snapshots>
                                   <enabled>false</enabled>
                                   </snapshots>
                                   </repository>
                                   </repositories>
                                   <pluginRepositories>
                                   <pluginRepository>
                                   <id>maven.jboss.org</id>
                                   <name>JBoss Repository for Maven Snapshots</name>
                                   <url>http://snapshots.jboss.org/maven2/</url>
                                   <releases>
                                   <enabled>false</enabled>
                                   </releases>
                                   <snapshots>
                                   <updatePolicy>always</updatePolicy>
                                   </snapshots>
                                   </pluginRepository>
                                   <pluginRepository>
                                   <id>repository.jboss.com</id>
                                   <name>Jboss Repository for Maven</name>
                                   <url>http://repository.jboss.com/maven2/</url>
                                   <releases>
                                   <updatePolicy>always</updatePolicy>
                                   </releases>
                                   <snapshots>
                                   <enabled>false</enabled>
                                   </snapshots>
                                   </pluginRepository>
                                   </pluginRepositories>
                                   <dependencies>
                                   <dependency>
                                   <groupId>org.richfaces.ui</groupId>
                                   <artifactId>richfaces-ui</artifactId>
                                   <version>3.3.1.CR1</version>
                                   </dependency>
                                   </dependencies>
                                  
                                  </project>
                                  


                                  • 14. Re: JS/CSS resource optimization
                                    Stephan B Newbie

                                    Thank you very much for posting your pom.xml.
                                    Although I applied most of it, no change in result :-(

                                    1 2 Previous Next