Maven clean install: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources

We Are Going To Discuss About Maven clean install: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources. So lets Start this Java Article.

Maven clean install: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources

  1. Maven clean install: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources

    It might be a new bug coming with some latest release of Spring-boot (and then : Spring).
    I had it. The workaround is to put in your pom.xml this corrected dependency :
    <!-- Pour contourner un bug à la génération par Spring-boot 2.4.x :

  2. Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources

    It might be a new bug coming with some latest release of Spring-boot (and then : Spring).
    I had it. The workaround is to put in your pom.xml this corrected dependency :
    <!-- Pour contourner un bug à la génération par Spring-boot 2.4.x :

Solution 1

It might be a new bug coming with some latest release of Spring-boot (and then : Spring).

I had it. The workaround is to put in your pom.xml this corrected dependency :

<!-- Pour contourner un bug à la génération par Spring-boot 2.4.x : 
Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project application-etude: Input length = 1 -->               
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.1.0</version>
</plugin>               

Original Author Of This Content

Solution 2

The root cause of the exception is that some resources contain resources which should not filtered (aka binary). The correct solution is to define an exclude for file extensions which should not filtered like the following:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <configuration>
          <nonFilteredFileExtensions>
            <nonFilteredFileExtension>pdf</nonFilteredFileExtension>
            <nonFilteredFileExtension>swf</nonFilteredFileExtension>
          </nonFilteredFileExtensions>
        </configuration>
      </plugin>
    </plugins>
    ...
  </build>
  ...
</project>

Original Author Of This Content

Solution 3

I had the same problem and fixed it by adding in the pom.xml :

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

Here is the comment that help me solved the problem :
https://github.com/spring-projects/spring-boot/issues/24346#issuecomment-740345146

Original Author Of This Content

Solution 4

In my case, the error happened because I had properties files encoded with ANSI, while maven was trying to use UTF-8. I fixed it by converting my properties files to UTF-8, and then running mvn clean compile.

Original Author Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment