What are the Maven coordinates for the JCache API jar?

1.1k views Asked by At

I have an executable JAR (not a web app being deployed to a standard container like Tomcat, etc.) that needs to connect to a DB and cache a lot of stuff.

If at all possible, I'd like to use the JCache API and inject (via Guice) the Hazelcast implementation. I will code 100% against the JCache API, so that if I ever change my mind and choose another implementation, the swap out should be (relatively) painless.

One problem: where can I get the latest stable JCache JAR?!? (What are the Maven coordinates?)

On Maven Central, all I can find are some dev JARs from 2005! So I ask: where is the JCache?

2

There are 2 answers

6
Jérémie B On

The jar are available here : javax.cache/cache-api

0
MDIT On

If you want to use Ehcache implementations, copy/past the dependencies below:

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.7.12</version>
</dependency>

<dependency>
    <groupId>javax.cache</groupId>
    <artifactId>cache-api</artifactId>
    <version>1.0.0</version>
</dependency>

<dependency>
    <groupId>org.ehcache</groupId>
    <artifactId>ehcache</artifactId>
    <version>3.1.1</version>
    <scope>runtime</scope>
</dependency>

Find a complete example here.