一、配置文件位置
/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>