Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpringBoot2.4.0 MavenFilteringException: Input length = 1 #24346

Closed
brucelwl opened this issue Dec 7, 2020 · 24 comments
Closed

SpringBoot2.4.0 MavenFilteringException: Input length = 1 #24346

brucelwl opened this issue Dec 7, 2020 · 24 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@brucelwl
Copy link

brucelwl commented Dec 7, 2020

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>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 7, 2020
@philwebb
Copy link
Member

philwebb commented Dec 7, 2020

Please can you provide a sample project that shows the problem?

@philwebb philwebb added the status: waiting-for-feedback We need additional information before we can continue label Dec 7, 2020
@brucelwl
Copy link
Author

brucelwl commented Dec 8, 2020

Please can you provide a sample project that shows the problem?

https://github.com/brucelwl/demo/tree/mvn

image

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Dec 8, 2020
@philwebb
Copy link
Member

philwebb commented Dec 8, 2020

There's no mvn branch on GitHub. Did you push it?

@philwebb philwebb added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Dec 8, 2020
@brucelwl
Copy link
Author

brucelwl commented Dec 8, 2020

There's no mvn branch on GitHub. Did you push it?

Sorry, I accidentally deleted it. Now it has been pushed up

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Dec 8, 2020
@snicoll
Copy link
Member

snicoll commented Dec 8, 2020

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

@snicoll snicoll closed this as completed Dec 8, 2020
@snicoll snicoll added status: invalid An issue that we don't feel is valid and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Dec 8, 2020
@brucelwl
Copy link
Author

brucelwl commented Dec 8, 2020

@snicoll @philwebb thank you very much for solving my question

@ancchi

This comment has been minimized.

@snicoll

This comment has been minimized.

@katriel18
Copy link

katriel18 commented Mar 3, 2021

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.

guepardo190889 added a commit to guepardo190889/metricas that referenced this issue Mar 29, 2021
…length = 1. No pueden haber acentos (o supuestamente caracteres no UTF-8 en el application.properties -> spring-projects/spring-boot#24346)
@dimitrycastex
Copy link

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.

@xzharkonx
Copy link

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

@tommai78101
Copy link

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>

@haroldo-ok
Copy link

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

@davidddp
Copy link

davidddp commented Mar 9, 2022

In my case, they were the file accents:
messages_en.properties

humaolin pushed a commit to humaolin/spring-boot that referenced this issue May 7, 2022
The case of one data buffer containing multiple lines can could cause
a buffer leak due to a suspected issue in concatMapIterable. This
commit adds workarounds for that until the underlying issue is
addressed.

Closes spring-projectsgh-24346
@hmyenilmez24
Copy link

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

@ybinds

This comment was marked as resolved.

@ybinds

This comment was marked as resolved.

@philwebb

This comment was marked as resolved.

@ybinds

This comment was marked as resolved.

@ybinds

This comment was marked as resolved.

@rahulcse03
Copy link

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>

@rugratz24
Copy link

try changing your file properties to "create and delete files" this method works on me

@dansousac2
Copy link

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

@DalthonMike
Copy link

DalthonMike commented Jan 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests