文档章节

nexus配置

n
 nibilly
发布于 2016/07/27 10:43
字数 788
阅读 45
收藏 0

一、配置文件位置

/home/tools/nexus/WEB-INF/classes/nexus.properties

二、找到sonatype-work目录

/root/sonatype-work

三、找到nexus配置文件

/root/sonatype-work/nexus/conf/nexus.xml

示例配置:

<?xml version="1.0" encoding="UTF-8"?>
<nexusConfiguration>
  <version>2.8.0</version>
  <nexusVersion>2.11.1-01</nexusVersion>
  <globalConnectionSettings>
    <connectionTimeout>20000</connectionTimeout>
    <retrievalRetryCount>3</retrievalRetryCount>
  </globalConnectionSettings>
  <remoteProxySettings />
  <restApi>
    <baseUrl>http://120.55.192.163:8080/nexus/</baseUrl>
    <uiTimeout>60000</uiTimeout>
  </restApi>
  <httpProxy>
    <enabled>true</enabled>
    <port>8082</port>
    <proxyPolicy>strict</proxyPolicy>
  </httpProxy>
  <routing>
    <resolveLinks>true</resolveLinks>
  </routing>
  <repositories>
    <repository>
      <id>releases</id>
      <name>Releases</name>
      <providerRole>org.sonatype.nexus.proxy.repository.Repository</providerRole>
      <providerHint>maven2</providerHint>
      <localStatus>IN_SERVICE</localStatus>
      <notFoundCacheTTL>1440</notFoundCacheTTL>
      <userManaged>true</userManaged>
      <exposed>true</exposed>
      <browseable>true</browseable>
      <writePolicy>ALLOW_WRITE</writePolicy>
      <indexable>true</indexable>
      <searchable>true</searchable>
      <localStorage>
        <provider>file</provider>
        <url>/home/data/nexus/release</url>
      </localStorage>
      <externalConfiguration>
        <proxyMode>ALLOW</proxyMode>
        <artifactMaxAge>-1</artifactMaxAge>
        <itemMaxAge>1440</itemMaxAge>
        <cleanseRepositoryMetadata>false</cleanseRepositoryMetadata>
        <downloadRemoteIndex>false</downloadRemoteIndex>
        <checksumPolicy>WARN</checksumPolicy>
        <repositoryPolicy>RELEASE</repositoryPolicy>
      </externalConfiguration>
    </repository>
    <repository>
      <id>snapshots</id>
      <name>Snapshots</name>
      <providerRole>org.sonatype.nexus.proxy.repository.Repository</providerRole>
      <providerHint>maven2</providerHint>
      <localStatus>IN_SERVICE</localStatus>
      <notFoundCacheTTL>1440</notFoundCacheTTL>
      <userManaged>true</userManaged>
      <exposed>true</exposed>
      <browseable>true</browseable>
      <writePolicy>ALLOW_WRITE_ONCE</writePolicy>
      <indexable>true</indexable>
      <searchable>true</searchable>
      <localStorage>
        <provider>file</provider>
        <url>/home/data/nexus/snapshot</url>
      </localStorage>
      <externalConfiguration>
        <proxyMode>ALLOW</proxyMode>
        <artifactMaxAge>1440</artifactMaxAge>
        <itemMaxAge>1440</itemMaxAge>
        <cleanseRepositoryMetadata>false</cleanseRepositoryMetadata>
        <downloadRemoteIndex>false</downloadRemoteIndex>
        <checksumPolicy>WARN</checksumPolicy>
        <repositoryPolicy>SNAPSHOT</repositoryPolicy>
      </externalConfiguration>
    </repository>
    <repository>
      <id>thirdparty</id>
      <name>3rd party</name>
      <providerRole>org.sonatype.nexus.proxy.repository.Repository</providerRole>
      <providerHint>maven2</providerHint>
      <localStatus>IN_SERVICE</localStatus>
      <notFoundCacheTTL>1440</notFoundCacheTTL>
      <userManaged>true</userManaged>
      <exposed>true</exposed>
      <browseable>true</browseable>
      <writePolicy>ALLOW_WRITE_ONCE</writePolicy>
      <indexable>true</indexable>
      <searchable>true</searchable>
      <localStorage>
        <provider>file</provider>
        <url>/home/data/nexus/thirdparty</url>
      </localStorage>
      <externalConfiguration>
        <proxyMode>ALLOW</proxyMode>
        <artifactMaxAge>-1</artifactMaxAge>
        <itemMaxAge>1440</itemMaxAge>
        <cleanseRepositoryMetadata>false</cleanseRepositoryMetadata>
        <downloadRemoteIndex>false</downloadRemoteIndex>
        <checksumPolicy>WARN</checksumPolicy>
        <repositoryPolicy>RELEASE</repositoryPolicy>
      </externalConfiguration>
    </repository>
    <repository>
      <id>public</id>
      <name>Public Repositories</name>
      <providerRole>org.sonatype.nexus.proxy.repository.GroupRepository</providerRole>
      <providerHint>maven2</providerHint>
      <localStatus>IN_SERVICE</localStatus>
      <notFoundCacheTTL>15</notFoundCacheTTL>
      <userManaged>true</userManaged>
      <exposed>true</exposed>
      <browseable>true</browseable>
      <writePolicy>READ_ONLY</writePolicy>
      <indexable>true</indexable>
      <localStorage>
        <provider>file</provider>
      </localStorage>
      <externalConfiguration>
        <memberRepositories>
          <memberRepository>thirdparty</memberRepository>
          <memberRepository>releases</memberRepository>
          <memberRepository>snapshots</memberRepository>
          <memberRepository>oschina</memberRepository>
          <memberRepository>oschina-third-party</memberRepository>
        </memberRepositories>
      </externalConfiguration>
    </repository>
    <repository>
      <id>oschina</id>
      <name>oschina</name>
      <providerRole>org.sonatype.nexus.proxy.repository.Repository</providerRole>
      <providerHint>maven2</providerHint>
      <localStatus>IN_SERVICE</localStatus>
      <notFoundCacheActive>true</notFoundCacheActive>
      <notFoundCacheTTL>1440</notFoundCacheTTL>
      <userManaged>true</userManaged>
      <exposed>true</exposed>
      <browseable>true</browseable>
      <writePolicy>READ_ONLY</writePolicy>
      <indexable>true</indexable>
      <searchable>true</searchable>
      <localStorage>
        <provider>file</provider>
        <url>/home/data/nexus/oschina</url>
      </localStorage>
      <remoteStorage>
        <url>http://maven.oschina.net/content/groups/public/</url>
      </remoteStorage>
      <externalConfiguration>
        <repositoryPolicy>RELEASE</repositoryPolicy>
        <checksumPolicy>WARN</checksumPolicy>
        <fileTypeValidation>true</fileTypeValidation>
        <downloadRemoteIndex>true</downloadRemoteIndex>
        <artifactMaxAge>-1</artifactMaxAge>
        <metadataMaxAge>1440</metadataMaxAge>
        <itemMaxAge>1440</itemMaxAge>
        <autoBlockActive>true</autoBlockActive>
        <proxyMode>ALLOW</proxyMode>
      </externalConfiguration>
    </repository>
    <repository>
      <id>oschina-third-party</id>
      <name>oschina-third-party</name>
      <providerRole>org.sonatype.nexus.proxy.repository.Repository</providerRole>
      <providerHint>maven2</providerHint>
      <localStatus>IN_SERVICE</localStatus>
      <notFoundCacheActive>true</notFoundCacheActive>
      <notFoundCacheTTL>1440</notFoundCacheTTL>
      <userManaged>true</userManaged>
      <exposed>true</exposed>
      <browseable>true</browseable>
      <writePolicy>READ_ONLY</writePolicy>
      <indexable>true</indexable>
      <searchable>true</searchable>
      <localStorage>
        <provider>file</provider>
        <url>/home/data/nexus/oschina</url>
      </localStorage>
      <remoteStorage>
        <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
      </remoteStorage>
      <externalConfiguration>
        <repositoryPolicy>RELEASE</repositoryPolicy>
        <checksumPolicy>WARN</checksumPolicy>
        <fileTypeValidation>true</fileTypeValidation>
        <downloadRemoteIndex>true</downloadRemoteIndex>
        <artifactMaxAge>-1</artifactMaxAge>
        <metadataMaxAge>1440</metadataMaxAge>
        <itemMaxAge>1440</itemMaxAge>
        <autoBlockActive>true</autoBlockActive>
        <proxyMode>ALLOW</proxyMode>
      </externalConfiguration>
    </repository>
  </repositories>
  <repositoryGrouping>
    <pathMappings>
      <pathMapping>
        <id>inhouse-stuff</id>
        <groupId>*</groupId>
        <routeType>inclusive</routeType>
        <routePatterns>
          <routePattern>^/(com|org)/somecompany/.*</routePattern>
        </routePatterns>
        <repositories>
          <repository>snapshots</repository>
          <repository>releases</repository>
        </repositories>
      </pathMapping>
      <pathMapping>
        <id>apache-stuff</id>
        <groupId>*</groupId>
        <routeType>exclusive</routeType>
        <routePatterns>
          <routePattern>^/org/some-oss/.*</routePattern>
        </routePatterns>
        <repositories>
          <repository>releases</repository>
          <repository>snapshots</repository>
        </repositories>
      </pathMapping>
    </pathMappings>
  </repositoryGrouping>
  <repositoryTargets>
    <repositoryTarget>
      <id>1</id>
      <name>All (Maven2)</name>
      <contentClass>maven2</contentClass>
      <patterns>
        <pattern>.*</pattern>
      </patterns>
    </repositoryTarget>
    <repositoryTarget>
      <id>2</id>
      <name>All (Maven1)</name>
      <contentClass>maven1</contentClass>
      <patterns>
        <pattern>.*</pattern>
      </patterns>
    </repositoryTarget>
    <repositoryTarget>
      <id>3</id>
      <name>All but sources (Maven2)</name>
      <contentClass>maven2</contentClass>
      <patterns>
        <pattern>(?!.*-sources.*).*</pattern>
      </patterns>
    </repositoryTarget>
    <repositoryTarget>
      <id>4</id>
      <name>All Metadata (Maven2)</name>
      <contentClass>maven2</contentClass>
      <patterns>
        <pattern>.*maven-metadata\.xml.*</pattern>
      </patterns>
    </repositoryTarget>
    <repositoryTarget>
      <id>any</id>
      <name>All (Any Repository)</name>
      <contentClass>any</contentClass>
      <patterns>
        <pattern>.*</pattern>
      </patterns>
    </repositoryTarget>
    <repositoryTarget>
      <id>site</id>
      <name>All (site)</name>
      <contentClass>site</contentClass>
      <patterns>
        <pattern>.*</pattern>
      </patterns>
    </repositoryTarget>
    <repositoryTarget>
      <id>rubygems</id>
      <name>All (rubygems)</name>
      <contentClass>rubygems</contentClass>
      <patterns>
        <pattern>.*</pattern>
      </patterns>
    </repositoryTarget>
    <repositoryTarget>
      <id>npm</id>
      <name>All (npm)</name>
      <contentClass>npm</contentClass>
      <patterns>
        <pattern>.*</pattern>
      </patterns>
    </repositoryTarget>
    <repositoryTarget>
      <id>nuget</id>
      <name>All (nuget)</name>
      <contentClass>nuget</contentClass>
      <patterns>
        <pattern>.*</pattern>
      </patterns>
    </repositoryTarget>
  </repositoryTargets>
  <smtpConfiguration>
    <hostname>smtp-host</hostname>
    <port>25</port>
    <username>smtp-username</username>
    <password>{jtxQBfpHxwkH9lFu/Rx16Doy9JF3o5oxdpGKNPEO06s=}</password>
    <systemEmailAddress>system@nexus.org</systemEmailAddress>
  </smtpConfiguration>
  <notification>
    <notificationTargets>
      <notificationTarget>
        <targetId>autoBlockTarget</targetId>
      </notificationTarget>
    </notificationTargets>
  </notification>
