maven nexus私服配置

下载地址:
	https://www.sonatype.com/nexus-repository-oss
	https://www.sonatype.com/download-oss-sonatype
配置文件地址:
	/etc/nexus.properties
启动服务:
	bin/nexus
开放端口 8081
	firewall-cmd --get-active-zones 
	firewall-cmd --zone=FedoraServer --add-port=8081/tcp --permanent
	firewall-cmd --reload
	firewall-cmd --list-ports 
访问地址:
	http://192.168.42.29:8081/
	其中admin具有全部权限默认密码admin123;anonymous作为匿名用户,只具有查看权限。 

安装到本地库:
	mvn clean/mvn compile/mvn package
	mvn install:install-file -DgroupId=com.ctl -DartifactId=commonUtils -Dversion=1.0.1 -Dpackaging=jar -Dfile=/home/jars/commonUtils.jar
安装到私服 :
	mvn deploy:deploy-file -DgroupId=org.apache.hadoop -DartifactId=hbase -Dversion=1.0 -Dpackaging=jar -Dfile=[path to file] -Durl=[url] -DrepositoryId=[id]
	mvn deploy:deploy-file -DgroupId=com.ctl -DartifactId=commonUtils -Dversion=1.0.1 -Dpackaging=jar -Dfile=target/commonUtils.jar -Durl=http://192.168.42.29:8081/repository/maven-releases/  -DrepositoryId=maven-release

maven conf settings.xml中有如下配置







  

  

  

  
  
    
		org.sonatype.plugins  
  

  
  
    
  

  

  
		 
			maven-release
			admin
			admin123
		
		 
			maven-snapshots
			admin
			admin123
		
		
			apacheserver
			root
			ctllin
		
    

    
  

  
  
    
     
     
			ctllin
			*
			http://192.168.42.29:8081/repository/maven-public/
		
		 
			repo2
			central
			Human Readable Name for this Mirror.
			http://repo2.maven.org/maven2/
		
  

  
  
	  
	     jdk-1.8
	     
	         true
	         1.8
	     
	     
	         1.8
	         1.8
	         1.8
	     
	 
	 
	  
			ctllin
			
				
					nexus
					http://192.168.42.29:8081/repository/maven-releases/
					
						true
					
					
						true
					
				
			
			
				
					nexus
					http://192.168.42.29:8081/repository/maven-releases/
					
						true
					
					
						true
					
				
			
		
    

    
  
  /home/soft/apache-maven-3.5.2/repository   

  
   
		ctllin
	


