0

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 Spring initalizr data

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

mvn settings mvn settings in IntelliJ


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

Aditya VSM
  • 83
  • 1
  • 11
  • Does it work from the command line outside of the IDE? Are you behind a corporate proxy? – Egor Klepikov Mar 10 '23 at 09:30
  • It doesn't work in cmd too (same error), and YES I'm under corporate proxy – Aditya VSM Mar 10 '23 at 10:27
  • In this case, it looks like some project / PC misconfiguration rather than the IDE bug. Try to make it work from the command line first. You can enable debug logging for Maven by adding the `-X` attribute to get more output about the problem. – Egor Klepikov Mar 10 '23 at 10:39
  • 1
    See also https://stackoverflow.com/questions/1251192/how-do-i-use-maven-through-a-proxy – Egor Klepikov Mar 10 '23 at 10:39

0 Answers0