maven 服务搭建和使用
来源:互联网 发布:手机听歌软件 编辑:程序博客网 时间:2024/05/22 09:48
1.maven简介
现在业界基本都会使用maven管理项目,可编译打包,单元测试等等;会用Nexus来做私服。
为自己的团队搭建属于自己的maven私服,这样既节省了网络带宽也会加速项目搭建。
2、Nexus下载
下载地址:http://www.sonatype.org/nexus/go
3.安装配置 Nexus
> 上传包 nexus-2.9.1-02-bundle.zip 到服务器上。
> 解压 : unzip nexus-2.9.1-02-bundle.zip
> 启动 :如下操作
注:报错是指没有指定用户,需修改 nexus 脚本 > vi nexus 后找到 RUN_AS_USER 属性,做如下修改:
> 再启动
即可访问 http://localhost:8081/nexus/
注:
localhost 指安装机器 IP
默认登录用户 admin/admin123
配置
> 进入nexus系统,点击左侧 Repositories
> 选中三项中的Configuration中的Download Remote indexs修改为true
> 选择Repair Index 让Nexus远程下载索引文件。
> 将3rd party 的Configuration中的Deploment Policy修改为Allow Redeploy:
如上 私服基本配置完成。
4 需要下载 apache-maven-3.0.4-bin.zip 解压,配置环境变量。 M2_HOME
需要path 增加 %M2_HOME%/bin
确认maven 是否可用: mvn -version
配置maven 的settings.xml文件:
settings.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <settings xmlns="<a target=_blank href="http://maven.apache.org/SETTINGS/1.0.0">http://maven.apache.org/SETTINGS/1.0.0</a>" xmlns:xsi="<a target=_blank href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"
- xsi:schemaLocation="<a target=_blank href="http://maven.apache.org/SETTINGS/1.0.0">http://maven.apache.org/SETTINGS/1.0.0</a> <a target=_blank href="http://maven.apache.org/xsd/settings-1.0.0.xsd">http://maven.apache.org/xsd/settings-1.0.0.xsd</a>">
- <localRepository>f:/.m2/repository</localRepository>
- <profiles>
- <profile>
- <id>DefaultProfile</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <repositories>
- <repository>
- <id>nexus</id>
- <name>nexus</name>
- <url><span style="color:#ff6666;">http://10.10.113.195:8081/nexus/content/groups/public</span></url>
- <layout>default</layout>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>maven2-repository.dev.java.net</id>
- <name>Java.net Repository for Maven</name>
- <url>http://download.java.net/maven/2/</url>
- <layout>default</layout>
- </repository>
- </repositories>
- </profile>
- </profiles>
- <servers>
- <server>
- <id>nexus-releases</id>
- <username>admin</username>
- <password>admin123</password>
- </server>
- <server>
- <id>nexus-snapshots</id>
- <username>admin</username>
- <password>admin123</password>
- </server>
- <server>
- <id>nexus-3dparty</id>
- <username>admin</username>
- <password>admin123</password>
- </server>
- </servers>
- <activeProfiles>
- <activeProfile>nexus</activeProfile>
- </activeProfiles>
- </settings>
红色字体为maven仓库路径。
> JAVA IDE 中需要引用maven 配置
注:IDE需要maven插件,资源中已上传。
一个maven 工程,非常简单的springMVC 工程,资源中存放,请参考。
- maven 服务搭建和使用
- maven 服务搭建和使用
- svn服务搭建和使用
- Redis服务搭建和使用
- Maven 和 Maven搭建
- maven环境的搭建和使用
- maven私服搭建和使用
- maven私服nexus3搭建和使用
- maven私服搭建和使用
- 使用graphite和cabot搭建监控服务
- 使用CXF和spring搭建webService服务
- SVN服务的搭建和使用
- maven搭建 maven安装和myeclipse的集成使用
- 【maven基础】maven私服搭建和使用
- maven搭建Dubbo框架服务
- 使用Maven搭建SpringMVC
- 使用Maven搭建SpringMVC
- 使用Maven搭建ssm
- 软件需求说明书
- linux dll hell--链接库real name, soname, link name
- MongoDB高级查询用法大全 - 程序猿_哲
- 2015.03.11 vim操作+特殊权限
- 常量折叠问题
- maven 服务搭建和使用
- 在RHEL6.0 X64系统中安装oracle 11g数据库及安装后设置
- Flume把网络流量存入日志文件
- Hbase 常用工具类
- BB平台oracle11g-180天密码过期问题处理
- 《一直以来伴随我的一些学习习惯》的记录
- Hadoop、Spark、HBase与Redis的适用性讨论
- android handler消息机制
- Red Hat搭建邮件服务器(sendmail+dovecot+openwebmail+procmail)