Spring Exception: Spring boot package org.springframework.boot is not visible

DemoApplication.java: package org.springframework.boot is not visible.


  (package org.springframework.boot is declared in the unnamed module, but module demo does not read it 


Fix: Please delete the module-info.java file which is created by the IDE automatically and try again.


Sample Log:


[INFO] Scanning for projects...

[INFO] 

[INFO] --------------------------< com.example:demo >--------------------------

[INFO] Building demo 0.0.1-SNAPSHOT

[INFO]   from pom.xml

[INFO] --------------------------------[ jar ]---------------------------------

[INFO] 

[INFO] --- resources:3.3.1:resources (default-resources) @ demo ---

[INFO] Copying 1 resource from src\main\resources to target\classes

[INFO] Copying 0 resource from src\main\resources to target\classes

[INFO] 

[INFO] --- compiler:3.11.0:compile (default-compile) @ demo ---

[INFO] Changes detected - recompiling the module! :input tree

[INFO] Compiling 2 source files with javac [debug release 17 module-path] to target\classes

[INFO] -------------------------------------------------------------

[ERROR] COMPILATION ERROR : 

[INFO] -------------------------------------------------------------

[ERROR] /C:/Users/admin/Downloads/demo/src/main/java/com/example/demo/DemoApplication.java:[3,27] package org.springframework.boot is not visible

  (package org.springframework.boot is declared in the unnamed module, but module demo does not read it)

[ERROR] /C:/Users/admin/Downloads/demo/src/main/java/com/example/demo/DemoApplication.java:[4,32] package org.springframework.boot.autoconfigure is not visible

  (package org.springframework.boot.autoconfigure is declared in the unnamed module, but module demo does not read it)

[INFO] 2 errors 

[INFO] -------------------------------------------------------------

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  2.215 s

[INFO] Finished at: 2023-11-30T11:22:46+05:30

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project demo: Compilation failure: Compilation failure: 

[ERROR] /C:/Users/admin/Downloads/demo/src/main/java/com/example/demo/DemoApplication.java:[3,27] package org.springframework.boot is not visible

[ERROR]   (package org.springframework.boot is declared in the unnamed module, but module demo does not read it)

[ERROR] /C:/Users/admin/Downloads/demo/src/main/java/com/example/demo/DemoApplication.java:[4,32] package org.springframework.boot.autoconfigure is not visible

[ERROR]   (package org.springframework.boot.autoconfigure is declared in the unnamed module, but module demo does not read it)

[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


Tags: , ,

0 Responses to “Spring Exception: Spring boot package org.springframework.boot is not visible”

Post a Comment

Thanks for your comments

Subscribe

© 2014 Java Frameworks. All rights reserved.
Designed by Blogger