Logo Questions Linux Laravel Mysql Ubuntu Git Menu

is there difference between dependencies and dependencies in plugin tags?

I have a question.

In pom.xml, dependency is included in two places. one place can be in <project> tag and the other place can be in <plugin> tag.

I think the dependencies in tags is just related with the plugin? is it correct?

thanks in advance :)

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <name>HornetQ JMS Clustered Queue Example</name>







like image 966
verystrongjoe Avatar asked Mar 24 '23 09:03


1 Answers

The <dependencies> which is under the <project> is a dependency list for our artifacts which Maven will download and link the dependencies for us on compilation. Please see POM Reference: Dependencies and Introduction to the Dependency Mechanism for further information.

The <dependencies> which is under the <plugin> is to apply as dependencies of the plugin that they are under. The power of this is to alter the dependency list of a plugin, perhaps by removing an unused runtime dependency via exclusions, or by altering the version of a required dependency. Please see POM Reference: Plugins and Guide to Configuring Plug-ins for further information.

I hope this may help.

like image 198
Charlee Chitsuk Avatar answered Mar 31 '23 03:03

Charlee Chitsuk