gitblit / capsule-localcache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Capsule localcache

localcache is a Capsule caplet which relocates the capsule cache directory to be co-located with the capsule jar file.

.
├── myapp.jar
└── .capsule
    └── apps
        └── myapp

This caplet allows you to remove a Capsule and all it's extracted resources by deleting the directory containing your Capsule jar file.

Limitations

By design, Capsule's internals are locked-down. This caplet uses reflection to manipulate the static value that specifies the cache directory.

This caplet is built against Capsule 1.0.1 but it is a fragile workaround for a missing feature in core Capsule.

Maven Usage

Add the dependency to your capsule application.

<dependency>
    <groupId>com.gitblit.capsule</groupId>
    <artifactId>localcache</artifactId>
    <version>1.0.0</version>
</dependency>

Configure the Capsule Maven plugin to load this caplet on startup.

<plugin>
    <groupId>com.github.chrischristo</groupId>
    <artifactId>capsule-maven-plugin</artifactId>
    <version>1.0.2</version>
    <executions>
        <execution>
            <goals>
                <goal>build</goal>
            </goals>
            <configuration>
                <appClass>com.namespace.yourapp.Launcher</appClass>
                <caplets>com.gitblit.capsule:localcache:1.0.0</caplets>
            </configuration>
        </execution>
    </executions>
</plugin>

License

Distributed under the Apache Software License 2.0.

About

License:Apache License 2.0


Languages

Language:Java 100.0%