Spring Boot doesn't use datasource properties - spring

I've set up spring.datasource.* in application.properties:
spring.datasource.url=jdbc:h2:./data/test
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver
Then I configured JdbcTemplate Bean
#Bean
#Autowired
public JdbcTemplate jdbcTemplate(DataSource dataSource) {
return new JdbcTemplate(dataSource);
}
But when I start application, I see in console
Starting embedded database: url='jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false', username='sa'
Instead of my settings. Why?

It's always a magic.
When the problem occured I have had these dependencies:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
But when I changed it into
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
The problem gone...

I had the same issue and I hope it helps you.
The problem seems to be:
When you login into H2 console, it writes metadata in your user folder (.h2.server.properties). This file just configures what will appear in the console UI.
Pay close attention to the URL you put in the JDBC URL field of the console UI. It must match with the URL you define in the spring.datasource.url of the application.properties file.
The trick is: when running just an example application, it DO NOT create a data file until you connect/commit something into the database. So, you think the autoconfigure feature is not doing the job.
But when you first modify the database state, H2 creates the data file something.mv.db in the right folder.
Assuming you just created a new application with the following dependencies (i.e. JDBC,H2 and web), try the following to see my point:
1) set up your pom.xml (it is the default for these three dependencies I mentioned):
<?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>2.0.0.BUILD-SNAPSHOT</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-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</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>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
2) in the application.properties file:
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.datasource.url=jdbc:h2:file:./data/test
3) Open a file explorer window to show the contents of the root folder of your project (the same folder of your pom.xml).
4) Then, go to <server>:8080/h2-console.
In the JDBC URL field of the console UI, type: jdbc:h2:file:./data/test
and connect.
5) You will see the 'data' folder being created and inside it, the data file test.mv.db in this case.

Solution to your question
SpringBoot will always look for embedded datasource only, Check whether you have any other driver's like derby driver in your WEB-INF/lib path.
You exclude the datasource configuration and use importResource annotation to inject your dataSource configuration.
Sample Snippet below.
#EnableAutoConfiguration(exclude=DataSourceAutoConfiguration.class)
#ImportResource({ "classpath:datasource-config.xml"})
public class Sample {
In datasource-config.xml you can use your datasource properties file as well.
Enjoy :-)

