Kaushik
Kaushik

Reputation: 3381

maven exclude plugin in dependency

I'm using the following Maven dependency:-

    <dependency>
        <groupId>com.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>3.1</version>
    </dependency>

The JRE version I'm using is 1.6, but the above dependency seems to use 1.7, assuming from the following in the opencsv's POM.

    <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
            <source>1.7</source>
            <target>1.7</target>
            <useIncrementalCompilation>true</useIncrementalCompilation>
        </configuration>
    </plugin>

I'm getting a Unsupported major.minor version 51.0 (unable to load class com.opencsv.bean.MappingStrategy).

Is there any way I can force the dependency to use JRE 1.6?

Upvotes: 1

Views: 228

Answers (1)

Lorenzo Boccaccia
Lorenzo Boccaccia

Reputation: 6131

No dice, what is on maven is built with that version.

what you can do, since the permissive Apache 2.0 license, is to download sources, change the compilation level in the root pom, build it and install it in a local maven repository under a version and name of your choosing.

I'd suggest to store it as a local maven repository within the project, instead of using a system dependency, but that's just personal preference.

Upvotes: 2

Related Questions