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”.

maven 私库 nexus安装_第1张图片

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.

maven 私库 nexus安装_第2张图片

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来判断是快照版本还是正式版本

 

你可能感兴趣的:(maven)