</nexusConfiguration>
 

 

© 著作权归作者所有

上一篇: settings.xml配置
下一篇: mysql 配置参考
n
粉丝 14
博文 204
码字总数 43498
作品 0
厦门
私信 提问
Nexus 3.x 安装/配置/使用

写在前面 博客中的nexus是基于 如与读者的有差异请自行参考修正. 部分内容, 参考了网上其它文章, 但本博客的内容, 都是本人亲测可用的. 最后, 如有雷同, 纯属抄袭( ^-^) , 欢迎转载, 如有问题...

开源蛀虫
2017/10/21
981
0
linux部署安装maven私有库

linux部署安装maven私有库 1、先安装好jdk 2、下载sonatype Nexus 下载地址:http://pan.baidu.com/s/1dFJv5wl 3、在linux根目录下创建文件夹 # mkdir nexus 4、将安装包上传至linux系统上 上...

a8752311
2017/01/09
0
0
maven小节,Nexus私服,构件打包发布,动态资源过滤,自动部署到本地或远程服务器

阅读此文的前提,对Maven 有一定了解,熟悉pom文件基础 1:Nexus 建立私服 ![在此输入图片描述][1] 手动建立仓库 ,仓库分类有1:宿主仓库 2:代理仓库 3:仓库组 关于建立私服,也很简单,不...

