溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Maven搭建本地倉庫

發布時間:2020-04-04 22:19:54 來源:網絡 閱讀:786 作者:廈小崗 欄目:開發技術


 大數據交流群: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.zip、nexus-2.9.0.war

 

2、加壓apache-tomact-7.0.63-windows-x86_64.zip、nexus-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里的路徑)

同上!


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女