Unrecognised tag 'encoding' position START TAG seen \r

本文详细解析了Maven安装过程中出现的错误信息,特别是关于POM文件中<encoding>标签的误用,并提供了正确的配置示例。
                       

执行Maven Install打包的时候,出现以下错误信息:

[INFO] Scanning for projects...[ERROR] The build could not read 1 project -> [Help 1][ERROR]   [ERROR]   The project pro.test:pro-test:0.0.1-SNAPSHOT (F:\Workspaces\pro-test\pom.xml) has 1 error[ERROR]     Malformed POM F:\Workspaces\pro-test\pom.xml: Unrecognised tag: 'encoding' (position: START_TAG seen ...</version>\r\n\t\t\t\t<encoding>... @12:15)  @ F:\Workspaces\pro-test\pom.xml, line 12, column 15 -> [Help 2][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/ProjectBuildingException[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

经过检查才发现原来是<encoding>utf-8</encoding>标签放错位置了,应该放在<configuration>标签里面:

            <plugin>                <groupId>org.apache.maven.plugins</groupId>                <artifactId>maven-compiler-plugin</artifactId>                <version>3.0</version>                <configuration>                    <encoding>utf-8</encoding>                    <source>1.8</source>                    <target>1.8</target>                </configuration>            </plugin>
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.youkuaiyun.com/jiangjunshow

C:\Users\koreyoshi\.jdks\azul-17.0.11\bin\java.exe -Dmaven.multiModuleProjectDirectory=D:\zy-dbms -Dmaven.home=D:\Maven\apache-maven-3.8.4-bin\apache-maven-3.8.4 -Dclassworlds.conf=D:\Maven\apache-maven-3.8.4-bin\apache-maven-3.8.4\bin\m2.conf "-Dmaven.ext.class.path=D:\IDEA\IntelliJ IDEA 2021.2.1\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\IDEA\IntelliJ IDEA 2021.2.1\lib\idea_rt.jar=2037:D:\IDEA\IntelliJ IDEA 2021.2.1\bin" -Dfile.encoding=UTF-8 -classpath D:\Maven\apache-maven-3.8.4-bin\apache-maven-3.8.4\boot\plexus-classworlds-2.6.0.jar;D:\Maven\apache-maven-3.8.4-bin\apache-maven-3.8.4\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2021.2.1 -s D:\Maven\apache-maven-3.8.4-bin\apache-maven-3.8.4\conf\settings.xml clean [ERROR] Error executing Maven. [ERROR] 6 problems were encountered while building the effective settings [WARNING] Unrecognised tag: 'mirror' (position: START_TAG seen ...</url>-->\r\n <mirror>... @173:16) @ D:\Maven\apache-maven-3.8.4-bin\apache-maven-3.8.4\conf\settings.xml, line 173, column 16 [ERROR] 'mirrors.mirror.url' for default is missing @ D:\Maven\apache-maven-3.8.4-bin\apache-maven-3.8.4\conf\settings.xml [ERROR] 'mirrors.mirror.mirrorOf' for default is missing @ D:\Maven\apache-maven-3.8.4-bin\apache-maven-3.8.4\conf\settings.xml [WARNING] Unrecognised tag: 'mirror' (position: START_TAG seen ...</url>-->\r\n <mirror>... @173:16) @ D:\Maven\apache-maven-3.8.4-bin\apache-maven-3.8.4\conf\settings.xml, line 173, column 16 [ERROR] 'mirrors.mirror.url' for default is missing @ D:\Maven\apache-maven-3.8.4-bin\apache-maven-3.8.4\conf\settings.xml [ERROR] 'mirrors.mirror.mirrorOf' for default is missing @ D:\Maven\apache-maven-3.8.4-bin\apache-maven-3.8.4\conf\settings.xml 进程已结束,退出代码为 1 问题解决
09-29
"C:\Program Files\Java\jdk-22\bin\java.exe" -Dmaven.multiModuleProjectDirectory=D:\JAVA_CODE\shop\mall-user -Djansi.passthrough=true -Dmaven.home=D:\maven\apache-maven-3.9.9 -Dclassworlds.conf=D:\maven\apache-maven-3.9.9\bin\m2.conf "-Dmaven.ext.class.path=D:\IntelliJ IDEA 2024.3\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\IntelliJ IDEA 2024.3\lib\idea_rt.jar=60000:D:\IntelliJ IDEA 2024.3\bin" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath D:\maven\apache-maven-3.9.9\boot\plexus-classworlds-2.8.0.jar;D:\maven\apache-maven-3.9.9\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2024.3 -s D:\maven\apache-maven-3.9.9\conf\settings.xml install [WARNING] [WARNING] Some problems were encountered while building the effective settings [WARNING] Unrecognised tag: 'profile' (position: START_TAG seen ...<!-- java1.8\u7248\u672c --> \n<profile>... @251:10) @ D:\maven\apache-maven-3.9.9\conf\settings.xml, line 251, column 10 [WARNING] Unrecognised tag: 'profile' (position: START_TAG seen ...<!-- java1.8\u7248\u672c --> \n<profile>... @251:10) @ D:\maven\apache-maven-3.9.9\conf\settings.xml, line 251, column 10 [WARNING] [INFO] Scanning for projects... [INFO] [INFO] ---------------------< com.cx.mall.user:mall-user >--------------------- [INFO] Building mall-user 1.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- resources:3.3.1:resources (default-resources) @ mall-user --- [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) @ mall-user --- Downloading from aliyunmaven: https://maven.aliyun.com/repository/public/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar Downloaded from aliyunmaven: https://maven.aliyun.com/reposit
03-15
/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/wangzhen/java/studyProject/weiyu/modules -Djansi.passthrough=true -DarchetypeCatalog=internal -Dmaven.home=/Users/wangzhen/java/DevTools/apache-maven-3.8.8 -Dclassworlds.conf=/Users/wangzhen/java/DevTools/apache-maven-3.8.8/bin/m2.conf -Dmaven.ext.class.path=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven-event-listener.jar -javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=51815:/Applications/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/wangzhen/java/DevTools/apache-maven-3.8.8/boot/plexus-classworlds.license:/Users/wangzhen/java/DevTools/apache-maven-3.8.8/boot/plexus-classworlds-2.6.0.jar org.codehaus.classworlds.Launcher -Didea.version=2023.3.6 -s /Users/wangzhen/java/DevTools/apache-maven-3.8.8/conf/settings.xml org.apache.maven.plugins:maven-clean-plugin:3.4.1:clean [WARNING] [WARNING] Some problems were encountered while building the effective settings [WARNING] Unrecognised tag: 'repositories' (position: START_TAG seen ...<!-- weiyu ai -->\r\n<repositories>... @231:15) @ /Users/wangzhen/java/DevTools/apache-maven-3.8.8/conf/settings.xml, line 231, column 15 [WARNING] Unrecognised tag: 'repositories' (position: START_TAG seen ...<!-- weiyu ai -->\r\n<repositories>... @231:15) @ /Users/wangzhen/java/DevTools/apache-maven-3.8.8/conf/settings.xml, line 231, column 15 [WARNING] [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] Non-resolvable import POM: com.alibaba.cloud.ai:spring-ai-alibaba-bom:pom:1.0.0.3-SNAPSHOT was not found in https://repo.spring.io/snapshot during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spring-snapshots has elapsed or updates are forced @ com.bytedesk:bytedesk-module-ai:${revision}, /Users/wangzhen/java/studyProject/weiyu/modules/ai/pom.xml, line 249, column 16 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.bytedesk:bytedesk-module-ai:0.9.1 (/Users/wangzhen/java/studyProject/weiyu/modules/ai/pom.xml) has 1 error [ERROR] Non-resolvable import POM: com.alibaba.cloud.ai:spring-ai-alibaba-bom:pom:1.0.0.3-SNAPSHOT was not found in https://repo.spring.io/snapshot during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spring-snapshots has elapsed or updates are forced @ com.bytedesk:bytedesk-module-ai:${revision}, /Users/wangzhen/java/studyProject/weiyu/modules/ai/pom.xml, line 249, column 16 -> [Help 2] [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/ProjectBuildingException [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException 进程已结束,退出代码为 1
最新发布
11-11
C:\Users\zhaowei582\.jdks\openjdk-22.0.1\bin\java.exe -Dmaven.multiModuleProjectDirectory=D:\zhaowei582\Projects\TestProJava\kd-duty -Djansi.passthrough=true -Dmaven.home=D:\zhaowei582\Projects\apache-maven-3.5.4 -Dclassworlds.conf=D:\zhaowei582\Projects\apache-maven-3.5.4\bin\m2.conf "-Dmaven.ext.class.path=D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.2.3\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.2.3\lib\idea_rt.jar=59691:D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.2.3\bin" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath D:\zhaowei582\Projects\apache-maven-3.5.4\boot\plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2023.2.8 -s D:\zhaowei582\Projects\settings.xml -Dmaven.repo.local=D:\zhaowei582\Projects\respo -P dev [WARNING] [WARNING] Some problems were encountered while building the effective settings [WARNING] Unrecognised tag: 'useUniqueVersions' (position: START_TAG seen ...</name>\r\n <useUniqueVersions>... @21:31) @ D:\zhaowei582\Projects\settings.xml, line 21, column 31 [WARNING] [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.jd:kdtools-duty:jar:0.0.1-SNAPSHOT [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.projectlombok:lombok:jar -> version 1.18.16 vs 1.18.24 @ line 263, column 15 [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] BUILD FAILURE
03-24
cmd.exe /c "F:\javaTools\apache-maven\apache-maven-3.9.11\bin\mvn.cmd -Didea.version=2025.2 "-Dmaven.ext.class.path=F:\javaTools\IntelliJ IDEA 2025.2\plugins\maven\lib\maven-event-listener.jar" -Djansi.passthrough=true -Dstyle.color=always -s F:\javaTools\apache-maven\apache-maven-3.9.11\conf\settings.xml -D-Dmaven.repo.local=F:\javaTools\apache-maven\maven-repository tomcat7:run" [WARNING] [WARNING] Some problems were encountered while building the effective settings [WARNING] Unrecognised tag: 'mirror' (position: START_TAG seen ...<!-- \u963f\u91cc\u4e91\u4ed3\u5e93 -->\n<mirror>... @150:9) @ F:\javaTools\apache-maven\apache-maven-3.9.11\conf\settings.xml, line 150, column 9 [WARNING] Unrecognised tag: 'mirror' (position: START_TAG seen ...<!-- \u963f\u91cc\u4e91\u4ed3\u5e93 -->\n<mirror>... @150:9) @ F:\javaTools\apache-maven\apache-maven-3.9.11\conf\settings.xml, line 150, column 9 [WARNING] [INFO] Scanning for projects... [INFO] [INFO] ----------------------< com.it.k:springmvc-demo >----------------------- [INFO] Building springmvc-demo Maven Webapp 1.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ war ]--------------------------------- [INFO] [INFO] >>> tomcat7:2.2:run (default-cli) > process-classes @ springmvc-demo >>> [INFO] [INFO] --- resources:3.3.1:resources (default-resources) @ springmvc-demo --- [WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 0 resource from src\main\resources to target\classes [INFO] [INFO] --- compiler:3.13.0:compile (default-compile) @ springmvc-demo --- [WARNING] Parameter 'compilerVersion' (user property 'maven.compiler.compilerVersion') is deprecated: This parameter is no longer evaluated by the underlying compilers, instead the actual version of the javac binary is automatically retrieved. [INFO] Recompiling the module because of changed source code. [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 21] to target\classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.065 s [INFO] Finished at: 2025-08-23T18:24:49+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project springmvc-demo: Fatal error compiling: ��Ч��Ŀ�귢�а�: 21 -> [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/MojoExecutionException
08-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值