Unrecognised tag 'encoding' position START TAG seen \r

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

                       

执行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:\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
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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值