Add JCache support
diff --git a/pom.xml b/pom.xml index e58ab40..418a6e0 100644 --- a/pom.xml +++ b/pom.xml
@@ -80,6 +80,7 @@ <jacocoAgent/> <!-- non-dependency-based properties: --> <shiro.osgi.importRange>[2, 3)</shiro.osgi.importRange> + <jcache.osgi.importRange>[1.1,2)</jcache.osgi.importRange> <!-- Compile 3rd party dependencies: --> <!-- Don't change this version without also changing the shiro-aspect and shiro-features @@ -100,6 +101,7 @@ <hazelcast.version>5.2.1</hazelcast.version> <hsqldb.version>2.7.1</hsqldb.version> <javax.annotation.api.version>1.3.2</javax.annotation.api.version> + <jcache.api.version>1.1.1</jcache.api.version> <jdk.version>11</jdk.version> <jetty.version>9.4.34.v20201102</jetty.version> <owasp.java.encoder.version>1.2.3</owasp.java.encoder.version>
diff --git a/support/features/src/main/resources/features.xml b/support/features/src/main/resources/features.xml index dd2f490..9c065e9 100644 --- a/support/features/src/main/resources/features.xml +++ b/support/features/src/main/resources/features.xml
@@ -52,6 +52,12 @@ <bundle>mvn:org.apache.shiro/shiro-aspectj/${project.version}</bundle> </feature> + <feature name="shiro-cache" version="${project.version}"> + <feature version="${project.version}">shiro-core</feature> + <bundle dependency='true'>mvn:javax.cache/cache-api/${jcache.api.version}</bundle> + <bundle>mvn:org.apache.shiro/shiro-cache/${project.version}</bundle> + </feature> + <feature name="shiro-ehcache" version="${project.version}"> <feature version="${project.version}">shiro-core</feature> <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache/${ehcache.bundle.version}</bundle>
diff --git a/support/jcache/pom.xml b/support/jcache/pom.xml index 6e45484..4dca509 100644 --- a/support/jcache/pom.xml +++ b/support/jcache/pom.xml
@@ -22,7 +22,7 @@ <parent> <groupId>org.apache.shiro</groupId> <artifactId>shiro-support</artifactId> - <version>1.8.1-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> @@ -32,7 +32,7 @@ <packaging>bundle</packaging> <properties> - <jcache.osgi.importRange>[1.1,2)</jcache.osgi.importRange> + </properties> <dependencies> @@ -43,7 +43,7 @@ <dependency> <groupId>javax.cache</groupId> <artifactId>cache-api</artifactId> - <version>1.1.1</version> + <version>${jcache.api.version}</version> </dependency> <!-- Test dependencies --> <dependency> @@ -76,7 +76,7 @@ <Export-Package>org.apache.shiro.jcache*;version=${project.version}</Export-Package> <Import-Package> org.apache.shiro*;version="${shiro.osgi.importRange}", - com.hazelcast*;version="${jcache.osgi.importRange}", + javax.cache*;version="${jcache.osgi.importRange}", * </Import-Package> </instructions>
diff --git a/support/jcache/src/main/java/org/apache/shiro/cache/jcache/JCacheManager.java b/support/jcache/src/main/java/org/apache/shiro/cache/jcache/JCacheManager.java index 38fb4f3..a694d50 100644 --- a/support/jcache/src/main/java/org/apache/shiro/cache/jcache/JCacheManager.java +++ b/support/jcache/src/main/java/org/apache/shiro/cache/jcache/JCacheManager.java
@@ -21,9 +21,9 @@ import org.apache.shiro.cache.Cache; import org.apache.shiro.cache.CacheException; import org.apache.shiro.cache.CacheManager; -import org.apache.shiro.util.Destroyable; -import org.apache.shiro.util.Initializable; -import org.apache.shiro.util.StringUtils; +import org.apache.shiro.lang.util.Destroyable; +import org.apache.shiro.lang.util.Initializable; +import org.apache.shiro.lang.util.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory;