Apache Maven Compiler Plugin

Source: Internet
Author: User

The Compiler Plugin is used to compile the sources of your project. Since 3.0, the default compiler is Javax.tools.JavaCompiler (if you were using Java 1.6) and is used to compile Java source S. If you want to force the plugin using javac, you must configure the plugin option forcejavaccompileruse.

Also Note that at present the default source setting are 1.5 and the default target setting is c5>1.5, independently of the JDK you run Maven with. If you want to change these defaults, you should set source and target as described in Setting the-sour Ce And-target of the Java Compiler.

Other compilers than Javac can is used and work have already started on AspectJ,. NET, and C #.

Note: to know more on the JDK Javac, please see:http://download.oracle.com/javase/6/docs/technotes/tools/windows/ javac.html.

Goals Overview

The Compiler Plugin has a goals. Both is already bound to their proper phases within the Maven Lifecycle and is therefore, automatically executed during their respective phases.

    • Compiler:compile are bound to the compile phase and are used to compile the main source files.
    • Compiler:testcompile are bound to the test-compile phase and are used to compile the test source files.
Usage

General Instructions The Compiler Plugin can is found on the usage page. Some more specific use cases is described in the examples given below.

In case you still has questions regarding the plugin ' s usage, please have a look at The faq and feel free to Contact The user Mailing list. The posts to the mailing list is archived and could already contain the answer to your question as part of a older Threa D. Hence, it is also worth browsing/searching the mail archive.

If you feel like the plugin is missing a feature or have a defect, you can fill a feature request or bug report in our ISSU E Tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it's crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue is very much appre Ciated. Of course, patches is welcome, too. Contributors can check out the project from our source repository and'll find supplementary information in the Helping with Maven.

Examples

To provide-better understanding on some usages of the Compiler Plugin, you can take a look into the following Exa Mples:

    • Compile Using A Different JDK
    • Compile Using-source and-target Javac Options
    • Compile Using Memory Allocation Enhancement
    • Pass Compiler Arguments

Apache Maven Compiler Plugin

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.