构建仓库与包管理

一、构建仓库

1、nexus安装

brew安装方式(比较慢)

brew install nexus

官网下载安装方式

sonatype官网下载,比如MacOS的,下载完成之后cd到bin目录即可看到启动命令

启动

# 2.0版本
brew services start nexus
# 3.0版本
/usr/local/Cellar/nexus/3.38.1-01/libexec/bin/nexus

停止(对nexus执行stop命令,或者关闭服务终端)

/usr/local/Cellar/nexus/3.29.0-02/bin/nexus stop

网页路径与默认账号密码

http://127.0.0.1:8083 	admin/admin123 admin/123456

brew安装nexus路径

/usr/local/Cellar/nexus

修改端口号

打开config配置文件,修改这里application-port=8081(约19行)

/usr/local/Cellar/nexus/2.14.18-01/libexec/conf/nexus.properties

2、artifactory安装

安装软件与教程下载

网页路径与默认账号密码

http://localhost:8083/artifactory	admin/password

2,下载文件路径

/你的安装地址/artifactory-pro-6.6.0/backup/backup-daily/current/repositories

3,tomcat配置文件

/你的安装地址/artifactory-pro-6.6.0/tomcat/conf/server.xml

4,localhost启动与停止

cd /你的安装地址/artifactory/artifactory_pro/artifactory_pro_and_crack/artifactory-pro-6.6.0/bin/

启动

./artifactory.sh start

关闭

./artifactory.sh stop

3、仓库使用

gradle单个文件

distributionUrl=http\://192.168.174.175:8083/artifactory/android_local/gradle-6.0.1-all.zip

maven使用

maven{
    url 'http://localhost:8083/artifactory/android_group'
}

二、npm

1、npm

查看一下当前源

npm config get registry

切换为淘宝源

npm config set registry https://registry.npm.taobao.org/

切换本地源

npm config set registry http://localhost:8083/artifactory/api/npm/npm_group/

还原仓库地址

npm config set registry https://registry.npmjs.org/

清空当前缓存

npm cache clean -f

2、yarn

查看一下当前源

yarn config get registry

切换为淘宝源

yarn config set registry https://registry.npm.taobao.org

切换本地源

yarn config set registry http://localhost:8083/artifactory/api/npm/yarn_group/

还原仓库地址

yarn config set registry https://registry.yarnpkg.com

清空当前缓存

yarn cache clean

三、tomcat

运行 tomcat 比较简单,cd 到 bin 目录执行对应脚本即可

cd /Users/你的用户名/Library/ApacheTomcat/bin
./startup.sh
./shutdown.sh

1、下载 Tomcat

点击官网下载,mac 电脑选择 tar.gz 或者 zip 包下图:

image-20231027175724715

添加tomcat 可执行权限

chmod +x shutdown.sh
chmod +x catalina.sh 
chmod +x startup.sh

2、安装tomcat权限报错

如果tomcat报错如下

By default the Manager is only accessible from a browser running on the same

找到你当前的tomcat目录,进入webapps/manager/META-INF目录,可以看到 context.xml 这个文件,进去注释掉

image-20220127202810611

然后cd到bin目录重启tomcat即可

./shutdown.sh
./startup.sh

3、修改tomcat密码

/conf/tomact_user.xml

后面附加

<role rolename="manager"/>  
<role rolename="manager-gui"/>  
<role rolename="admin"/>  
<role rolename="admin-gui"/>  
<role rolename="manager-script"/>  
<role rolename="manager-jmx"/>  
<role rolename="manager-status"/>  
<user username="admin" password="000000" roles="admin-gui,admin,manager-gui,manager,manager-script,manager-jmx,manager-status"/> 

4、静态资源不可访问报错

image-20231027181253671

考虑修改/conf/web.xml文件,这个文件是配置 tomcat 应用的,且比较大,找个正确的替换上。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

流星雨在线

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值