JAVA-2421: Merge spring-ehcache module into spring-caching module (#10072)

* JAVA-2421: Moved 1 article from spring-ehcache to spring-caching

* JAVA-2421: Removed module spring-ehcache

* JAVA-2421: Removed module spring-ehcache from main pom
This commit is contained in:
Sampada 2020-09-23 23:34:51 +05:30 committed by GitHub
parent 20a3070093
commit 49590633a8
16 changed files with 35 additions and 124 deletions

View File

@ -651,7 +651,6 @@
<module>spring-dispatcher-servlet</module>
<module>spring-drools</module>
<module>spring-ehcache</module>
<module>spring-ejb</module>
<module>spring-exceptions</module>
@ -1152,7 +1151,6 @@
<module>spring-dispatcher-servlet</module>
<module>spring-drools</module>
<module>spring-ehcache</module>
<module>spring-ejb</module>
<module>spring-exceptions</module>

View File

@ -5,3 +5,4 @@
- [Cache Eviction in Spring Boot](https://www.baeldung.com/spring-boot-evict-cache)
- [Using Multiple Cache Managers in Spring](https://www.baeldung.com/spring-multiple-cache-managers)
- [Testing @Cacheable on Spring Data Repositories](https://www.baeldung.com/spring-data-testing-cacheable)
- [Spring Boot Ehcache Example](https://www.baeldung.com/spring-boot-ehcache)

View File

@ -36,6 +36,10 @@
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>

View File

@ -6,13 +6,15 @@ import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.UUID;
@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
public class Book {
public class Book implements Serializable {
@Id
private UUID id;

View File

@ -1,4 +1,4 @@
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
@ -6,3 +6,6 @@ spring.datasource.password=
# Enabling H2 Console
spring.h2.console.enabled=true
spring.h2.console.path=/h2
#ehcache
spring.cache.jcache.config=classpath:ehcache.xml

View File

@ -27,5 +27,28 @@
<offheap unit="MB">10</offheap>
</resources>
</cache>
<cache alias="books">
<key-type>java.lang.String</key-type>
<value-type>com.baeldung.springdatacaching.model.Book</value-type>
<expiry>
<ttl unit="seconds">30</ttl>
</expiry>
<listeners>
<listener>
<class>com.baeldung.cachetest.config.CacheEventLogger</class>
<event-firing-mode>ASYNCHRONOUS</event-firing-mode>
<event-ordering-mode>UNORDERED</event-ordering-mode>
<events-to-fire-on>CREATED</events-to-fire-on>
<events-to-fire-on>EXPIRED</events-to-fire-on>
</listener>
</listeners>
<resources>
<heap unit="entries">2</heap>
<offheap unit="MB">10</offheap>
</resources>
</cache>
</config>

View File

@ -1,13 +0,0 @@
*.class
#folders#
/target
/neoDb*
/data
/src/main/webapp/WEB-INF/classes
*/META-INF/*
# Packaged files #
*.jar
*.war
*.ear

View File

@ -1,8 +0,0 @@
## Spring Ehcache
This module contains articles about Spring with Ehcache
### Relevant Articles:
- [Spring Boot Ehcache Example](https://www.baeldung.com/spring-boot-ehcache)

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="AvoidStarImport">
<property name="severity" value="warning" />
</module>
</module>
</module>

View File

@ -1,87 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-ehcache</artifactId>
<version>0.1-SNAPSHOT</version>
<name>spring-ehcache</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-boot-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
</dependencies>
<build>
<finalName>spring-ehcache</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle-maven-plugin.version}</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle-maven-plugin.version}</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
</configuration>
</plugin>
</plugins>
</reporting>
<properties>
<!-- Maven plugins -->
<checkstyle-maven-plugin.version>3.0.0</checkstyle-maven-plugin.version>
<dependency.locations.enabled>false</dependency.locations.enabled>
</properties>
</project>

View File

@ -1 +0,0 @@
spring.cache.jcache.config=classpath:ehcache.xml