Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when to use <build> plugin in maven pom.xml?

Tags:

maven

pom.xml

In our project, we have configured jetty inside build plugin in pom, i want to understand configuration settings in pom/ what and all we can configure in pom.

what is <build><plugin> section in pom, when to use.

difficult to understand from tutorials because lot of different examples which is making confuse.

Please can somebody explain for the above in detail?

like image 633
adithyan .p Avatar asked Oct 17 '22 17:10

adithyan .p


1 Answers

Plugins defined in your buildsection plugins tag will be executed during the build of your project.

There are many plugins that do something with your build. For example the maven-compiler-plugin which allows you to set the Java version for your project.

 <build>
   <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.6.1</version>
      <configuration>
        <source>1.8</source>
        <target>1.8</target>
      </configuration>
    </plugin>
   </plugins>
  </build>

a list of maven build plugins supported by maven itself

like image 140
Redlab Avatar answered Oct 21 '22 07:10

Redlab