user972590
user972590

Reputation: 251

Issus with building the java project using maven2

I am using maven2 to build the java project, when i issue the command mvn clean install i am getting the error could not parse error message: (use -source 5 or higher to enable generics).

In my eclipse environment i am using jdk 1.7 and the project is working fine. when i want to build the project i am unable to do that, think maven is taking java version 1.3 as default.

Any one please help me how to set the jdk versio to 1.7 in maven, to build the project successfully..

Apart from the jars mentioned in pom.xml i want to add add my own jar, how can i specify that in pom xml?

Thanks in advance..

Upvotes: 1

Views: 153

Answers (1)

Bozho
Bozho

Reputation: 597324

In your pom.xml configure the maven-compiler-plugin to use 1.6:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
    </plugins>
</build>

Upvotes: 4

Related Questions