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

后端 未结 8 562
耶瑟儿~
耶瑟儿~ 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:18

    Maven itself can be described as food processor which has many different units that can be used to accomplish different tasks. Those units are called plugins. For example, to compile your project maven uses maven-compiler-plugin, to run tests - maven-surefire-plugin and so on.

    Dependency in terms of maven is a packaged piece of classes that your project depends on. It can be jar, war etc. For example, if you want to be able to write JUnit test, you'll have to use JUnit annotations and classes thus you have to declare that your project depends on JUnit.

提交回复
热议问题