idea打包发出警告Using platform encoding (UTF-8 actually) to copy filtered resources,解决方法

博客讲述在Idea中使用Maven打包时出现'Using platform encoding (UTF-8 actually) to copy filtered resources'警告的问题。并给出解决办法,即在<project>元素下添加<properties>,其中包含<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>。

Using platform encoding (UTF-8 actually) to copy filtered resources

今天在idea中用maven打包是发出警告

Using platform encoding (UTF-8 actually) to copy filtered resources

解决方法:

在<project>元素下面添加:

   <properties>     
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>     

   </properties> 

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" [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: 0.723 s [INFO] Finished at: 2025-08-23T19:35:24+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
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值