If you want to inject JdbcTemplate in your controller class,
private final JdbcTemplate jdbcTemplate;
#Autowired
public MyController(JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
In this way you can autowire jdbcTemplate in any spring bean.
Add spring boot jdbc dependency in your pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
See this spring boot documentation for more information.

Related

Not able to read consul key value properties into spring boot application

I am very new to the consul. Started with POC, able to establish communication between two services using the consul, but unable to read key/value pairs from consul into spring boot application.
Have gone through all the solutions available on the internet to understand what I am doing wrong, but nothing helped me.
Please take a look at the code below and suggest to me if I am doing any mistakes
Main class:
#SpringBootApplication
#EnableAutoConfiguration
#RestController
#EnableConfigurationProperties(value = {PropertySourceBootstrapProperties.class})
#EnableDiscoveryClient
public class KeyvalueApplication {
#Value("${greeting}")
private String greeting;
#GetMapping("/keys")
public String getName() {
return "Config data "+ greeting;
}
public static void main(String[] args) {
SpringApplication.run(KeyvalueApplication.class, args);
}
}
application.yml
server:
port: 8676
spring:
application:
name: keyvalue
cloud:
consul:
enabled: true
host: localhost
port: 8500
config:
fail-fast: true
enabled: true
prefix: config
default-context: keyvalue
profile-separator: '::'
watch:
enabled: true
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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example.keys</groupId>
<artifactId>keyvalue</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>keyvalue</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>2020.0.0</spring-cloud.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-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-all</artifactId>
</dependency>
<!-- <dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency> -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
I am using consul version 1.9.2
I used the below command to start the consul agent:
consul agent -server -bootstrap-expect=1 -data-dir=consul-data -ui -bind= -client 0.0.0.0
I configured key-value pair in consul UI as config/keyvalue/greeting:
When I run my spring boot application I am getting the error:
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'greeting' in value "${greeting}"

Can't find url views when deploying spring boot on WebSphere

I'm starting a simple project in spring boot, right now I just want to show a startup view, but when deploying on a WebSphere 9 server, it appears when I start "Error 404: SRVE0190E: File not Found: /"
and if I put the url of another controller method for example /login
the same error comes out
"Error 404: java.io.FileNotFoundException: SRVE0190E: File not Found: /login"
This is my controller
#Controller
public class HomeController {
#RequestMapping(value="/", method = RequestMethod.GET)
public String home() {
return "example";
}
#RequestMapping(value="/login", method=RequestMethod.GET)
public String login() {
return "example.html";
}
}
Create the explame.html in several places of the project to know if spring recognized it in any of them, but I always got the same message, I leave an image of the initial project structure and 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.BUILD-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.com.ioks</groupId>
<artifactId>ExampleFirst</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>ExampleFirst</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<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>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>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
structure project
UPDATE
I was able to visualize my start view with / and / login, as I indicated in my controller, it was as #Jalil.Jarjanazy told me in his answer, I put the html file in templates, but not in templates of the empty package that is in src , because when I want to add something there, it shows me the message: "Files created outside of a web content folder will not be included in your deployed Web application.
", I added it in WEB-INF / classes / templates, another very strange thing is that in Eclipse it does not show me the classes folder, but it is in the project, I manually put the html file and ran the project, I think this is not is the proper way to do it, could you tell me what I'm doing wrong, why can't I see the folder classes in eclipse?
Your example.html file should be in the templates folder.
And you should only return the only name of the html file (example) in your controller, so no need for the .html.

ERROR: Non-resolvable parent POM: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom

I am getting the below exception in my pom.xml when trying to run my application. I saw some posts regarding the error and followed them but no use. I understand the artifact(parent) is referred locally and is not present, but I don't know how to resolve this, could somebody please help me?
The error is
Project build error: Non-resolvable parent POM for com.example:demo:0.0.1-SNAPSHOT: Failure
to transfer org.springframework.boot:spring-boot-starter-parent:pom:1.5.18.BUILD-SNAPSHOT
from https://repo.spring.io/snapshot was cached in the local repository, resolution will not be
reattempted until the update interval of spring-snapshots has elapsed or updates are forced.
Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-
parent:pom:1.5.18.BUILD-SNAPSHOT from/to spring-snapshots (https://repo.spring.io/
snapshot): repo.spring.io and 'parent.relativePath' points at no local POM
below is the 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.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.18.BUILD-SNAPSHOT</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-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jersey</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
Downgrade the spring boot starter to lower version.
Update the Maven project.
Hope it works.
There is an issue with the version of Spring Boot you are using, as it is a build. Just copy another release version of 1.X and replace it.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.17.RELEASE</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
If you can access the url https://repo.spring.io/snapshot/ from your browser, then it can be a Maven issue. Maven is unable to connect to the repository and that can be due to:
Any cache issues in the downloaded dependencies. Try deleting the local dependencies, and try out the solution provided here.
Try Maven Update and Maven Clean.
Try re-opening the IDE after doing the above.
Your pom.xml is fine, it looks like it's a problem with your internet connection. Check if you can reach https://repo.spring.io/snapshot/ with your browser. If yes, check if you need to configure a proxy server. If no, you should contact your internet provider.
Here is the documentation on how you configure a proxy server for Maven:

spring-social-github maven repository

I can't find Maven repository for spring-social-github. Could you please let me know where it is located ?
Spring Social is separated into different Projects which you can find if you follow the link above.
This is the core module with the following maven dependency:
<dependencies>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social</artifactId>
<version>1.1.0.RELEASE</version>
</dependency>
</dependencies>
There is also spring social facebook with the following maven dependency:
<dependencies>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-facebook</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
</dependencies>
Spring social twitter can be found here:
<dependencies>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-twitter</artifactId>
<version>1.1.0.RELEASE</version>
</dependency>
</dependencies>
And so on.
If you want Spring social github you can go to the link before. Or grab this repository so that you will be able to add it to your project.
<dependencies>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-github</artifactId>
<version>1.0.0.M4</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
Spring will usually not make a public Maven repository available outside of their own repo. This means you have to add the repository above to be able to add Spring projects that are in a testing stage.
Here is an example pom.xml file with Spring social working:
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>org.test</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-github</artifactId>
<version>1.0.0.M4</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
http://repo.spring.io/milestone
(admittedly taken from the other answer but it was well hidden there)
Bonus question: why isn't it on maven central???

Missing artifact when trying to add spring-data

I am trying to add the spring data dependency to my Spring boot starter project but I am getting the error: Missing artifact org.springframework.data:spring-data-jdbc-ext:jar:1.0.0.RELEASE
Here is my pom.xml file. What am I missing here?
<?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.test</groupId>
<artifactId>myApp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.0.0.RC1</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jdbc-ext</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
</dependencies>
<properties>
<start-class>com.test.Application</start-class>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestone</id>
<url>http://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestone</id>
<url>http://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
For some reason the documentation on the Spring Data JDBC Extensions website is wrong (or the distribution is wrong!).
According to that page you, indeed, need to include the dependency you mention.
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jdbc-ext</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
However if you take a look in the spring repository for that artifact it contains a zip file with the release instead of a jar or pom file.
The spring-data-jdbc-ext project consists of 2 artifacts, which both are available. Change your dependency to the following
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jdbc-core</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-oracle</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
If you don't need the specific Oracle extensions than you could leave that one out.
A small note there is a 1.1.0.M1 version also (a milestone/pre-release versio) which works with a newer version of Spring Data. You might want to try that instead of the 1.0.0.RELEASE version which was build against an older version of Spring Data.

Resources