Maven Compile
|
|
|
Maven Compiler Plugin Configuration
The fist step to build a java application is to be able to compile a maven projet . According to the dependencies created in the POM file (Project object model) Maven is able to define the classpath and compile using the default jdk using the following command :
Maven compile incrementally. An incremental build reuses the results of a previous build to perform an optimized build based on the changes since the last build. If your code has been compiled by Eclipse you can have some surprises due to some tips and tricks used by the Eclipse compiler. To ensure a full compilation by the default Sun JDK you should make a cleanup before compiling. It will delete the previously compiled classes contained in the {project directory}/target/classes
If you want to compile without your Unit test defined in {project directory}/src/test/java your can ask maven to skip the test
Compiler version
If you need to define the compiler version you can set the source and target parameter in the Compiler Plugin :
Maven Tutorial related articles
- Maven installation procedure for Windows
- Maven installation guide for Linux
- Maven release
- Find unused jars using Maven
- Maven Dependency Tree