网站赞赏,重庆seo代理价格,免费特效模板下载,建设部网站查资质中裕隆1.nexus
Nexus Repository Manager#xff08;通常简称 Nexus 或 Nexus RM#xff09;是由Sonatype公司开发的一款开源的、强大的软件仓库管理工具#xff0c;主要用于企业级的二进制组件#xff08;如Java库、Node.js模块、Python包等#xff09;存储、管理和分发。 官方…1.nexus
Nexus Repository Manager通常简称 Nexus 或 Nexus RM是由Sonatype公司开发的一款开源的、强大的软件仓库管理工具主要用于企业级的二进制组件如Java库、Node.js模块、Python包等存储、管理和分发。 官方文档:https://help.sonatype.com/index.html?langen
2.安装
下载地址:https://help.sonatype.com/en/download.html 如果不能下载的话可以用百度网盘下载 链接https://pan.baidu.com/s/1zK3qnO47gfgn9MFxbrUrBA 提取码6fiq 参考连接:https://blog.csdn.net/u012581020/article/details/130812447
笔者官方没有下载成功源码打包ui报错也没有成功
将下载的包上传到服务器执行命令:
#将nexus 解压到/usr/local/ 目录
tar -zxvf nexus-3.54.1-01-unix.tar.gz -C /usr/local/
#创建nexus用户
useradd nexus
#更改/usr/local/目录的所有者未nexus
chown -R nexus:nexus /usr/local/nexus-3.54.1-01jdk安装
#搜索jdk
yum search openjdk
#安装需要的jdk版本
yum install java-1.8.0-openjdk.x86_64
#安装成功查看jdk版本
java -version3.运行
查看系统要求:https://help.sonatype.com/en/sonatype-nexus-repository-system-requirements.html#instance-resource-sizing-profiles
#切换用户 nexus
su - nexus
#进入到安装目录
cd /usr/local/nexus-3.54.1-01
#后台启动 nexus相关命令:{start|stop|run|run-redirect|status|restart|force-reload}
./bin/nexus start
# 运行关闭窗口程序停止运行调试的时候使用
./bin/nexus run
#停止
./bin/nexus stopnexus 配置文件 etc/nexus-default.properties
application-port8081
application-host0.0.0.0
nexus-args${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml
nexus-context-path/# Nexus section
nexus-editionnexus-pro-edition
nexus-features\nexus-pro-featurenexus.hazelcast.discovery.isEnabledtrue
nexus jvm配置文件: bin/nexus.vmoptions -Xms2703m
-Xmx2703m
-XX:MaxDirectMemorySize2703m
-XX:UnlockDiagnosticVMOptions
-XX:LogVMOutput
-XX:LogFile../sonatype-work/nexus3/log/jvm.log
-XX:-OmitStackTraceInFastThrow
-Djava.net.preferIPv4Stacktrue
-Dkaraf.home.
-Dkaraf.base.
-Dkaraf.etcetc/karaf
-Djava.util.logging.config.fileetc/karaf/java.util.logging.properties
-Dkaraf.data../sonatype-work/nexus3
-Dkaraf.log../sonatype-work/nexus3/log
-Djava.io.tmpdir../sonatype-work/nexus3/tmp
-Dkaraf.startLocalConsolefalse
-Djdk.tls.ephemeralDHKeySize2048
4.nexus 配置
nexus 启动以后访问web管理页面 http://ip:8081 点击右上角登录,弹出登录框显示admin默认密码路径:/usr/local/sonatype-work/nexus3/admin.password
登录成功,根据向导设置 修改密码以后设置匿名访问 启用匿名访问意味着默认情况下用户可以在没有凭据的情况下从存储库搜索、浏览和下载组件。请考虑对您的组织的安全影响。
禁用匿名访问应该谨慎选择因为它需要所有用户和/或构建工具的凭据。
允许仓库部署和更新:
5.maven上传jar到nexus
本地settings.xml配置:
?xml version1.0 encodingUTF-8?
settings xmlnshttp://maven.apache.org/SETTINGS/1.0.0xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd!-- localRepository| The path to the local repository maven will use to store artifacts.|| Default: ${user.home}/.m2/repositorylocalRepository/path/to/local/repo/localRepository--!--修改成本地的存储路径 --localRepository${user.home}/.m3/repository/localRepositorypluginGroups!-- pluginGroup| Specifies a further group identifier to use for plugin lookup.pluginGroupcom.your.plugins/pluginGroup--/pluginGroups!-- proxies| This is a list of proxies which can be used on this machine to connect to the network.| Unless otherwise specified (by system property or command-line switch), the first proxy| specification in this list marked as active will be used.|--proxies/proxiesservers!-- 配置发布到 Release 仓库的凭据 --serveridnexus-releases/idusernameadmin/usernamepasswordadmin123/password/server!-- 配置发布到 Snapshot 仓库的凭据如果适用--serveridnexus-snapshots/idusernameadmin/usernamepasswordadmin123/password/server/servers!-- 仓库地址列表 用于从远程存储库下载文件--mirrorsmirroridnexus/idmirrorOf*/mirrorOfnamenexus/nameurlhttp://10.10.1.185:8081/repository/maven-public//url/mirror/mirrorsprofilesprofileidnexus/id!--Enable snapshots for the built in central repo to direct --!--all requests to nexus via the mirror --repositoriesrepositoryidcentral/id!-- 根据实际情况填写 例如:http://10.10.1.185:8081/repository/maven-public/--urlhttp://central/urlreleasesenabledtrue/enabled/releasessnapshotsenabledtrue/enabled/snapshots/repository/repositoriespluginRepositoriespluginRepositoryidcentral/id!-- 根据实际情况填写 例如:http://10.10.1.185:8081/repository/maven-public/--urlhttp://central/urlreleasesenabledtrue/enabled/releasessnapshotsenabledtrue/enabled/snapshots/pluginRepository/pluginRepositories/profile/profiles!-- activeProfiles| List of profiles that are active for all builds.|--activeProfilesactiveProfilenexus/activeProfile/activeProfiles/settingsidea maven配置: File-Settings-Maven-
创建maven项目pom.xml新增部署仓库配置:
!-- 指定项目的部署仓库 --distributionManagementrepositoryidnexus-releases/idnameNexus Release Repository/nameurlhttp://10.10.1.185:8081/repository/maven-releases//url/repositorysnapshotRepositoryidnexus-snapshots/idnameNexus Snapshot Repository/nameurlhttp://10.10.1.185:8081/repository/maven-snapshots//url/snapshotRepository/distributionManagement注意id的内容需要和settings.xml配置中的server id一致
上传jar包到nexus 方式一选中项目-》右键-run Maven-deploy
方式二maven命令
mvn clean deploy上传成功: 注意如果版本号是以 SNAPSHOT结尾的如1.0-SNAPSHOT,部署成功jar被部署到maven-snapshots仓库。以其他则部署到maven-releases仓库。 新建maven项目添加最近上传的依赖: dependencygroupIdcn.nexus.demo/groupIdartifactIdnexus-demo-biz2/artifactIdversion3.0.0/version/dependency执行打包命令:
mvn clean package打包成功输出: