What does mvn install in maven exactly do

前端 未结 8 479
离开以前
离开以前 2020-12-04 06:37

I just started using Maven and I was told to do mvn install in a specific directory.

What does mvn install do, exactly?

I think i

8条回答
  •  渐次进展
    2020-12-04 07:18

    The install:install goal is provided by «Apache Maven Install Plugin»:

    Apache Maven Install Plugin

    The Install Plugin is used during the install phase to add artifact(s) to the local repository. The Install Plugin uses the information in the POM (groupId, artifactId, version) to determine the proper location for the artifact within the local repository.

    The local repository is the local cache where all artifacts needed for the build are stored. By default, it is located within the user's home directory (~/.m2/repository) but the location can be configured in ~/.m2/settings.xml using the element.

    — Apache Maven Install Plugin - Introduction.

    Having said that, the exact goal purpose:

    install:install is used to automatically install the project's main artifact (the JAR, WAR or EAR), its POM and any attached artifacts (sources, javadoc, etc) produced by a particular project.

    — Apache Maven Install Plugin - Introduction.

    For additional details on the goal, please refer to the Apache Maven Install Plugin - install:install page.

    For additional details on the build lifecycle in general and on which place the goal has in the build lifecycle, please refer to the Maven – Introduction to the Build Lifecycle page.

提交回复
热议问题