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

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

    If you're coming from a front-end background like me, and are familiar with Grunt and npm, think of it like this:

    First you would run, say, npm install grunt-contrib-copy --save-dev. This is like maven's . It downloads the files needed to execute a build task.

    Then you would configure the task in Gruntfile.js

    copy: {
      main: {
        src: 'src/*',
        dest: 'dest/',
      },
    }
    

    This is like maven's /. You are telling the build tool what to do with the code downloaded by npm/.

    Of course this is not an exact analogy, but close enough to help wrap your head around it.

提交回复
热议问题