This is an automated email from the ASF dual-hosted git repository. bdemers pushed a commit to branch jcache-main in repository https://gitbox.apache.org/repos/asf/shiro.git
commit f43a097519d6171d600cc1de0337e3b6073667c9 Author: francois papon <[email protected]> AuthorDate: Sun Jan 29 19:20:04 2023 +0100 Add JCache support --- pom.xml | 2 ++ support/features/src/main/resources/features.xml | 6 ++++++ support/jcache/pom.xml | 8 ++++---- .../main/java/org/apache/shiro/cache/jcache/JCacheManager.java | 6 +++--- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index e58ab402..418a6e0d 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 dd2f490b..9c065e94 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 6e45484c..4dca5095 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 38fb4f37..a694d50f 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 @@ package org.apache.shiro.cache.jcache; 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;
