Skip to content

akyao/cachemanifest-maven-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

forked from https://github.com/cantinac/cachemanifest-maven-plugin
add 'yyyy-MM-dd HH:mm:ss' format version text.

1). git clone this project.
2). mvn install in this project.
3). edit pom.xml in your client project.
    <plugins>
        <!-- ... -->
        <plugin>
            <groupId>co.cantina.maven</groupId>
            <artifactId>cachemanifest-maven-plugin</artifactId>
            <version>1.0</version>
            <configuration>
                <inputDirectory>${basedir}/src/main/webapp</inputDirectory>
                <outputManifestFile>${basedir}/src/main/webapp/cache.manifest</outputManifestFile>
                <excludes>
                    <exclude>WEB-INF/**</exclude>
                    <exclude>**/*.manifest</exclude>
                </excludes>
                <networkResources>
                    <!-- whitelist all non-cached references to allow Web services access -->
                    <networkResource>*</networkResource>
                </networkResources>
                <fallback>/index.html /index.html</fallback>
            </configuration>
        </plugin>
        <!-- ... -->
    </plugins>
4). mvn cachemanifest:generate-manifest

--------------
original text
--------------
name: Cache Manifest Maven Plugin
groupId: co.cantina.maven
artifactId: cachemanifest-maven-plugin
author: Glenn Barnett <[email protected]>

This Maven plugin generates an HTML5 Cache Manifest as per http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#manifests

Cantina doesn't have a public artifactory yet - to use it, you'll need to:

1.) run mvn install to generate the artifact

2.) (optional) deploy it to your local artifactory

3.) add it into your project's pom.xml:

    <build>
        <plugins>
            <!-- ... -->
            <plugin>
                <groupId>co.cantina.maven</groupId>
                <artifactId>cachemanifest-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <manifestVersion>1</manifestVersion>
                    <inputDirectory>${basedir}/src/main/webapp</inputDirectory>
                    <outputManifestFile>${basedir}/src/main/webapp/cache.manifest</outputManifestFile>
                    <excludes>
                        <exclude>WEB-INF/**</exclude>
                        <exclude>**/*.manifest</exclude>
                    </excludes>
                    <networkResources>
                        <!-- whitelist all non-cached references to allow Web services access -->
                        <networkResource>*</networkResource>
                    </networkResources>
                    <fallback>/index.html /index.html</fallback>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>generate-manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- ... -->
        </plugins>
    </build>

This is our first plugin release, so feedback is welcome if there are additional conventions we should be following or improvements that we should make.

About

Maven Plugin to generate an HTML5 Cache Manifest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%