Difference between Maven Build and Maven install

后端 未结 3 1687
有刺的猬
有刺的猬 2021-01-03 23:12

I\'m using Maven in Eclipse and when I try to build my project I see the following options:

  1. Build
  2. Clean
  3. generated-sources
  4. Install
相关标签:
3条回答
  • 2021-01-03 23:20

    Maven - Introduction to the Build Lifecycle is something worth reading.

    What follows the mvn command can be a build phase, or a plugin goal.

    I would suggest that you know the use of different "goals", without going too deep.

    1. build: I have never seen such goal. Trying mvn build in my own project also gives me error.
    2. clean: cleans up the output targets
    3. generate-source: one phase of the default lifecycle. Running it will do all phases in the lifecycle, until generate-source. Hence, compile, packaging etc is not run.
    4. install: another phase of default lifecycle. It will compile, package your project, and then install it to your local repository. (I hope you have the concept of local and remote repository in Maven)
    0 讨论(0)
  • 2021-01-03 23:31

    Build is not a phase in the standard Maven life cycles, whereas install is one. mvn install
    It will invoke all the phases up to the phase install.
    It consists of compiling, packaging and installing it in the local repository.

    0 讨论(0)
  • 2021-01-03 23:37

    You may want to just run the phase of the default lifecycle install

    Or

    You may want to configure build to perform some combination of build phases and plugin goals.

    It is related to interface usability. You may only need the basic functionalities of maven or you might want to go a bit deeper and configure it to run according to your more specific needs. Eclipse aims to improve development speed and quality, providing functionalities for users with all levels of experience.

    Here is an example of some interface usability heuristics

    In this case, we are probably looking at an interface decision that targets the following heuristic:

    Flexibility and efficiency of use

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