maven 私库 nexus安装

1.开启nexus 索引下载,在System feed中可以查看

截取自 : http://books.sonatype.com/nexus-book/reference/procure-sect-configure.html

10.4.1. Enable Remote Index Downloads

When you configure procurement rules for a hosted repository, the administrative interface displays the repository as a tree view using the Maven repository format of the of groups and components using populated from remote repository’s index. Nexus ships with a set of proxy repositories, but remote index downloading is disabled by default.

To use procurement effectively, you will need to tell Nexus to download the remote indexes for a proxy repository. Click onRepositories under Views/Repositories in the Nexus menu, then click on the Central Repository in the list of repositories. Click on the Configuration tab, locate Download Remote Indexes, and switch this option to True as shown in Figure 10.3, “Enabling Remote Index Downloads for a Proxy Repository”.

figs/web/procure_central-download-remote-index.png

Figure 10.3. Enabling Remote Index Downloads for a Proxy Repository

 

Click on the Save button in the dialog shown in Figure 10.3, “Enabling Remote Index Downloads for a Proxy Repository”. Right-click on the repository row in the Repositories list and select "Update Index". Nexus will then download the remote repository index and recreate the index for any Repository Groups that contain this proxied repository.

Nexus may take a few minutes to download the remote index for a large repository. Depending on your connection to the Internet, this process can take anywhere from under a minute to a few minutes. The size of the remote index for the Central Repository currently exceeds 50MB and is growing in parallel to the size of the repository itself.

To check on the status of the remote index download, click on System Feeds under Views in the Nexus menu. Click on the last feed to see a list of "System Changes in Nexus". If you see a log entry like the one highlighted in Figure 10.4, “Verification that the Remote Index has been Downloaded”, Nexus has successfully downloaded the Remote Index from Maven Central.

figs/web/procure_reindex-system-feed.png

Figure 10.4. Verification that the Remote Index has been Downloaded

 

 

2.setting文件设置

mirrors本地镜像设置

	<mirrors>
		<mirror>
			<id>central-mirror</id>
			<mirrorOf>central</mirrorOf>
			<name>Central Mirror</name>
			<url>http://localhost:8081/content/repositories/central/</url>
		</mirror>
	</mirrors>

 

profile设置

		<profile>
			<id>common</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<properties>
				<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
				<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
			</properties>
		</profile>

		<profile>
			<id>jdk-1.6</id>
			<activation>
				<activeByDefault>true</activeByDefault>
				<jdk>1.6</jdk>
			</activation>
			<properties>
				<maven.compiler.source>1.6</maven.compiler.source>
				<maven.compiler.target>1.6</maven.compiler.target>
				<maven.compiler.compilerVersion>1.6</maven.compiler.compilerVersion>
			</properties>
		</profile>
	</profiles>

	<activeProfiles>
		<activeProfile>common</activeProfile>
		<activeProfile>jdk-1.6</activeProfile>
	</activeProfiles>

 

 

3.项目pom使用

 

<groupId>cc.me</groupId>
<artifactId>m1</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
 

 

maven2会根据模块的版本号(pom文件中的version)中是否带有-SNAPSHOT来判断是快照版本还是正式版本

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值