maven相关

本文详细介绍了Maven的setting文件和pom文件配置方法,包括如何设置镜像以提高下载速度,以及常用的Maven命令如mvn version、clean、install、compile和test等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. maven的setting文件配置

<!-- mirrors
   | This is a list of mirrors to be used in downloading artifacts from remote repositories.
   |
   | It works like this: a POM may declare a repository to use in resolving certain artifacts.
   | However, this repository may have problems with heavy traffic at times, so people have mirrored
   | it to several places.
   |
   | That repository definition will have a unique id, so we can create a mirror reference for that
   | repository, to be used as an alternate download site. The mirror site will be the preferred
   | server for that repository.
   |-->
  <mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     | 
     <mirror>
		  <id>nexus-osc</id>
		  <mirrorOf>*</mirrorOf>
		  <name>Nexus osc</name>
		  <url>http://maven.oschina.net/content/groups/public/</url>
	  </mirror>-->
	  <mirror>
		  <id>mirrorId</id>
		  <mirrorOf>repositoryId</mirrorOf>
		  <name>Human Readable Name for this Mirror.</name>
		  <url>http://my.repository.com/repo/path</url>
	  </mirror>


	<mirror>
        <id>nexus-aliyun</id>
        <mirrorOf>*</mirrorOf>
        <name>Nexus aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>
   
  </mirrors>

mirrors镜像配置

 

2. maven的pom文件配置

 

3. maven常用命令:

mvn -version

mvn clean 

mvn install

mvn compile

mvn test

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值