Monday, November 4, 2013

Maven jar plugin missing resource




>Problem

Eclipse points parsing error on "<packaging>jar</packaging>" tag.

The error message:

Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed:
    A required class was missing while executing org.apache.maven.plugins:maven-resources-plugin:2.5:resources:
    org/codehaus/plexus/util/io/FileInputStreamFacade







>Solution

1. Update the libraries used by the jar plugin and add common-io jar.

- Before:

        <dependency>
            <!--used by jar plugin -->
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.1</version>
        </dependency>

        <dependency>
            <!--used by jar plugin -->
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>1.1</version>
        </dependency>




- After:

        <dependency>
            <!--used by jar plugin -->
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
      
        <dependency>
            <!--used by jar plugin -->
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>3.0.15</version>
        </dependency>

        <dependency>
            <!--used by jar plugin -->
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>


2. Finally, update the project, run:

mvn install
                      





No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...