Maven搭建本地仓库

发布时间:2020-04-04 22:19:54 作者:厦小岗
来源:网络 阅读:748


 大数据交流群: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<mirrors>  

      <mirror>

<id>nexus-osc</id>      

<mirrorOf>central</mirrorOf>  

<name>Nexus osc</name>        

<url>http://192.168.92.1:8080/content/groups/public/</url>   

    </mirror>

    <mirror>     

<id>nexus-osc-thirdparty</id>    

<mirrorOf>thirdparty</mirrorOf>   

<name>Nexus osc thirdparty</name>      

<url>http://192.168.92.1:8080/content/repositories/thirdparty/</url>   

    </mirror>

 </mirrors>

 

2<profile>

      <id>env-dev</id>

 

      <activation>

        <property>

          <name>target-env</name>

          <value>dev</value>

        </property>

      </activation>

 

      <properties>

        <tomcatPath>/path/to/tomcat/instance</tomcatPath>

      </properties>

    </profile>

    -->

<profile>

 

  <id>jdk-1.4</id>

    <activation>

        <jdk>1.4</jdk>

    </activation>

    <repositories>

        <repository>

            <id>nexus</id>

            <name>local private nexus</name>

            <url>http://192.168.92.1:8080/content/groups/public/</url>

            <releases>

                <enabled>true</enabled>

            </releases>

            <snapshots>

                <enabled>false</enabled>

            </snapshots>

        </repository>

    </repositories>

    <pluginRepositories>

        <pluginRepository>

            <id>nexus</id>

            <name>local private nexus</name>

            <url>http://192.168.92.1:8080/content/groups/public/</url>

            <releases>

                <enabled>true</enabled>

            </releases>

            <snapshots>

                <enabled>false</enabled>

            </snapshots>

        </pluginRepository>

    </pluginRepositories>

</profile>

  </profiles>

 

(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里的路径)

同上!


推荐阅读:
  1. Maven安装本地jar到本地仓库
  2. maven上传本地仓库

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

maven 搭建本地

上一篇:postgres的增量恢复

下一篇:jquery实现表单form异步提交

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》