Compiler plugin in Maven

Maven compiler plugin is used to compile the source code files in a project. It has 2 goals.
  • compiler:compile
  • compiler:testCompile
We can execute these goals by issuing below commands.
  • mvn compile
  • mvn test-compile
By default, it uses source and destination compatibility as JDK 1.5 But you can change these settings by configuring the plugin as shown below. In below configuration, we have instructed maven to use source and destination JDK compatibility level as 1.8

Complex problems, Simple Solutions