Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on build #2

Open
Aetherus opened this issue Dec 29, 2014 · 0 comments
Open

Error on build #2

Aetherus opened this issue Dec 29, 2014 · 0 comments

Comments

@Aetherus
Copy link

When executing mvn build or mvn package, the following error occurs:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.044s
[INFO] Finished at: Mon Dec 29 10:10:43 CST 2014
[INFO] Final Memory: 9M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project gogotester-java: Compilation failure: Compilation failure:
[ERROR] /home/zhoumh/Downloads/gogotester-java-master/src/main/java/com/company/util/ConcurrentLinkedBlockingQueue.java:[20,42] error: generics are not supported in -source 1.3
[ERROR] 
[ERROR] (use -source 5 or higher to enable generics)
[ERROR] /home/zhoumh/Downloads/gogotester-java-master/src/main/java/com/company/labor/Labor.java:[31,29] error: generics are not supported in -source 1.3
[ERROR] 
[ERROR] (use -source 5 or higher to enable generics)
[ERROR] /home/zhoumh/Downloads/gogotester-java-master/src/main/java/com/company/util/PropertiesUtil.java:[15,33] error: generics are not supported in -source 1.3
[ERROR] 
[ERROR] (use -source 5 or higher to enable generics)
[ERROR] /home/zhoumh/Downloads/gogotester-java-master/src/main/java/com/company/util/HttpConnect.java:[20,4] error: generics are not supported in -source 1.3
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

I think it's because maven's java compiler defaults to 1.3, and that version doesn't support generic types.

Adding the following lines into pom.xml should help:

<build>
    ...
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.2</version>
            <configuration>
              <source>1.7</source>
              <target>1.7</target>
            </configuration>
        </plugin>
        ...
    </plugins>
    ...
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant