0

I've just barely started a java 8 project with spring boot and maven. I can't add the springframework dependancy...

enter image description here

When I go over it with the mouse and click on "Add dependancy" nothing changes, even after loading the maven changes.

Here's 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.7.3</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>microservices.book</groupId>
    <artifactId>social-multiplication</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>social-multiplication</name>
    <description>Social Multiplication App</description>
    <properties>
        <java.version>1.8</java.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-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>5.3.20</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-test</artifactId>
            <version>2.6.1</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <version>2.7.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

EDIT:

mvn clean package 
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< microservices.book:social-multiplication >--------------
[INFO] Building social-multiplication 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.2.0:clean (default-clean) @ social-multiplication ---
[INFO] Deleting C:\Users\username\Desktop\Programming\social-multiplication\target
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ social-multiplication ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ social-multiplication ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to C:\Users\username\Desktop\Programming\social-multiplication\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ social-multiplication ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory C:\Users\username\Desktop\Programming\social-multiplication\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ social-multiplication ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\Users\username\Desktop\Programming\social-multiplication\target\test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/username/Desktop/Programming/social-multiplication/src/test/java/microservices/book/multiplication/SocialMultiplicatio
nApplicationTests.java:[3,17] package org.junit does not exist
[ERROR] /C:/Users/username/Desktop/Programming/social-multiplication/src/test/java/microservices/book/multiplication/SocialMultiplicatio
nApplicationTests.java:[4,24] package org.junit.runner does not exist
[ERROR] /C:/Users/username/Desktop/Programming/social-multiplication/src/test/java/microservices/book/multiplication/SocialMultiplicatio
nApplicationTests.java:[10,10] cannot find symbol
  symbol:   class Test
  location: class test.java.microservices.book.multiplication.SocialMultiplicationApplicationTests
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.838 s
[INFO] Finished at: 2022-09-12T21:36:28+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:testCompile (default-testCompile) on project socia
l-multiplication: Compilation failure: Compilation failure: 
[ERROR] /C:/Users/username/Desktop/Programming/social-multiplication/src/test/java/microservices/book/multiplication/SocialMultiplicatio
nApplicationTests.java:[3,17] package org.junit does not exist
[ERROR] /C:/Users/username/Desktop/Programming/social-multiplication/src/test/java/microservices/book/multiplication/SocialMultiplicatio
nApplicationTests.java:[4,24] package org.junit.runner does not exist
[ERROR] /C:/Users/username/Desktop/Programming/social-multiplication/src/test/java/microservices/book/multiplication/SocialMultiplicatio
nApplicationTests.java:[10,10] cannot find symbol
[ERROR]   symbol:   class Test
[ERROR]   location: class test.java.microservices.book.multiplication.SocialMultiplicationApplicationTests
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

.idea.log file contents:

2022-09-12 21:36:41,468 [ 502853] WARN - com.intellij.util.xmlb.Binding - no accessors for org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptInputsWatcher$Storage

IDK
  • 359
  • 1
  • 16

0 Answers0