Spring Boot: The managed version is 1.3.2.RELEASE The artifact is managed in org.springframework.boot:spring-boot-dependencies:1.3.2.RELEASE - spring

I create a skeleton application use Spring boot. This is my pom.xml
<?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>
<groupId>com.lynas</groupId>
<artifactId>SpringMVCHibernate</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>SpringMVCHibernate</name>
<description>SpringMVCHibernate</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
I stuck at this step:
Spring Boot: The managed version is 1.3.2.RELEASE The artifact is
managed in
org.springframework.boot:spring-boot-dependencies:1.3.2.RELEASE
When I try add Hiberante 5.1.0.Final manually, this notice appear:
Overriding managed version 4.3.11.Final for hibernate-core
Help me resolve these problem.

Spring Boot provides dependency management for Hibernate. The warning is Eclipse telling you that you've overridden this dependency management by declaring a version directly on a dependency. That's a risky thing to do as you may end up with a mixture of Hibernate versions on the classpath. In fact, looking at your pom, you've overridden the version of hibernate-core but not of hibernate-entitymanager. This means you'll have 5.1.0.Final of the former and 4.3.11.Final of the latter on the classpath. That will almost certainly lead to problems at runtime.
A safer way to use Hibernate 5 is to override Boot's dependency management. As you are using spring-boot-starter-parent as your pom's parent you can do that by overriding the hibernate.version property:
<properties>
<hibernate.version>5.1.0.Final</hibernate.version>
</properties>
This will ensure that all Hibernate modules for which Spring Boot provides dependency management will have the desired version.
Finally, a note of caution. Hibernate 5.1 is very new and contains some breaking changes, even from 5.0.x. As a result, you may run into some incompatibility problems. If you don't want to be right on the bleeding edge, 5.0.x may be a safer choice. It will become the default Hibernate version in Spring Boot 1.4.

Spring Boot automatically defines version for dependencies as listed in this appendix.
http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#appendix-dependency-versions
Eclipse is just reminding about it. You can ignore the warning if you really want to change the version for that dependency.
Update:
See Andy's answer: https://stackoverflow.com/a/35385268/1433665

In addition to the answers above. My issue was an old version of STS/Eclipse. After reinstalling with the latest and greatest Spring Tools the error was resolved.
https://spring.io/tools

Related

Spring application shut down at startup

I have this strange behaviour with my spring boot application where suddently the startup process doesn't work anymore. Here's the all the log:
I really can't say what's wrong since it stopped working. I also fetched on git the remote version of the code that is deployed and working right now. I use Intellij Idea as IDE, I have already restarted the IDE and the laptop.
I looked over the Internet but everyone having this issue has problems abot pom or dependency. I can't get a clue from the logs. Thanks in advance.
EDIT: Here is my pom.xml
<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>
<parent>
<groupId>it.reag</groupId>
<artifactId>reag-common-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>reag-mailsender-batch</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>it.reag</groupId>
<artifactId>reag-common-api-model</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.0.jre8</version>
</dependency>
</dependencies>
<build>
<finalName>MailSenderBatch</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Note that if I change the spring-boot-starter dependency with spring-boot-starter-web the app works, but I don't understand why. I don't use any of the feature of web environment. Also, it worked perfectly until the other day with the spring-boot-starter dependency.
Leaving this answer as it may help others. If one defines a parent in pom like you have here:
<parent>
<groupId>it.reag</groupId>
<artifactId>reag-common-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
Then a simple dependency of spring-boot-starter-web in this module pom may not be the same as you expected, it may be customized in parent, aka reag-common-api pom, servlet container may be removed there. This happens because of dependency hierachy rule in maven. In this way, in order to verify that a missing container is the reason why spring application starts and quits, one can use mvn dependency:tree to see if a tomcat or undertow or netty is shown as a container (not an exact expression).
In my project, this would be neede for submodule pom:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
As its parent has this:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>

How to verify a Spring feature/Bug fix is available in the Spring boot version which i am using?

