What is the difference in maven between dependency and plugin tags in pom xml?

后端 未结 8 523
耶瑟儿~
耶瑟儿~ 2020-11-30 16:35

I\'m new to the maven tool, I have made a project with Spring and Hibernate and they are configured in pom.xml as plugins, but JUnit is tagged under dependency. My questio

相关标签:
8条回答
  • 2020-11-30 17:28

    Maven at its heart is a plugin execution framework -- as per formal and standard compact definition. To make it more clear, the commands you use like maven-install/clean/compile/build etc for creating/executing jars, which we sometimes manually run too. So, the things which you want to run (or configure or execute) you basically put them in dependency tag of mavens pom and the answer so as to who will run these dependencies (required for environment setup) be the plugins.

            javac (compiler) dependency.java (dependency) 
    
    0 讨论(0)
  • 2020-11-30 17:32

    A plugin is an extension to Maven, something used to produce your artifact (maven-jar-plugin for an example, is used to, you guess it, make a jar out of your compiled classes and resources).

    A dependency is a library that is needed by the application you are building, at compile and/or test and/or runtime time.

    0 讨论(0)
提交回复
热议问题