jdk8 SpringBoot2.4.0
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project demo: Input length = 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project zskeeper_server: Input length = 1
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoExecutionException: Input length = 1
at org.apache.maven.plugins.resources.ResourcesMojo.execute (ResourcesMojo.java:362)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
maven-resources-plugin needs to be modified to version 3.1.0 to solve the problem
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
Comment From: philwebb
Please can you provide a sample project that shows the problem?
Comment From: brucelwl
Please can you provide a sample project that shows the problem?
https://github.com/brucelwl/demo/tree/mvn
Comment From: philwebb
There's no mvn branch on GitHub. Did you push it?
Comment From: brucelwl
There's no
mvnbranch on GitHub. Did you push it?
Sorry, I accidentally deleted it. Now it has been pushed up
Comment From: snicoll
@brucelwl thank you for the sample. application.properties contains non UTF-8 characters. I've removed those comments and this doesn't fail for me anymore. Spring Boot uses UTF-8 by default when you use spring-boot-starter-parent but that's something you can easily override for your own need.
It looks like the previous of the plugin tolerated those non UTF-8 character when filtering and does not anymore. If you think there's a regression in the ressources plugin, please follow-up on their issue tracker.
Comment From: brucelwl
@snicoll @philwebb thank you very much for solving my question
Comment From: ancchi
Hi, I'm new to Maven and Id didn't get the solution, yet. Did I miss it? Whenever I write something into my application.properties (even if it's only a normal letter) that bug appears. It's about the UTF-8 Encoding, that's for sure, but how do I fix it? In the end I changed my Java-Version from 11 to 8 and the maven-version from 2.4.1 to 2.3.7. Now it works but that cannot be the solution? Thx in advance!
Comment From: snicoll
@ancchi sorry but we can't give you Maven support here. Please follow-up on StackOverflow or file an issue in for the maven-resources-plugin project. I've shared the link to it in my previous comment.
Comment From: katriel18
I solve the error by eliminating any word that has a "ñ" from my "application.properties" file that caused me the error when deploying my project.
Comment From: dimitrycastex
same here, i delete the "ó" letter in a comment from my .properties file and problem solved.
I solve the error by eliminating any word that has a "ñ" from my "application.properties" file that caused me the error when deploying my project.
Comment From: xzharkonx
Yes, i have in my .properties file comments with accents in my words because i speak spanish, the solution is remove them, then will run for complete. Saludos desde México Cabrones!, si se pudo! xD
Comment From: tommai78101
My other option is to add this to the <project> in the pom.xml file:
<build>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<!-- Add the following exclusions here. -->
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>properties</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
</build>
Comment From: haroldo-ok
Thanks for the pointers, though it would certainly be far easier to fix such errors if the tool simply gave a message saying that a certain file contains invalid characters...
Comment From: davidddp
In my case, they were the file accents: messages_en.properties
Comment From: hmyenilmez24
I have deleted "ç" letter in the comment line on application.properties file and it worked..
Comment From: ybinds
Nothing seems to work for me
Comment From: ybinds
I added the plugin as suggested above as well, still it fails. I am not sure how to fix this, any help is much appreciated. There is nothing in application.properties file to clean
Comment From: philwebb
@ybinds The "requires Maven version 3.2.5" error suggests that you're Maven version is old. Please try upgrading it and checking with mvn --version.
Comment From: ybinds
I see that, but do I install a specific version of Maven? Any guidance please? On my instance when I say sudo yum install maven, it is installing 3.0.5 version
Comment From: ybinds
Ok I could fix my issue. I just have to remove the existing version and put a latest version 3.8.6.
Comment From: rahulcse03
In my case we have a keystore certificate file, so cant change anything in there. Here is what i did, excluded that file (sample.jks) from checks and it worked :
<testResource>
<filtering>true</filtering>
<directory>src/test/resources</directory>
<excludes>
<exclude>sample.jks</exclude>
</excludes>
</testResource>
Comment From: rugratz24
try changing your file properties to "create and delete files" this method works on me
Comment From: dansousac2
I have deleted "ç" letter in the comment line on application.properties file and it worked..
Thanks, well as i thought -> must remove from COMMENTARIES(#) on application.properties non-utf8 chars
Comment From: DalthonMike
No meu application.properties existiam alguns comentários, e nesses comentários existiam caracteres especiais. Ao retirar os caracteres especiais cheguei na solução para o meu problema.
Exemplo:
Antes
// Configurações do JPA/Hibernate spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect spring.sql.init.mode=always
Depois:
// Config do JPA/Hibernate spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect spring.sql.init.mode=always