我爱编程

Maven 的使用(更新)

2018-08-09  本文已影响0人  c7245d80a030

MAVEN配置文件

文件位置: maven/conf/settings.xml
Maven 下载

常用标签

<localRepository>

 <localRepository>D:\buildtools\apache-maven-3.5.4-bin\apache-maven-3.5.4\repos-el</localRepository>

<mirrors>

<mirrors>
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
  </mirrors>

MAVEN清理编译和部署

maven clean

清理工程目录下的target文件夹,以及在仓库中部署的项目jar包

maven compile

maven install

MAVEN中各标签的作用

参考:

https://blog.csdn.net/cd18333612683/article/details/66478332

<type>

pom:

保证了之后引入的jar包版本一致
例子:

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Edgware.SR2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

<scope>

scope依赖

转载请注明出处.

上一篇 下一篇

猜你喜欢

热点阅读