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 ... dparty/</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使用win7的maven本地仓库服务器
---------------------------------------------------
1.编辑/soft/maven/conf/settings.xml
进入C:\downloads\myprograms\apache-maven-3.3.9\conf把settings.xml文件全部覆盖复制给ubuntu里的settings.xml(/soft/maven/conf/settings.xml-----》ubuntu里的路径)
同上!
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com