Note this guide uses the former
Kikaha v2.0.4
and the wro4j's versionv1.8.0
.
Improving web page performance with Wro4j in Kikaha.
pom.xml
....
<dependency>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-core</artifactId>
<version>1.8.0</version>
</dependency>
...
pom.xml
....
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>1.8.0</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<extraConfigFile>${config.dir.web}/WEB-INF/wro.properties</extraConfigFile>
<wroFile>${config.dir.web}/WEB-INF/wro.xml</wroFile>
<targetGroups>all</targetGroups>
<minimize>true</minimize>
<cssDestinationFolder>${config.dir.web}/compiled/css/</cssDestinationFolder>
<jsDestinationFolder>${config.dir.web}/compiled/js/</jsDestinationFolder>
<contextFolder>${config.dir.web}</contextFolder>
<ignoreMissingResources>true</ignoreMissingResources>
</configuration>
</plugin>
...
directories
. These directories contains all (and custom) css and js files (jquery.js, bootstrap.css, custom.css etc.)<kikaha project>/webapp/assets/css
<kikaha project>/webapp/assets/js
directory
for the wro4j
configuration files.<kikaha project>/webapp/WEB-INF/web.xml
<kikaha project>/webapp/WEB-INF/wro.properties
<kikaha project>/webapp/WEB-INF/wro.xml
<kikaha project>/webapp/WEB-INF/web.xml
configurations.
```
6. Add `<kikaha project>/webapp/WEB-INF/wro.properties` configurations.
resourceWatcherUpdatePeriod=5 debug=false disableCache=false gzipResources=true cacheGzippedContent=false ignoreMissingResources=true jmxEnabled=true parallelPreprocessing=true managerFactoryClassName=ro.isdc.wro.manager.factory.ConfigurableWroManagerFactory preProcessors=cssUrlRewriting, cssImport, lessCss.less, semicolonAppender, coffeeScript.coffee postProcessors=yuiCssMin,jsMin ignoreEmptyGroup=true ignoreFailingProcessor=true hashStrategy=MD5
7. Add `<kikaha project>/webapp/WEB-INF/wro.xml` configurations.
8. Create *${config.dir.web}/compiled/css* and *${config.dir.web}/compiled/css* `directories`. These are output directories of css and js files.
9. Use the `compiled` `minified` css and js files in the [html template](https://github.com/fizzed/rocker).
€¦
<!-- Wro4j js (compiled) -->
<script src="/compiled/js/all.js"></script>
€¦
```
WELCOME About Kikaha philosophy
GETTING STARTED Getting started in 1 minute Creating a Kikaha maven project Architecture overview
TUTORIALS Logging configuration Configuring the server Creating your first HTTP route Kikaha's command line interface Configuring your favorite IDE Wro4j Integration
CORE FEATURES HTTP and HTTPS Routing static assets Dependency injection Authentication and authorization Smart routes
ESSENTIAL MODULES μRouting API WebSocket Routing Database Connection Pool JSON with Jackson Protobuf Mustache Templates Rocker Templates BCrypt
CLOUD MODULES Overview of Cloud Modules Consul.io Codahale's Metrics Auth0 Single Sign-On μWorkers - Actor-like API Hazelcast
AWS-RELATED MODULES Overview of AWS-Related Modules Deploying Applications on AWS AWS IAM Credentials AWS EC2 AWS SQS queues AWS CloudWatch metrics AWS Application Load Balancer AWS Lambda functions AWS X-Ray
ADVANCED TOPICS Creating custom modules Routing with Undertow's API Creating custom cloud modules