pom.xml配置如下

    4.0.0

    com.ctl.utils
    commonUtils
    1.0
    jar

    commonUtils
    http://maven.apache.org
    
        
        
            maven-release
            Releases
            http://192.168.42.29:8081/repository/maven-releases
        
        
            maven-snapshots
            Snapshot
            http://192.168.42.29:8081/repository/maven-snapshots
        
    
    
        UTF-8
        1.8
        1.8
        
        5.0.2.RELEASE
        UTF-8
        
        7.2.1
    
    
        
            
                src/main/java
                
                    **/mapper/*Mapper.xml
                
            
            
                ${basedir}/src/main/resources
            
        
        commonUtils
        
            
                org.apache.maven.plugins
                maven-surefire-plugin
                
                    true
                
            
            
                org.apache.maven.plugins
                maven-compiler-plugin
                3.7.0
                
                    1.8
                    1.8
                
            
            
            
                org.apache.maven.plugins
                maven-jar-plugin
                3.0.2
                
                    
                        ${project.build.outputDirectory}/META-INF/MANIFEST.MF
                        
                            true
                            lib/
                            com.ctl.utils.io.NIOServerUtil
                        
                    
                
            

            
                org.apache.maven.plugins
                maven-dependency-plugin
                3.0.2
                
                    
                        copy-dependencies
                        package
                        
                            copy-dependencies
                        
                        
                            ${project.build.directory}/lib
                        
                    
                
            
        
    

    
        
        
            junit
            junit
            4.12
            test
        
        
        
            org.apache.commons
            commons-lang3
            3.7
        

        
        
        
        
        
        
        
        

        
        
        
        
        
        

        
        

        
        
            org.slf4j
            slf4j-api
            1.7.25
            
        

        
        
        
        
            ch.qos.logback
            logback-core
            1.2.3
        

        
        
            ch.qos.logback
            logback-classic
            1.2.3
        
        
        
        
        
            ch.qos.logback
            logback-access
            1.2.3
        
        
        
        
        

        
        

        
        
            org.springframework
            spring-context
            ${spring.version}
        
        
        
            org.springframework
            spring-core
            ${spring.version}
        
        
        
            org.springframework
            spring-beans
            ${spring.version}
        
        
        
            org.springframework
            spring-web
            ${spring.version}
        
        
        
            org.springframework
            spring-webmvc
            ${spring.version}
        
        
        
            org.springframework
            spring-aop
            ${spring.version}
        
        
        
            org.springframework
            spring-tx
            ${spring.version}
        
        
        
            org.springframework
            spring-jdbc
            ${spring.version}
        

        
        
            commons-io
            commons-io
            2.6
        
        
        
            commons-codec
            commons-codec
            1.11
        
        
        
            org.jfree
            jfreechart
            1.5.0
        
        
        
            javax.servlet
            javax.servlet-api
            4.0.0
            provided
        
        
        
            commons-net
            commons-net
            3.6
        
        
        
            org.apache.httpcomponents
            httpclient
            4.5.4
        
        
        
            org.apache.httpcomponents
            httpclient-cache
            4.5.4
        
        
        
            org.apache.httpcomponents
            httpcore
            4.4.9
        
        
        
            org.apache.httpcomponents
            httpmime
            4.5.4
        
        
        
            net.sf.ehcache
            ehcache-core
            2.6.11
        
        
        
        
        
        
        
        
        
            org.apache.mina
            mina-core
            2.0.16
        
        
        
            org.samba.jcifs
            jcifs
            1.3.3
        
        
        
        
        
        
            cglib
            cglib
            3.2.6
        
        
        
            mysql
            mysql-connector-java
            8.0.8-dmr
        
        
        
        
        
        
        
        
        
            net.sf.json-lib
            json-lib
            2.4
            jdk15
        

        
        
            javax.servlet.jsp
            javax.servlet.jsp-api
            2.3.2-b02
            provided
        
        
        
            com.github.fernandospr
            javapns-jdk16
            2.4.0
        

        
        
            javax.mail
            mail
            1.5.0-b01
        
        
        
            org.apache.kafka
            kafka_2.12
            1.0.0
        
        
        
            org.apache.kafka
            kafka-clients
            1.0.0
        
        
        
            redis.clients
            jedis
            2.9.0
        
        
        
            com.rabbitmq
            amqp-client
            5.1.2
        
        
        
            commons-httpclient
            commons-httpclient
            3.1
        
        
        
            commons-fileupload
            commons-fileupload
            1.3.3
        
        
        
            com.rabbitmq
            rabbitmq-client
            1.3.0
        
        
            com.alibaba
            dubbo
            2.6.0
        
        
        
            org.apache.lucene
            lucene-core
            ${lucene.version}
        
        
        
            org.apache.lucene
            lucene-queryparser
            ${lucene.version}
        
        
        
            org.apache.lucene
            lucene-analyzers-common
            ${lucene.version}
        
        
        
            org.apache.lucene
            lucene-queries
            ${lucene.version}
        
        
        
            org.apache.lucene
            lucene-facet
            ${lucene.version}
        
        
        
            org.apache.lucene
            lucene-codecs
            ${lucene.version}
            test
        
        
        
            org.apache.lucene
            lucene-expressions
            ${lucene.version}
        
        
        
            org.apache.lucene
            lucene-demo
            ${lucene.version}
        
        
        
            org.apache.lucene
            lucene-analyzers
            3.6.2
        
        
        
            org.mongodb
            mongo-java-driver
            3.6.3
        
        
        
        
            com.github.miemiedev
            mybatis-paginator
            1.2.17
        

        
        
            com.alibaba
            druid
            1.1.9
        
        
        
            org.mybatis
            mybatis-spring
            1.3.2
        

        
        
            org.aspectj
            aspectjweaver
            1.9.1
        
        
        
            org.mybatis
            mybatis
            3.4.6
        

    



你可能感兴趣的:(maven nexus私服配置)