spring-boot: SpringBoot2.4.0 MavenFilteringException: Input length = 1

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>

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 26
  • Comments: 23 (5 by maintainers)

Commits related to this issue

Most upvoted comments

@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.

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.

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…

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

I have deleted “ç” letter in the comment line on application.properties file and it worked…

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.

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>