`

[Maven]Nexus 安装与配置

阅读更多
1
下载Nexus
http://www.sonatype.org/nexus/go

2
安装
解压即可
D:\bisoft\tools
          nexus-2.0.4-1
          sonatype-work

3
配置环境变量
NEXUS_HOME=D:\bisoft\tools\nexus-2.0.4-1
PATH 添加  %NEXUS_HOME%\bin\jsw\windows-x86-64

$NEXUS_HOME/conf/nexus.properties 可修改基本配置信息,如 sonatype-work 目录位置.
nexus-work=${bundleBasedir}/../sonatype-work/nexus

4
故障解决方案:
The nexus-webapp service was launched, but failed to start.

环境变量|系统变量|JAVA_HOME & PATH.
注意是系统变量下,不是用户变量.

5
运行
install-nexus.bat
console-nexus.bat
nexus start|stop

查看日志
%NEXUS_HOME%/logs/wrapper.log

6
进入Nexus管理界面
http://localhost:8081/nexus
管理员
账号:admin
密码:admin123

部署用户:
deployment
deployment123

匿名用户:


7
$NEXUS_HOME/conf/wrapper-override.conf 可重写nexus服务配置.

8
启用远程索引下载
左边| Repositories|选择一个远程代理仓库|下边Tab Configuration|Download Remote Indexes|true|Save|上边菜单Refresh.



默认有三个代理仓库:
Maven Central repository
Apache Snapshot repository
Codehaus Snapshot repository

现在自动开始下载索引文件.这个只会下载索引,不会下载JAR.除非手动下载啦.

9
手动下载:
下边TAB Brower Index | 找到JAR | 右边 |download.
现在,在D:\bisoft\tools\sonatype-work\nexus\storage\central\中缓存了JAR包.

10
安装为服务
64位执行 nexus.bat install 报错,原因是权限不啦.

解决办法:
新建一个nexus-install.bat:
nexus.bat install

然后右键|以管理员身份运行(好像管理员必须要密码才行....)

11
管理组,组是一个很好的东西,它能组合多个仓库并映射到一个URL上.
Nexus 默认提供一个组:Public Repositories.




Ordered Group Repositories:新加的仓库,将仓库加入其中即可.


12
改变nexus监听端口
$NEXUS_HOME/conf/nexus.properties
application-port=8081

13
配置 Maven
%user.dir%/.m2/settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
		  
  <localRepository>D:\bisoft\tools\maven3\repository</localRepository>

  <pluginGroups>
  	<pluginGroup>org.mortbay.jetty</pluginGroup>
  	<pluginGroup>org.codehaus.cargo</pluginGroup>
  </pluginGroups>

  <proxies>
  </proxies>

  <servers>
  	<server>
  		<id>releases</id>
  		<username>admin</username>
  		<password>admin123</password>
  	</server>
  	<server>
  		<id>snapshots</id>
  		<username>admin</username>
  		<password>admin123</password>
  	</server>  
  </servers>

  <mirrors>
    <mirror>
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://localhost:8081/nexus/content/groups/public</url>
    </mirror>
  </mirrors>

  <profiles>
    <profile>
      <id>nexus</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
</settings>

</settings>



配置部署
pom.xml

<distributionManagement> 
<repository> 
    <id>releases</id> 
    <name>Internal Releases</name> 
    <url>http://localhost:8081/nexus/content/repositories/releases</url> 
</repository> 
<snapshotRepository> 
    <id>Snapshots</id> 
    <name>Internal Snapshots</name> 
    <url>http://localhost:8081/nexus/content/repositories/snapshots</url> 
</snapshotRepository> 
</distributionManagement>



14
上传第三方包
14.1 
mvn deploy:deploy-file -Dgroup -Dartifact
-Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=ojdbc.jar  
-Durl=http://localhost:8081/nexus/content/repositories/thirdparty  
-Drepository

14.2
直接复制到仓库

14.3
界面上传

15.
备份

直接备份 sonatype-work 目录即可.


分享到:
评论
1 楼 coolnight 2013-04-07  
  

相关推荐

    maven nexus 配置

    maven nexus 配置,简要介绍如何配置nexus。。。。。。

    Maven Nexus 私服搭建

    Maven Nexus 私服搭建 从零开始,资源下载、安装指导、开发配置说明

    Maven的安装、配置及使用入门

    "Maven的安装、配置及使用入门" 在本章节中,我们将学习如何安装、配置和使用Maven。Maven是一个基于项目对象模型(Project Object Model,POM)的软件项目管理和构建自动化工具。它可以帮助开发者管理项目的构建、...

    Maven nexus 安装包

    ** Maven Nexus 的安装与配置 ** 1. **下载**:Maven Nexus 的安装包可以从 Sonatype 官方网站获取,包括 `sonatype-work` 和 `nexus-oss-webapp-1.9.2.4` 等文件。 2. **解压**:将下载的压缩包解压到服务器的合适...

    eclipse里maven的安装与配置

    eclipse 里 Maven 的安装与配置 Maven 是一个软件项目管理和综合工具,通过特有的 POM(project object model)概念来管理项目,功能十分强大。下面将详细介绍 Maven 的安装和配置过程。 一、安装 Maven Maven 的...

    nexus maven内部库配置安装手册

    ### Nexus Maven内部库配置安装手册知识点 #### 一、Nexus Maven仓库管理器介绍 - **产品背景**:Nexus是由Sonatype推出的一款强大的Maven仓库管理器产品,旨在帮助企业更好地管理和分发Java项目的依赖项。 - **...

    Maven与Nexus配置.pdf

    标题《Maven与Nexus配置.pdf》指向的是关于如何配置和使用Maven与Nexus的指南。Maven是一个项目管理和自动构建工具,它主要服务于基于Java的项目,帮助处理项目构建、文档生成、报告、依赖管理和项目信息等。Nexus是...

    Maven3.6.3安装与配置以及IDEA2022.2.3部署Maven的教程

    ### Maven 3.6.3 的安装与配置详解 #### 一、Maven 3.6.3 的安装步骤 **1.1 确保 Java 环境已安装** - **前提条件**: Maven 是 Java 项目构建工具,因此在安装 Maven 之前,请确保您的计算机上已经正确安装了 ...

    在CentOS下使用nexus搭建maven私服的安装教程

    本文详细介绍了在CentOS环境下使用Nexus搭建Maven私库的整个过程,包括环境准备、软件安装、配置调整、启动与访问等多个环节。通过这些步骤,可以帮助开发者有效地管理项目依赖,提高开发效率。此外,还提供了一些...

    配置maven私服nexus

    总之,Nexus是一个功能强大的Maven仓库管理工具,通过合理配置和使用,可以有效地管理私有和公共的Maven构件,提高开发效率,降低带宽消耗,并加强安全管控。对于任何使用Maven进行项目构建和依赖管理的团队,配置和...

    maven nexus私服构件示例

    Maven Nexus 私服构件示例是一个实用的教程,旨在帮助开发者理解如何在本地环境中搭建和使用...通过实践这个示例,你可以深入了解Maven与Nexus的结合使用,为你的项目构建一个安全、高效、自给自足的依赖管理体系。

    maven+nexus完整手册

    #### 二、Nexus 配置与管理 ##### 登录与基础设置 - **登录**: 默认地址为 `http://localhost:8081/nexus/`,初始用户名和密码均为 `admin`。 - **远程索引下载**: Nexus 默认关闭了远程索引下载功能,需要手动...

    maven3.8.3+nexus3.34.zip

    标题"Maven3.8.3+nexus3.34.zip"和描述中提及的是一个包含Maven 3.8.3版本和Nexus 3.34版本的压缩包文件,适用于Windows 64位操作系统。这两个工具在软件开发,尤其是Java开发中扮演着重要角色。以下是关于Maven和...

    手动搭建maven私服-安装配置nexus 3.4教程

    "手动搭建maven私服-安装配置nexus 3.4教程" 手动搭建maven私服是指使用nexus 3.4安装配置一个maven私服,实现公司或个人项目的构件管理。下面将详细介绍手动搭建maven私服的过程。 一、安装nexus 3.4 首先下载...

    maven私服nexus安装配置

    nexus是一个强大的maven仓库管理器,它极大的简化了本地内部仓库的维护和外部仓库的访问. nexus是一套开箱即用的系统不需要数据库,它使用文件系统加Lucene来组织数据 nexus使用ExtJS来开发界面,利用Restlet来...

    linux-maven-maven私服nexus安装文档

    - **配置环境变量**:与Maven类似,你需要设置Nexus的JAVA_HOME环境变量指向你的JDK安装路径,同时可能需要配置NEXUS_HOME变量指向Nexus的解压目录。 - **启动登录私服**:运行Nexus的启动脚本,如`./bin/nexus ...

    建立Maven私服 – Nexus下载、安装、配置、使用

    为了让Maven知道如何与Nexus交互,需要在Maven的`settings.xml`中配置新的repository和proxy。将Nexus的URL、仓库ID、用户名和密码添加到对应的元素中。 ```xml &lt;id&gt;nexus &lt;url&gt;...

Global site tag (gtag.js) - Google Analytics