Maven2 出现 Reason: Not a v4.0.0 POM. 原因之一

在使用Maven构建项目时,遇到Compiler插件版本不匹配导致构建失败的问题。通过检查并指定插件版本为2.3.2,成功解决了Reason:Notav4.0.0POM错误。

今天遇到这个问题,检查一下发现在compiler这个插件没有指定版本

 

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version><!-- 请指定该版本-->
<configuration>
	<source>1.7</source>
	<target>1.7</target>
</configuration>
 

默认情况下,选择了2.0.2,这个版本就会导致 Reason: Not a v4.0.0 POM.

 

 

 

(base) PS E:\优快云\1fa67\csdn-markdown> mvn install [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for org.example:climb优快云blogsUtils:jar:1.0-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 12, column 21 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ------------------< org.example:climb优快云blogsUtils >------------------- [INFO] Building climb优快云blogsUtils 1.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/3.2.5/maven-surefire-plugin-3.2.5.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/3.2.5/maven-surefire-plugin-3.2.5.pom (5.3 kB at 6.1 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/3.2.5/surefire-3.2.5.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/3.2.5/surefire-3.2.5.pom (22 kB at 49 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/3.2.5/maven-surefire-plugin-3.2.5.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/3.2.5/maven-surefire-plugin-3.2.5.jar (45 kB at 159 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/3.4.1/maven-jar-plugin-3.4.1.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/3.4.1/maven-jar-plugin-3.4.1.pom (7.8 kB at 63 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/3.4.1/maven-jar-plugin-3.4.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/3.4.1/maven-jar-plugin-3.4.1.jar (34 kB at 99 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/jsoup/jsoup/1.12.1/jsoup-1.12.1.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/jsoup/jsoup/1.12.1/jsoup-1.12.1.pom (8.3 kB at 64 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/jsoup/jsoup/1.12.1/jsoup-1.12.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/jsoup/jsoup/1.12.1/jsoup-1.12.1.jar (397 kB at 1.3 MB/s) [INFO] [INFO] --- resources:3.3.1:resources (default-resources) @ climb优快云blogsUtils --- [WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory E:\优快云\1fa67\csdn-markdown\src\main\resources [INFO] [INFO] --- compiler:3.13.0:compile (default-compile) @ climb优快云blogsUtils --- Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.4.2/maven-shared-utils-3.4.2.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.4.2/maven-shared-utils-3.4.2.jar (151 kB at 1.0 MB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.15.0/plexus-compiler-api-2.15.0.jar Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.15.0/plexus-compiler-manager-2.15.0.jar Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.15.0/plexus-compiler-javac-2.15.0.jar Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/4.0.0/plexus-utils-4.0.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.15.0/plexus-compiler-manager-2.15.0.jar (5.2 kB at 15 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.15.0/plexus-compiler-api-2.15.0.jar (29 kB at 68 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.15.0/plexus-compiler-javac-2.15.0.jar (26 kB at 54 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/4.0.0/plexus-utils-4.0.0.jar (192 kB at 402 kB/s) [INFO] Recompiling the module because of changed dependency. [WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent! [INFO] Compiling 3 source files with javac [debug target 6] to target\classes [INFO] ------------------------------------------------------------- [WARNING] COMPILATION WARNING : [INFO] ------------------------------------------------------------- [WARNING] 未与 -source 6 一起设置引导类路径 [INFO] 1 warning [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] 不再支持源选项 6。请使用 7 或更高版本。 [ERROR] 不再支持目标选项 6。请使用 7 或更高版本。 [INFO] 2 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 6.434 s [INFO] Finished at: 2025-10-06T13:56:37+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project climb优快云blogsUtils: Compilation failure: Compilation failure: [ERROR] 不再支持源选项 6。请使用 7 或更高版本。 [ERROR] 不再支持目标选项 6。请使用 7 或更高版本。 [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 (base) PS E:\优快云\1fa67\csdn-markdown> java -jar target/your-jar-file.jar https://blog.csdn.net/m0_63552826/article/details/151899852?spm=1001.2014.3001.5501 Error: Unable to access jarfile target/your-jar-file.jar (base) PS E:\优快云\1fa67\csdn-markdown> dir target 目录: E:\优快云\1fa67\csdn-markdown\target Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2025/10/6 13:50 classes d----- 2025/10/6 13:56 generated-sources d----- 2025/10/6 13:56 maven-status这有什么问题
最新发布
10-07
D:\biancheng\yf服务器代码\jdwlw>mvn clean package [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for jdwlw:jdwlw:war:0.0.1-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 347, column 12 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ----------------------------< jdwlw:jdwlw >----------------------------- [INFO] Building maven Maven Webapp 0.0.1-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ war ]--------------------------------- Downloading from central: https://repo.maven.apache.org/maven2/com/github/simpligility/ksoap2/ksoap2-android/3.6.4/ksoap2-android-3.6.4.pom [WARNING] The POM for com.github.simpligility.ksoap2:ksoap2-android:jar:3.6.4 is missing, no dependency information available Downloading from central: https://repo.maven.apache.org/maven2/com/github/simpligility/ksoap2/ksoap2-android/3.6.4/ksoap2-android-3.6.4.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.214 s [INFO] Finished at: 2025-06-30T13:00:33+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project jdwlw: Could not resolve dependencies for project jdwlw:jdwlw:war:0.0.1-SNAPSHOT: Could not find artifact com.github.simpligility.ksoap2:ksoap2-android:jar:3.6.4 in central (https://repo.maven.apache.org/maven2) -> [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/DependencyResolutionException
07-01
A:\program\jdk8\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" "-javaagent:A:\ideaIU-2022.3.3\IntelliJ IDEA 2022.3.3\lib\idea_rt.jar=53631:A:\ideaIU-2022.3.3\IntelliJ IDEA 2022.3.3\bin" -Dfile.encoding=UTF-8 -classpath A:\program\jdk8\jre\lib\charsets.jar;A:\program\jdk8\jre\lib\deploy.jar;A:\program\jdk8\jre\lib\ext\access-bridge-64.jar;A:\program\jdk8\jre\lib\ext\cldrdata.jar;A:\program\jdk8\jre\lib\ext\dnsns.jar;A:\program\jdk8\jre\lib\ext\jaccess.jar;A:\program\jdk8\jre\lib\ext\jfxrt.jar;A:\program\jdk8\jre\lib\ext\localedata.jar;A:\program\jdk8\jre\lib\ext\nashorn.jar;A:\program\jdk8\jre\lib\ext\sunec.jar;A:\program\jdk8\jre\lib\ext\sunjce_provider.jar;A:\program\jdk8\jre\lib\ext\sunmscapi.jar;A:\program\jdk8\jre\lib\ext\sunpkcs11.jar;A:\program\jdk8\jre\lib\ext\zipfs.jar;A:\program\jdk8\jre\lib\javaws.jar;A:\program\jdk8\jre\lib\jce.jar;A:\program\jdk8\jre\lib\jfr.jar;A:\program\jdk8\jre\lib\jfxswt.jar;A:\program\jdk8\jre\lib\jsse.jar;A:\program\jdk8\jre\lib\management-agent.jar;A:\program\jdk8\jre\lib\plugin.jar;A:\program\jdk8\jre\lib\resources.jar;A:\program\jdk8\jre\lib\rt.jar;A:\JAVAEE\user-mer\target\classes;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter-thymeleaf\2.6.13\spring-boot-starter-thymeleaf-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter\2.6.13\spring-boot-starter-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter-logging\2.6.13\spring-boot-starter-logging-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\ch\qos\logback\logback-classic\1.2.11\logback-classic-1.2.11.jar;A:\apache-maven-3.9.9-bin\local\ch\qos\logback\logback-core\1.2.11\logback-core-1.2.11.jar;A:\apache-maven-3.9.9-bin\local\org\apache\logging\log4j\log4j-to-slf4j\2.17.2\log4j-to-slf4j-2.17.2.jar;A:\apache-maven-3.9.9-bin\local\org\apache\logging\log4j\log4j-api\2.17.2\log4j-api-2.17.2.jar;A:\apache-maven-3.9.9-bin\local\org\slf4j\jul-to-slf4j\1.7.36\jul-to-slf4j-1.7.36.jar;A:\apache-maven-3.9.9-bin\local\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;A:\apache-maven-3.9.9-bin\local\org\yaml\snakeyaml\1.29\snakeyaml-1.29.jar;A:\apache-maven-3.9.9-bin\local\org\thymeleaf\thymeleaf-spring5\3.0.15.RELEASE\thymeleaf-spring5-3.0.15.RELEASE.jar;A:\apache-maven-3.9.9-bin\local\org\thymeleaf\thymeleaf\3.0.15.RELEASE\thymeleaf-3.0.15.RELEASE.jar;A:\apache-maven-3.9.9-bin\local\org\attoparser\attoparser\2.0.5.RELEASE\attoparser-2.0.5.RELEASE.jar;A:\apache-maven-3.9.9-bin\local\org\unbescape\unbescape\1.1.6.RELEASE\unbescape-1.1.6.RELEASE.jar;A:\apache-maven-3.9.9-bin\local\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;A:\apache-maven-3.9.9-bin\local\org\thymeleaf\extras\thymeleaf-extras-java8time\3.0.4.RELEASE\thymeleaf-extras-java8time-3.0.4.RELEASE.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter-web\2.6.13\spring-boot-starter-web-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter-json\2.6.13\spring-boot-starter-json-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\com\fasterxml\jackson\core\jackson-databind\2.13.4.2\jackson-databind-2.13.4.2.jar;A:\apache-maven-3.9.9-bin\local\com\fasterxml\jackson\core\jackson-annotations\2.13.4\jackson-annotations-2.13.4.jar;A:\apache-maven-3.9.9-bin\local\com\fasterxml\jackson\core\jackson-core\2.13.4\jackson-core-2.13.4.jar;A:\apache-maven-3.9.9-bin\local\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.13.4\jackson-datatype-jdk8-2.13.4.jar;A:\apache-maven-3.9.9-bin\local\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.13.4\jackson-datatype-jsr310-2.13.4.jar;A:\apache-maven-3.9.9-bin\local\com\fasterxml\jackson\module\jackson-module-parameter-names\2.13.4\jackson-module-parameter-names-2.13.4.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter-tomcat\2.6.13\spring-boot-starter-tomcat-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\org\apache\tomcat\embed\tomcat-embed-core\9.0.68\tomcat-embed-core-9.0.68.jar;A:\apache-maven-3.9.9-bin\local\org\apache\tomcat\embed\tomcat-embed-el\9.0.68\tomcat-embed-el-9.0.68.jar;A:\apache-maven-3.9.9-bin\local\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.68\tomcat-embed-websocket-9.0.68.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-web\5.3.23\spring-web-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-beans\5.3.23\spring-beans-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-webmvc\5.3.23\spring-webmvc-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-aop\5.3.23\spring-aop-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-context\5.3.23\spring-context-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-expression\5.3.23\spring-expression-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.2.2\mybatis-spring-boot-starter-2.2.2.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter-jdbc\2.6.13\spring-boot-starter-jdbc-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\com\zaxxer\HikariCP\4.0.3\HikariCP-4.0.3.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-jdbc\5.3.23\spring-jdbc-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-tx\5.3.23\spring-tx-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.2.2\mybatis-spring-boot-autoconfigure-2.2.2.jar;A:\apache-maven-3.9.9-bin\local\org\mybatis\mybatis\3.5.9\mybatis-3.5.9.jar;A:\apache-maven-3.9.9-bin\local\org\mybatis\mybatis-spring\2.0.7\mybatis-spring-2.0.7.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-devtools\2.6.13\spring-boot-devtools-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot\2.6.13\spring-boot-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-autoconfigure\2.6.13\spring-boot-autoconfigure-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\com\mysql\mysql-connector-j\8.0.33\mysql-connector-j-8.0.33.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-core\5.3.23\spring-core-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-jcl\5.3.23\spring-jcl-5.3.23.jar com.ljy.UserManagementSystemApplication 11:23:24.929 [Thread-1] DEBUG org.springframework.boot.devtools.restart.classloader.RestartClassLoader - Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@4cd1c1d7 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.6.13) 2025-05-27 11:23:25.135 INFO 14136 --- [ restartedMain] com.ljy.UserManagementSystemApplication : Starting UserManagementSystemApplication using Java 1.8.0_411 on LAPTOP-LAKGK45S with PID 14136 (A:\JAVAEE\user-mer\target\classes started by 华硕 in A:\JAVAEE\user-mer) 2025-05-27 11:23:25.137 INFO 14136 --- [ restartedMain] com.ljy.UserManagementSystemApplication : No active profile set, falling back to 1 default profile: "default" 2025-05-27 11:23:25.166 INFO 14136 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2025-05-27 11:23:25.166 INFO 14136 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2025-05-27 11:23:25.809 INFO 14136 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2025-05-27 11:23:25.814 INFO 14136 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2025-05-27 11:23:25.814 INFO 14136 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.68] 2025-05-27 11:23:25.865 INFO 14136 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2025-05-27 11:23:25.865 INFO 14136 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 699 ms 2025-05-27 11:23:25.908 WARN 14136 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [A:\JAVAEE\user-mer\target\classes\com\ljy\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class 2025-05-27 11:23:25.909 INFO 14136 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2025-05-27 11:23:25.918 INFO 14136 --- [ restartedMain] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2025-05-27 11:23:25.929 ERROR 14136 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active). 进程已结束,退出代码0 <?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> <groupId>com.ljy</groupId> <artifactId>user-mer</artifactId> <version>0.0.1-SNAPSHOT</version> <name>user-mer</name> <description>user-mer</description> <properties> <java.version>1.8</java.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <spring-boot.version>2.6.13</spring-boot.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.2.2</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.33</version> <!-- 最新版本可查 Maven 仓库 --> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <build> <!-- 添加资源过滤配置 --> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> <include>**/*.html</include> <!-- 确保HTML文件被打包 --> </includes> <filtering>true</filtering> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>${spring-boot.version}</version> <configuration> <mainClass>com.ljy.UserManagementSystemApplication</mainClass> <skip>false</skip> </configuration> <executions> <execution> <id>repackage</id> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project> # application.yml server: port: 8080 # application.yml 数据库配置 spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/user_db?useSSL=false&serverTimezone=Asia/Shanghai username: root password: 123456 thymeleaf: prefix: classpath:/templates/ suffix: .html cache: false mybatis: mapper-locations: classpath:mapper/*.xml type-aliases-package: com.ljy.pojoCREATE DATABASE user_db CHARACTER SET utf8mb4; USE user_db; CREATE TABLE user ( id INT PRIMARY KEY AUTO_INCREMENT, username VARCHAR(50) NOT NULL, password VARCHAR(50) NOT NULL, email VARCHAR(100), avatar_url VARCHAR(200) ); -- 插入测试管理员(admin/123456) INSERT INTO user (username, password, email) VALUES ('admin', '123456', 'admin@example.com');直接告诉我问题在哪里 我该怎么解决
05-28
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值