I'm actually creating a micro service for a monolithe and I have to use is own DAO and persistence. The problem is that the version used for persistence is hibernate 4. So, I have to use an old version of spring boot.
Here 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 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>1.2.8.RELEASE</version>
<relativePath/>
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version>
<start-class>com.example.DemoApplication</start-class>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.8.RELEASE</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-test</artifactId>
<version>2.4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.11.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<addResources>true</addResources>
<jvmArguments>
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
</jvmArguments>
</configuration>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.8.RELEASE</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
The problem is: spring-boot-starter-parent is not recognize. I've compiled all the posts and I absolutely don't know what I can do to solve this...
By searching on mvnrepository.com you can find the dependencies to add. For exemple searching for spring boot starter, you have all the versions. Here is the link for the 1.2.8 spring boot starter
https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter/1.2.8.RELEASE
If you want to know all versions of the dependencies used for 1.2.8 here is the link with the list: https://docs.spring.io/spring-boot/docs/1.2.8.RELEASE/reference/html/appendix-dependency-versions.html
So you can try to specify the version for all dependencies.
Also creating a springboot project with 2.4.0 (for example) excluding hibernate and add manually the dependency for an older version.
This link might help you to switch to a 1.5 springboot app to a version 2. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide It may be usable for switching from 1.2.8 to 2.x .
After that, is the code that you have to reuse compatible with java 8...?