首页 文章 精选 留言 我的

精选列表

搜索[Linux漏洞],共10000篇文章
优秀的个人博客,低调大师

linux学习:持续集成篇--Maven私有库和本地库的安装与配置-03

如果构建的Maven 项目本地仓库没有对应的依赖包,那么就会去Nexus 私服去下载,那么如果Nexus 私服也没有此依赖包,就回去远程中央仓库下载依赖,Nexus 私服下载成功后再下载至本地Maven 库供项目引用。 maven私服器Sonatype Nexus的安装与配置 1、安装 1.1下载 Nexus(这里使用的是:nexus-2.11.2-03-bundle.tar.gz) http://www.sonatype.org/nexus/go/ 1.2解压:因为解压后有两个文件夹,所以这里新建了一个nexus文件夹 [root@localhostopt]#mkdirnexus [root@localhostopt]#tar-zxvf/opt/tar/nexus-2.11.2-03-bundle.tar.gz-C/opt/nexus/ [root@localhostopt]#cdnexus/ [root@localhostnexus]#ls nexus-2.11.2-03sonatype-work [root@localhostnexus]# (一个 nexus 服务,一个私有库目录) 1.3编辑 Nexus 的 nexus.properties 文件,配置端口和 work 目录信息(保留默认) [root@localhost conf]# cat nexus.properties #Jettysection application-port=8081 application-host=0.0.0.0 nexus-webapp=${bundleBasedir}/nexus nexus-webapp-context-path=/nexus #Nexussection nexus-work=${bundleBasedir}/../sonatype-work/nexus runtime=${bundleBasedir}/nexus/WEB-INF 1.4编辑 nexus 脚本 vi/opt/nexus/nexus-2.11.2-03/bin/nexus #改成root RUN_AS_USER=root 1.5启动 /opt/nexus/nexus-2.11.2-03/bin/nexusstart 1.6访问:http://192.168.175.9:8081/nexus 1.7登录,默认用户名 admin,默认密码 admin123 到此,Nexus 已安装完成,接下来是 Nexus 的配置 2、配置(登录后) 2.1 菜单 Administration/Server 配置邮箱服务地址(如果忘记密码,可以通过该邮箱找回密码) 测试邮箱: 给用户配置邮箱地址,方便忘记密码时找回: 2.2 修改密码 2.3 仓库 group仓库组: Nexus 通过仓库组的概念统一管理多个仓库,这样我们在项目中直接请求仓库组即可请求到仓库组管理的多个仓库 hosted宿主仓库: 主要用于发布内部项目构件或第三方的项目构件(如购买商业的构件)以及无法从公共仓库获取的构件(如 oracle 的 JDBC 驱动) proxy代理仓库: 代理公共的远程仓库; virtual虚拟仓库: 用于适配 Maven 1; 一般用到的仓库种类是 hosted、proxy。 Hosted仓库常用类型说明: releases:内部的模块中 release 模块的发布仓库 snapshots:发布内部的 SNAPSHOT 模块的仓库 3rd party:第三方依赖的仓库,这个数据通常是由内部人员自行下载之后发布上去 如果构建的Maven项目本地仓库没有对应的依赖包,那么就会去Nexus私服去下载,如果Nexus私服也没有此依赖包,就回去远程中央仓库下载依赖,这些中央仓库就是proxy 。Nexus私服下载成功后再下载至本地Maven库供项目引用。 设置proxy代理仓库(Apache Snapshots/Central/Codehaus Snapshots)准许远程下载: 注意:这里3个proxy都设置 setting.xml配置: <?xmlversion="1.0"encoding="UTF-8"?> <settingsxmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository>G:\workspace\maven_space</localRepository> <interactiveMode>true</interactiveMode> <offline>false</offline> <pluginGroups> </pluginGroups> <!--配置权限,使用默认用户--> <servers> <server> <id>nexus-releases</id> <username>deployment</username> <password>deployment123</password> </server> <server> <id>nexus-snapshots</id> <username>deployment</username> <password>deployment123</password> </server> </servers> <mirrors> </mirrors> <profiles> <profile> <id>edu</id> <activation> <activeByDefault>false</activeByDefault> <jdk>1.6</jdk> </activation> <repositories> <!--私有库地址 仓库组 --> <repository> <id>nexus</id> <url>http://192.168.175.9:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <!--插件库地址--> <pluginRepository> <id>nexus</id> <url>http://192.168.175.9:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <!--激活profile--> <activeProfiles> <activeProfile>edu</activeProfile> </activeProfiles> </settings> 项目的构建与发布:pom.xml <distributionManagement> <repository> <id>nexus-releases</id> <name>NexusReleaseRepository</name> <url>http://192.168.175.9:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>NexusSnapshotRepository</name> <url>http://192.168.175.9:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement> 发布到私有库: pom:<version>1.0-SNAPSHOT</version> pom:<version>1.0-RELEASES</version> 4、上传第三方jar,如:demo.jar 配置其开机启动 1、负责nexus到/etc/init.d下 cp/opt/nexus/nexus-2.11.2-03/bin/nexus/etc/init.d/nexus 2、修改nexus [root@localhost~]#vi/etc/init.d/nexus NEXUS_HOME="/opt/nexus/nexus-2.11.2-03/" 3、修改wrapper.conf [root@localhost~]#vi/opt/nexus/nexus-2.11.2-03/bin/jsw/conf/wrapper.conf wrapper.java.command=/home/jdk1.7.0_71/bin/java 4、添加脚本的可执行权限 chmod755/etc/init.d/nexus 5、添加为系统服务 chkconfig--addnexus

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册
修改密码
忘记密码