Nexus 初步使用
来源:互联网 发布:淘宝红号查询 编辑:程序博客网 时间:2024/04/20 08:35
1.创建公共maven项目,管理所有依赖;继而创建所有开发子项目。
2.配置所有构建均从私服下载,在~/.m2/setting.xml中配置如下:
# 监控拦截所有请求 <mirror> <id>mynexus</id> <mirrorOf>*</mirrorOf> <url>http://localhost:8081/nexus/content/groups/public</url> </mirror> <profile> <id>mynexus</id> <!--Override the repository (and pluginRepository) "central" from the Maven Super POM --> <repositories> <repository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> # 激活配置 <activeProfiles> <!--make the profile active all the time --> <activeProfile>mynexus</activeProfile> </activeProfiles> # 设置部署使用用户 <server> <id>releases</id> <username>username1</username> <password>password1</password> </server>
3.部署构建到Nexus,包含Release和Snapshot, 在项目根目录中pom.xml中配置:
# 配置部署分发器 <distributionManagement> <repository> <id>releases</id> <name>Internal Releases</name> <url>http://localhost:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>snapshots</id> <name>Internal Snapshots</name> <url>http://localhost:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>
4.运行deploy Goal。
(启动Nexus:./nexus start 默认浏览器访问地址:http://localhost:8081/nexus)
以下时web maven项目自动部署及运行pom配置:
# 自动部署并运行webapp项目到tomcat <build> <finalName>webapp</finalName> <plugins> <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <version>1.2.3</version> <configuration> <container> <containerId>tomcat7x</containerId> <home>/opt/apache-tomcat-7.0.63</home> </container> <configuration> <type>existing</type> <home>/opt/apache-tomcat-7.0.63</home> </configuration> </configuration> <executions> <execution> <id>cargo-run</id> <phase>install</phase> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
官网
0 0
- Nexus 初步使用
- 使用nexus
- 使用SQL Nexus整合----熟悉SQL Nexus
- 使用SQL Nexus整合----定制SQL Nexus
- 使用SQL Nexus整合----熟悉SQL Nexus
- nexus 使用Nexus搭建Maven私服
- nexus安装使用
- 本地nexus的使用
- Nexus 安装与使用
- 配置maven使用nexus
- nexus 创建和使用
- Maven配置使用Nexus
- Nexus 搭建 使用
- maven-03-nexus使用
- Nexus搭建和使用
- Nexus 使用与集成
- 【笔记】Nexus的使用
- centos中nexus私服的搭建(初步)
- 1TB等于多少G 1TB是多大?
- GDB调试程序(六)
- 必备的Word软件应用技巧二
- 第一周学习日志
- GDB调试程序(七)
- Nexus 初步使用
- HDU 5365-Run(几何)
- 珠排序
- 模版方法
- ALV OO:单击事件-双击事件-自定义按钮事件(示例)
- HDU2.2.1 Fibonacci
- 在Activity的oncreate方法中如果跳转到别的activity,会发生什么
- 在Word中选择多个自选图形对象
- NYOJ--40--公约数和公倍数