Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the basic difference between maven compiler plugin and maven surefire plugin?

What is the basic difference between maven compiler plugin and maven surefire plugin?

Also, I wanted to define system variables inside the pom.xml, under plugin configuration and read it from my java code(Using System.property()).

<configuration>
   <systemPropertyVariables>
       <envName>testEnv</envName>
   </systemPropertyVariables>
</configuration>

This configuration is working with maven surefire plugin and I am able to read it in my java file, however, same is not working with maven compiler plugin.

like image 334
Ravi Kumar Avatar asked Sep 19 '25 19:09

Ravi Kumar


1 Answers

Those are two different plugins.

maven-compiler-plugin, as its name suggests, handles compiling your code.

maven-surefire-plugin handles [unit] test execution and failing the build process if there are test failures.

like image 59
Mureinik Avatar answered Sep 21 '25 12:09

Mureinik