I am working on a spring batch program to process data from sql and write to an xml. I used staxEventItemWriter to do that. But due to this issue https://jira.spring.io/browse/BATCH-1377 i am not able to fix the namespace issue. When we look at comments on this Jira card it says its fixed in 2010. But its not available in the latest spring boot versions which i am using. i tried with the patch class described in the Jira card its working fine for me.
<?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>
<groupId>com.demo.sitemap</groupId>
<artifactId>SqlToXml</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SqlToXml</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-batch</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-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.0.jre8</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-oxm -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>3.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.0.4.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
How to verify a Spring feature/Bug fix is available in the Spring boot version which i am using?
You are using Spring Boot 2.0.4.RELEASE. This will bring Spring Batch version 4.0.1.RELEASE. You can find more details about dependencies using the Spring Boot Initializr REST API.
The issue BATCH-1377 is marked as resolved in version 2.1.0.RC1 and is also available in 4.0.1.RELEASE.
But its not available in the latest spring boot versions which i am using. i tried with the patch class described in the Jira card its working fine for me.
The patch suggested by the contributor uses an additional property rootTagNamePrefix but this was modified as per this comment to use the naming convention {uri}prefix:root in order to be consistent with Spring WS. The issue was fixed here: https://github.com/spring-projects/spring-batch/commit/f56ee747296961917caa38fa9e14785dafc0b18b
So in your case, you need to use this naming convention if you want to add a namespace to the root tag. See example here: https://github.com/spring-projects/spring-batch/blob/f56ee747296961917caa38fa9e14785dafc0b18b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/StaxEventItemWriterTests.java#L287

Spring Boot: does #Entity Annotation exist?

I watched this Spring Boot tutorial: https://javabrains.io/courses/spring_bootquickstart/lessons/Creating-a-Spring-Data-JPA-Repository
and it puts an #Entity annotation before a class name. When I tried to do it in my code, I got an Error saying "can't resolve #Entity".
Here is my pom.xml file:
<?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>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
<relativePath/><!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.1.0</version>
<scope>compile</scope>
</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.apache.derby</groupId>
<artifactId>derby</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Do you know what is the problem?
I also faced this problem recently. For me, the spring-boot-starter-data-jpa dependency was the issue. Although it was in the pom.xml file without any errors, but the jars were not there in classpath - even after syncing maven and importing dependencies multiple times in different ways ( mvn clean/update/install).
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
The IDE I was using was IntelliJ Idea.
What worked for me at last : I just put this dependency over all other dependencies inside the <dependencies> ... </dependencies> tag, i.e just changed the order of dependencies and synced. That worked in my case, not sure why.
Below is my pom.xml file contents for reference.
<?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>
<groupId>dev.sanskar.courses</groupId>
<artifactId>course-api</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
</parent>
<dependencies>
<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>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.persistence/javax.persistence-api -->
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-validator -->
<!-- https://mvnrepository.com/artifact/org.hibernate.javax.persistence/hibernate-jpa-2.1-api -->
<!-- https://mvnrepository.com/artifact/org.hibernate.javax.persistence/hibernate-jpa-2.1-api -->
<!-- https://mvnrepository.com/artifact/javax.persistence/persistence-api -->
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Use spring-boot-starter-data-jpa
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
It works for me ... :)
Do not use the following one
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
</dependency>
I added this dependency
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
</dependency>
Add this and enjoy.
Spring STS usually shows this error when the set up isn't correct.
Go to the line containing the error
Click on the alert bulb so that it can suggest possible fixes
From the options, choose the "Fix project setup"
Follow the rest so that the project then re-aligns the import order.
suppose you have missed a dependency.
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
There are useful sample spring boot projects in this github page.it will be helpful to have a look.
I had the same problem. After I configured the new dependency on pom.xml file, the #Entity annotation is not found because these dependencies is not found. To solve it, the IntelliJ IDE then suggested me to load the Maven changes. On the pom.xml screen, click on the icon to reload Maven.
Make sure you Maven projects are imported successfully.
In the lower right corner of your IntelliJ there will a prompt asking you if you want to import the changes. It will also ask you if you want to enable Auto-Import.
In my case, by adding the spring-boot-starter-data-jpa dependency to the classpath it worked.
Do a force update mvn clean install -U or you can right click on your project -->maven--> update if you are using eclipse/STS. this synchronizes the IDE with pom dependencies.
Seems you are working with EclipseLink JPA implementation,
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.1.0</version>
<scope>compile</scope>
</dependency>
Spring Data JPA works with Hibernate implementation by default. We need to exclude unnecessary Hibernate dependencies from spring-boot-starter-data-jpawhen working with other JPA implementations.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</exclusion>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</exclusion>
</exclusions>
</dependency>
If you are working with Hibernate, just spring-boot-starter-data-jpa is enough in your case.
I also seen "can't resolve #Entity" issue because of my IDE. In eclipse, click Project option -> Clean the project. This is solved my issue when project dependencies out of sync with IDE.
Click on the red bulb next to the #Entity annotation.
Choose "Add dependency" - choose "javax.persistence.api" (NOT jakarta)
Most of the answers here are hit and try types which doesn't explain why #Entity annotation was not working and why it started working after adding certain dependencies.
Here's how it works-
For using persistence annotations you need to add relevant dependencies with their version, let's say we add spring-boot-starter-data-jpa as follows-
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.6.6</version>
</dependency>
Now when you are using Intellij Idea as your IDE, you need to reload your maven project to re read the dependencies from your pom.xml.
Once you do that, #Entity annotation would be available for use.
go to File -> Project Structure -> Project Settings -> Facets in Intellij Idea
click "+" and add "JPA" module
i faced same issue, after add this dependencies fixed my issue
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
</dependency>
What Worked For Me In Last:-
Go To File -> Project Structure -> Modules -> Click On Your Project Name
Then Go To Dependencies click "+" and Then -> Library -> From Maven
Then Search For javax.persistence.api Then Click Ok And Apply Changes
I had the same issues recently and i resolved it using adding this dependency that given below. I think the version change in spring boot made this error, now javax.persistence is not available instead we can use jakarta.persistence
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>6.1.6.Final</version>
<type>pom</type>
</dependency>
put this in your file at the top as an import statement
import javax.persistence.*;

