I am using Java 8 along with Spring-Boot 1.5.10.RELEASE
.
I still seem to need @EntityScan(basePackageClasses = { Application.class, Jsr310JpaConverters.class })
in my Application class.
I thought Spring-Boot supports Jsr310/Java8 LocalDate API starting 1.4 (according to https://github.com/spring-projects/spring-boot/issues/2721)? I am asking this, because in the 4th reply on that issue mentioned above it is mentioned, that using @EntityScan switches off the default behavior. I think
I should not need this - or do I?
Here are the relevant parts of my pom.xml:
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<!-- <scope>runtime</scope> -->
</dependency>
<!-- some other libraries, that do not contain anything hibernate/JPA -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.10.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Edgware.SR3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
In my effective POM I do have both hazelcast-hibernate4
and hazelcast-hibernate5
. Is this correct? Or is something wrong with my pom.xml?
Related SO-Q&A: New Spring Data JDK8 Jsr310JpaConverters not working automatically?
Note: this question is not related to the jackson-part (JSON) of the JSR310 problem as I did solve it by properly declaring com.fasterxml.jackson.datatype:jackson-datatype-jsr310
as a dependency.
Update:
According to mvn depedency:tree
I only use hibernate-core 5.0.12.Final
, hibernate-entitymanager 5.0.12.Final
and hibernate-validator 5.3.6.Final
. All of them are parts of some spring-boot packages.
This leaves me puzzled: if JSR310Convverters for LocalDate were implemented in hibernate 5 - why do I still have to use @EntityScan
-annotation?