nexus php composer host 模式repo 试用
前边有介绍以及运行过基于nexus proxy 模式的php composer(其中也有一些坑),以下是关于host 模式的
简单使用
环境准备
- docker-compose 文件
version: "3"
services:
nexus:
image: jbuncle/nexus-repository-composer
volumes:
- "./nexus-data:/nexus-data"
ports:
- "8081:8081"
- 启动&&配置
这个比较简单docker-compose up -d
- 添加host 模式的php composer
- 一个proxy 模式的composer
简单项目集成
- composer.json 文件
{
"config": {
"secure-http": false
},
"version": "1.0",
"name": "dalongdemo",
"description": "this is a demo composer repo",
"authors": [{
"name": "dalong",
"email": "1141591465@qq.com"
}],
"require": {
"monolog/monolog": "1.0.*",
"pugx/shortid-php":"v0.5.1"
},
"repositories": {
"packagist": {
"type": "composer",
"url": "http://localhost:8081/repository/demo/"
}
}
}
- 归档composer包
composer archive --format=zip
- 上传composer包
curl -v --user 'user:password' --upload-file dalongdemo-1.0.tar http://localhost:8081/repository/myhost-composer/packages/upload/dalongrong/dalongdemo/1.0
- 效果
引用发布的软件包
- 创建group 类型composer
- demo composer 项目
{
"config": {
"secure-http": false
},
"name": "dalong/dalong",
"authors": [
{
"name": "rongfengliang",
"email": "1141591465@qq.com"
}
],
"repositories": [
{
"type": "composer",
"url": "http://localhost:8081/repository/myphp-group/"
},
{
"packagist.org": false
}
],
"require": {
"dalongrong/dalongdemo":"1.0"
}
}
- 安装依赖
composer install --no-dev
Loading composer repositories with package information
Warning: Accessing localhost over http which is an insecure protocol.
Updating dependencies
Package operations: 8 installs, 0 updates, 0 removals
- Installing symfony/polyfill-mbstring (v1.12.0): Downloading (100%)
- Installing paragonie/random_compat (v2.0.18): Downloading (100%)
- Installing paragonie/sodium_compat (v1.12.1): Downloading (100%)
- Installing ircmaxell/security-lib (v1.1.0): Downloading (100%)
- Installing paragonie/random-lib (v2.0.0): Downloading (100%)
- Installing pugx/shortid-php (v0.5.1): Downloading (100%)
- Installing monolog/monolog (1.0.2): Downloading (100%)
- Installing dalongrong/dalongdemo (1.0): Downloading (100%)
Writing lock file
Generating autoload files
参考资料
https://github.com/sonatype-nexus-community/nexus-repository-composer
https://getcomposer.org/doc/03-cli.md#archive
https://github.com/rongfengliang/nexus-composer-learning
https://www.cnblogs.com/rongfengliang/p/11931524.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2018-11-26 Modern Data Lake with Minio : Part 2
2018-11-26 Modern Data Lake with Minio : Part 1
2018-11-26 使用rclone 进行minio 文件同步