How to set Hibernate bulk_id_strategy in spring boot application?

Hibernate is generating temporary tables for TABLE_PER_CLASS inheritance but the prod. oracle user does not have those create table priviledges and therefore that approach is not an option for our project.
Hibernate Version 5.2.8 is said to resolve that issue.
We updated our pom.xml accordingly to override default starter hibernate version setting.
Still we dont have any luck with the following property.
<property name="hibernate.hql.bulk_id_strategy"
value="org.hibernate.hql.spi.id.inline.InlineIdsInClauseBulkIdStrategy"
/>
APPLICATION PROPERTIES is also updated as follows
**
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
spring.datasource.url=jdbc:oracle:thin:#192.168.1. :1521:
spring.datasource.username=
spring.datasource.password=
spring.jpa.hibernate.ddl-auto=none
spring.jpa.database-platform=org.hibernate.dialect.Oracle10gDialect
spring.jpa.show-sql=true
spring.jpa.hibernate.hql.bulk_id_strategy=org.hibernate.hql.spi.id.inline.InlineIdsInClauseBulkIdStrategy
**
Where is the proper location of this setting in a spring boot app?
The container is still generating temp tables in the test env. server startup.
kind regards
pom.xml is as follows
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>x.xx.ortakonline</groupId>
<artifactId>PolsanOrtakOnlineServer</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.0.RELEASE</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<jjwt.version>0.7.0</jjwt.version>
<hibernate.version>5.2.8.Final</hibernate.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.4.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-starter-security</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>org.springframework.mobile</groupId>
<artifactId>spring-mobile-device</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
</dependency>
</dependencies>
In addition all properties in spring.jpa.properties.* are passed through as normal JPA properties (with the prefix stripped) when the local EntityManagerFactory is created.
This comes from the JPA section in the Spring Boot reference guide and, in a nutshell, explains how to pass additional provider specific properties.
Adding the following to your application.properties should do the trick
spring.jpa.properties.hibernate.hql.bulk_id_strategy=org.hibernate.hql.spi.id.inline.InlineIdsInClauseBulkIdStrategy
As suggested by M.Deinum above, you should add the following to your application.properties file:
spring.jpa.properties.hibernate.hql.bulk_id_strategy=org.hibernate.hql.spi.id.inline.InlineIdsInClauseBulkIdStrategy
and also add the following to the properties section of your pom.xml to override the bundled hibernate-core library. This is to ensure that the InlineIdsInClauseBulkIdStrategy class is found, as the class is only available in Hibernate Core 5.3.1.Final and above:
<properties>
...
<hibernate.version>5.3.1.Final</hibernate.version>
</properties>

Spring Boot 1.4 QueryDSL dependencies issue

I have just updated from Spring Boot 1.3.6 to 1.4.0 and I'm getting the next problem:
The type com.querydsl.jpa.JPQLQuery cannot be resolved. It is indirectly referenced from required .class files
My pom.xml configuration is:
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
...
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>3.7.4</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-sql</artifactId>
<version>4.1.3</version>
</dependency>
Any clue?.
Thanks.
Finally, I fixed my problem updating the querydsl-jpa 3.7.4 library to QueryDSL 4 (and modifying my code). It seems like Spring Boot 1.4 is not compatible with QueryDSL 3 anymore (as Spring Data JPA 1.10 upgraded to Querydsl 4).
Thanks.
For libraries that Spring Boot provides integrations you should use a BOM dependency. Basically having this in your pom/parent pom:
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.4.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
And when you specify real dependencies, drop the version:
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-sql</artifactId>
</dependency>
This guarantees compatibility since the BOM dependency is taking care of giving you the proper version.
More info here
Ulises's answer is correct and you could use
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
to mange the dependence as well. just check the dependence version managed by spring boot for right Group ID and Artifact ID

Resources