Hi,

On 21.01.23 14:02, Nils Breunese wrote:
I’d say it’s pretty common to have binary files under src/main/resources 
actually. Images, movies, etc. for instance.

That's correct but you should never filter them... that's the issue here..

In general two options:

Change the configuration for filtering and exclude the binary formats
for example:
https://maven.apache.org/plugins/maven-resources-plugin/examples/binaries-filtering.html

or create two different directories and use the following configuration:


    <testResources>
      <testResource>
        <directory>src/test/filtered-resources</directory>
        <filtering>true</filtering>
      </testResource>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>false</filtering>
      </testResource>
    </testResources>
    <resources>
      <resource>
        <directory>src/main/filtered-resources</directory>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>false</filtering>
      </resource>
    </resources>


That simply means the default directory src/main/resources contains only
resources which are not filtered and src/main/filtered-resources will
contain resources which will be filtered...



Kind regards
Karl Heinz Marbaise

It’s also pretty common to commit Gradle Wrapper or Maven Wrapper JAR files, 
but in this case it looks like this Gradle Wrapper JAR is not used for building 
the codebase itself, but possibly for some other use case. I myself for 
instance maintain an application based on Spring Initializr, which also has 
these build tool wrapper JARs in its resources, because it can generate new 
projects with these files included.

I don’t know if the presence of this JAR makes sense in this case, but you 
indeed might want to exclude it from resource filtering.

Nils.

Op 20 jan. 2023 om 17:22 heeft Karl Heinz Marbaise <khmarba...@gmx.de> het 
volgende geschreven:


Accidentially not included the list...


-------- Forwarded Message --------
Subject: Re: MalformedInputException: Input length = 1
Date: Fri, 20 Jan 2023 13:50:52 +0100
From: Karl Heinz Marbaise <khmarba...@gmx.de>
Reply-To: i...@soebes.de
To: Tom Corcoran <tom.corco...@moonbade.com>

Hi,
On 18.01.23 17:23, Tom Corcoran wrote:
Hi,

I am working on upgrading my use of the openapi-generator-maven-plugin for
Spring Boot 3. My API gets generated and includes the expected pom.xml &
gradle elements (I only used the former).

Anyway then your plugin is used to copy 62 resourees,
maven-resources-plugin:3.3.0 and I get the message:

  [ERROR] Failed to execute goal
org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources
(default-resources) on project ABC: filtering
  ...\src\main\resources\v1\gradle\wrapper\gradle-wrapper.jar to
...\target\classes\v1\gradle\wrapper\gradle-wrapper.jar failed with
MalformedInputException: Input length = 1

Any ideas are much appreciated!!


Why is a JAR file in your src/main/resources directory? (binary file?)
does not make sense nor can you filter a binary file correctly...

That is the reason.

Kind regards
Karl Heinz Marbaise



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to