大数据交流群:494721467

Maven搭建本地仓库:

1、下载所需软件:

Nexus-2 .9.0.war

JDK1 1.6

apache-tomcat-9.0.0.M1.tar.gz

 

2、安装tomcat :tar -xzvf tar -xzvf apache-tomcat-9.0.0.M1.tar.后将它移到/soft/的目录下

 

3、移动nexus.war${tomact_home}/webapps/即执行:mv nexus.war /soft/tomcat/webapps

 

4、启动tomcat~的目录下启动:ubuntu@s1:~$ /soft/tomcat/bin/startup.sh

 

5、进入web页面查看它有没有成功即登录s1:8080

 

在宿主机上安装maven本地仓库服务器:

1、下载所需要软件:jdk.6 apache-tomact-7.0.63-windows-x86_64.zipnexus-2.9.0.war

 

2、加压apache-tomact-7.0.63-windows-x86_64.zipnexus-2.9.0.war

到:/myproram/(我建的目录),接下来把nexus.war拷贝到C:\downloads\myprograms\apache-tomcat-7.0.63\webapps(我的myproram目录)。然后到C:\downloads\myprograms\apache-tomcat-7.0.63\bin目录下打开startup.bat

 

8、建一个本地仓库文件目录 maveh-repo

 

9、修改默认的仓库目录进入:C:\downloads\myprograms\apache-tomcat-7.0.63\webapps\nexus\WEB-INF\classes修改:nexus.properties文件,下面是我修改的路径。

 

# WAR specific configuration requirements

#nexus-work=${user.home}/sonatype-work/nexus

nexus-work=e:/maven-repo/nexus//修改

runtime=${bundleBasedir}

nexus-app=${runtime}

 

10、配置maven使用本地仓库服务器。进入到maven所在的目录下,(我的是在/soft/)即:/soft/maven/conf修改settings.xml配置文件如下:

1  

      

nexus-osc      

central  

Nexus osc        

http://192.168.92.1:8080/content/groups/public/   

    

         

nexus-osc-thirdparty    

thirdparty   

Nexus osc thirdparty      

http://192.168.92.1:8080/content/repositories/thirdparty/   

    

 

 

2

      env-dev

 

      

        

          target-env

          dev

        

      

 

      

        /path/to/tomcat/instance

      

    

    -->

 

  jdk-1.4

    

        1.4

    

    

        

            nexus

            local private nexus

            http://192.168.92.1:8080/content/groups/public/

            

                true

            

            

                false

            

        

    

    

        

            nexus

            local private nexus

            http://192.168.92.1:8080/content/groups/public/

            

                true

            

            

                false

            

        

    

  

 

(192.168.92.1是我本机的ip地址)

 

11

启动本地仓库服务器

$>c:/myprograms/apache-tomcat-xxx/bin/startup.sh

 

12、登录web管理界面

http://192.168.92.1:8080/nexus/

 

13、配置ubuntu下的maven使用win7maven本地仓库服务器

---------------------------------------------------

1.编辑/soft/maven/conf/settings.xml

进入C:\downloads\myprograms\apache-maven-3.3.9\confsettings.xml文件全部覆盖复制给ubuntu里的settings.xml/soft/maven/conf/settings.xml-----ubuntu里的路径)

同上!