满风
2014/04/27
1K
1
maven私服nexus配置 说明

Nexus是常用的私用Maven服务器,一般是公司内部使用。 Nexus安装设置 1.Nexus下载 下载地址:http://www.sonatype.org/nexus/go/ 下载后的文件:nexus-2.11.4-01-bundle.zip 安装:直接解压到...

orec
2016/11/01
420
0
Maven私有库和本地库的安装与配置 Sonatype Nexus + Maven

样例参考视频:http://www.roncoo.com/course/view/85d6008fe77c4199b0cdd2885eaeee53 环境:CentOS 6.6 Final、JDK7、Sonatype Nexus、Maven IP:192.168.4.221 root用户操作 前提:已安装J......

赵蕊
2017/06/08
157
0

没有更多内容

加载失败,请刷新页面

加载更多

好程序员web前端教程分享web前端入门基础知识

  好程序员web前端教程分享web前端入门基础知识,作为合格的Web前端工程师必须得掌握HTML、CSS和JavaScript。只懂其中一两个还不行,必须对这三门语言都要熟悉。下面我们一起来看一看吧! ...

好程序员官网
12分钟前
3
0
elasticsearch 中文分词插件IK-Analyze

elasticsearch 版本 7.3 安装中文分词插件 插件对应的版本需要和elasticsearch的版本一致 插件各个版本下载地址 https://github.com/medcl/elasticsearch-analysis-ik/releases 使用elastic...

kdy1994
16分钟前
3
0
只用一套解决方案,就可解决80%的交通物流行业信息难题

行业背景 新中国成立70多年来,中国交通运输总体上已经形成了多节点、全覆盖的综合运输网络,“五纵五横”综合运输大通道基本贯通,一大批综合客运、货运枢纽站场(物流园区)投入运营,取得...

朕想上头条
18分钟前
4
0
spring-boot结合AOP实现数据源动态配置

Spring-Boot+AOP方式实现多数据源切换 设计总体思路:Spring-Boot+AOP方式实现多数据源切换,继承AbstractRoutingDataSource实现数据源动态的获取,在service层使用注解指定数据源。 一、多数...

蜗牛伊
19分钟前
3
0
干货 | 京东技术中台的Flutter实践之路

在 2019 年,Flutter 推出了多个正式版本,支持的终端越来越多,使用的项目也越来越多。Flutter 正在经历从小范围尝鲜到大面积应用的过程,越来越多的研发团队加入到 Flutter 的学习热潮中,...

京东云技术新知
22分钟前
3
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部