I'm following JavaBrains youtube channel to learn spring boot and I'm getting this error while getting started with databases using JPA and apache derby.
It was a common issue in IntelliJ community edition whenever I try to open mvn project generated by spring initializr I had to manually change <version>3.0.4</version>
into <version>3.0.2</version>
in pom.xml
to make it work (PS : don't know why!)
I'm using IntelliJ idea community version.
Started spring-boot project using spring initalizr
Error:
Could not resolve dependencies for project com.example:rest-demo-db:jar:0.0.1- SNAPSHOT:
The following artifacts could not be resolved:
org.aspectj:aspectjweaver:jar:1.9.19, org.hibernate.orm:hibernate-
core:jar:6.1.6.Final, org.springframework.data:spring-data-jpa:jar:3.0.1,
org.apache.derby:derby:jar:10.16.1.1: Could not transfer artifact
org.aspectj:aspectjweaver:jar:1.9.19 from/to central
(https://repo.maven.apache.org/maven2): GET request of:
org/aspectj/aspectjweaver/1.9.19/aspectjweaver-1.9.19.jar from central failed:
Tag mismatch -> [Help 1]
**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>3.0.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>rest-demo-db</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>rest-demo-db</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>17</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-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>
Other info :
java version : 17
mvn version : 3.8.2
tried and didn't work:
Invalidate cache and restart
in IntelliJ- Clearing
.m2/repository
and re-installing mvn dependencies mvn clean install -U
- System restart
Can anyone help me with this. Thank you