2

I need to install a project into my local repository.

During mvn install I'm getting compilation error.

> [INFO] --- maven-resources-plugin:2.3:resources (default-resources) @
> plant_store_sdk --- [WARNING] Using platform encoding (UTF-8 actually)
> to copy filtered resources, i.e. build is platform dependent! [INFO]
> skip non existing resourceDirectory
> /media/paddy/DATA/workspace/plant_store_sdk/src/main/resources [INFO] 
> [INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @
> plant_store_sdk --- [INFO] Compiling 8 source files to
> /media/paddy/DATA/workspace/plant_store_sdk/target/classes [INFO]
> ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
> ------------------------------------------------------------------------ [INFO] Total time: 1.163s [INFO] Finished at: Thu Jan 16 08:03:33 CET
> 2014 [INFO] Final Memory: 7M/188M [INFO]
> ------------------------------------------------------------------------ [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile
> (default-compile) on project plant_store_sdk: Compilation failure:
> Compilation failure: [ERROR]
> /media/paddy/DATA/workspace/plant_store_sdk/src/main/java/model/Kind.java:[9,5]
> error: annotations are not supported in -source 1.3

For some reason maven plugin tries to use Java 1.3.

executing mvn -v gives me this result:

paddy@paddy-laptop:~/workspace/plant_store_sdk$ mvn -version
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /usr/local/jdk1.7.0_45/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.11.0-15-generic", arch: "amd64", family: "unix"

How do I configure maven in order to get annotations running? I tried installing this project from IntelliJ, got the same error.

Cheers, and thanks for your help.

1 Answer 1

2

You need to modify your pom.xml and configure the maven compiler plugin.

Example:

<!-- language: lang-xml -->  

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .