1

I have create a spring project from spring initializer and have imported it to IntelliJ, have included the Web dependency while creation but i am not getting the auto suggestions for annotations though pom.xml has the dependency for it.

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

I tried by restarting and loading the maven but still it doesnot work. Need certain assistance over here.

2 Answers2

0

Can you show us your whole POM.XML file please? Are you sure that you have implemented the Spring Web dependency? Below I am showing you the XML code for Spring Web dependency. The aforementioned above is the test that it is being automatically provided in the Spring Project.

Furthermore please consider to reload your maven project for the dependencies to be applied.

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
Vel_More
  • 293
  • 1
  • 10
0
<dependencies>
    <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>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-core</artifactId>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>
  • You can see definitely that the dependency I wrote you in my answer doesn't exist in your POM file. Please copy paste it and reload your project. – Vel_More Jul 16 '22 at 19:49
  • @Vel_More , the dependency which you mentioned to add is the very first dependency, but thanks anyways i have debugged the problem and the fix was all the external libraries was not loaded . – Fullstack Developer Jul 17 '22 at 13:05