我尝试将 docker 映像推送到我的私有 Nexus 3 注册表。
在推送之前,我尝试进行身份验证: docker login nexus_host:nexus_port
但我收到以下错误消息:
来自守护进程的错误响应:登录尝试 http:// nexus_host : nexus_port /v2/ 失败,状态:404 Not Found
我的 Nexus 使用 HTTP,因此将其添加到 docker insecure 注册表列表中。
编辑(08/03/2018):
我使用托管的 docker 存储库。我应该使用 HTTP 连接器吗?
回购配置:
格式:docker
类型:托管
URL:http : //192.168.0.90 :8082/repository/docker - repo/
HTTP 连接器端口:1111
登录尝试:
docker login 192.168.0.90:8082
=> 来自守护进程的错误响应:登录尝试http://192.168.0.90:8082/v2/失败,状态:404 Not Found
docker login 192.168.0.90:1111
=> 来自守护进程的错误响应:获取https://192.168.0.90:1111/v2/:拨号 tcp 192.168.0.90:1111:getsockopt:连接被拒绝
我正在尝试com.bar.baz:mapping:0.0.1-SNAPSHOT
使用Gradle从Nexus服务器复制最新的jar文件()。
使用以下build.gradle可以下载特定版本:
apply plugin: "java"
repositories {
maven {
credentials {
username = "${mavenUser}"
password = "${mavenPassword}"
}
url "https://nexus.cluster.foo.cloud/repository/maven-snapshots"
authentication {
basic(BasicAuthentication)
}
}
}
configurations {
copyConf
}
dependencies {
copyConf group: "com.bar.baz", name: "mapping", version: "0.0.1-20190508.085532-7"
}
task copyTask(type: Copy) {
from configurations.copyConf
into "."
}
Run Code Online (Sandbox Code Playgroud)
但是我想下载最新0.0.1-SNAPSHOT
版本,而不是特定0.0.1-20190508.085532-7
版本。那可能吗?怎么样?
使用version "latest.integration"
而不是"0.0.1-20190508.085532-7"
(并调用gradle copyTask --refresh-dependencies --stacktrace
)会产生:
FAILURE: Build failed with an exception.
* What went wrong: Could not resolve all …
Run Code Online (Sandbox Code Playgroud) 我正在使用maven 2.2和nexus 1.4.0
假设我有一个像这样的pom结构(带有相应的版本)
parentproj, v1.0.1
- childproj1, v1.0.2
- childproj2, v1.0.7
Run Code Online (Sandbox Code Playgroud)
childproj1和childproj2代表应用程序的不同部分(例如gui和backend),我希望能够将它们的版本分开,这样我就可以发布新版本的后端而无需发布新版本的gui.
现在,要将此结构部署到Nexus,可以方便地转到parentproj并说
mvn deploy -DperformRelease = true
这会将所有工件部署到Nexus realease存储库.我第一次部署它时工作正常,但第二次遇到问题:让我说我对childproj1进行了更新,以便我们现在有以下版本:
parentproj, v1.0.1
- childproj1, v1.0.3
- childproj2, v1.0.7
Run Code Online (Sandbox Code Playgroud)
在这种情况下,Nexus不会让我从parentproj进行mvn部署,因为它已经在1.0.7版本中有了一个childproj2的副本.Nexus会说"资源,非法请求:ID ='版本'的存储库不允许更新工件." 这很好,我不想错误地更新现有版本.
但我想我想要做的就是能够告诉maven类似于"仅部署那些版本尚未存在于版本库中的工件".
有没有办法做到这一点,还是我必须自己部署每个项目?
我最近将一些maven工件直接下载到我的本地存储库(.m2/repository).现在我安装了Nexus Repository Manager,需要填充其存储空间,而无需再次下载所有工件.有没有办法用本地存储库更新Nexus存储库.我不想简单地复制它们,因为Nexus将有关其公共服务器(中央,代码等)的文件与本地存储库结构分开.
更新:同时我将工件从本地存储库复制到Nexus存储(公共存储库).我可以通过Nexus webapp浏览工件,但是Maven无法解决Nexus的工件问题.我需要特别注册吗?我重新编制了公共存储库的索引并多次重启Nexus - 没有任何更改.
当我部署jar时,maven总是在其文件名中添加日期,这使得文件名存储库与本地文件不同.如何删除文件名中的日期?
谢谢
我使用Maven 3.0.4和Nexus 2.0.6.我已将settings.xml设置为使用单个存储库的Nexus指令.当maven尝试运行maven -U clean时,我收到以下错误.
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its d
ependencies could not be resolved: Failed to read artifact descriptor for org.ap
ache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not find artifact org.apa
che.maven.plugins:maven-clean-plugin:pom:2.4.1 in nexus (http://localhost:8081/n
exus/content/groups/public) -> [Help 1]
Run Code Online (Sandbox Code Playgroud)
如果我从设置中删除nexus镜像并直接进入maven central命令有效.nexus中maven repo的设置显示它正在服务中,并且它位于公共组(最后列出)中.
我不是支持访问互联网的代理人.
这是我的settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="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.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<offline>false</offline>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct …
Run Code Online (Sandbox Code Playgroud) 我的Maven配置有一个小问题.这里的所有其他问题和答案都没有解决我的问题,所以我开始一个新的问题.
我的问题是,我的Maven没有使用本地存储库.它总是从远程存储库中获取工件.
下载工件或构建项目时,它安装在本地存储库中,因此路径是正确的.
问题是:当我构建一个SNAPSHOT项目时,它只安装在本地存储库中(应该是这样,不希望每次都在我的nexus上发布它).当我在pom.xml中构建另一个具有前一个项目作为依赖项的项目时,maven想要从nexus服务器下载它没有找到它的工件,而不是从本地存储库中获取它.
这是我的maven配置:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="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.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>C:\Users\Marc\.m2\repository</localRepository>
<interactiveMode>false</interactiveMode>
<usePluginRegistry>false</usePluginRegistry>
<pluginGroups>
</pluginGroups>
<servers>
<server>
<id>releases</id>
<username>MY_USERNAME</username>
<password>MY_PASSWORD</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
</server>
<server>
<id>snapshots</id>
<username>MY_USERNAME</username>
<password>MY_PASSWORD</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
</server>
<server>
<id>nexus</id>
<username>MY_USERNAME</username>
<password>MY_PASSWORD</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
</server>
</servers>
<profiles>
<profile>
<id>nexussrv</id>
<repositories>
<repository>
<id>snapshots</id>
<url>http://nexus/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>releases</id>
<url>http://nexus/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>nexus</id>
<url>http://nexus/content/groups/public</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexussrv</activeProfile>
</activeProfiles>
</settings>
Run Code Online (Sandbox Code Playgroud)
从nexus和发布工件(SNAPSHOT和RELEASE)下载到nexus使用此配置,但它不使用本地存储库中的工件.
谢谢你的帮助!
我使用Nexus 3,我想删除旧版本.在Nexus 2中,有一个名为的计划任务Remove Releases From Repository
.似乎Nexus 3中缺少此任务.
我们如何从Nexus 3中删除旧版本?
谢谢
我正在尝试通过注册表安装我的Ionic App及其依赖项.我尝试实现这一点,npm i --loglevel verbose
而我~/.npmrc
看起来像这样:
//nexus.OMMITED.com/repository/:_auth=OMMITED
registry=http://nexus.OMMITED.com/repository/npm-all
always-auth=true
Run Code Online (Sandbox Code Playgroud)
在观看命令运行时,它看起来很好,直到我们遇到其他非注册表依赖项,突然我遇到了授权错误.
这是命令的粘贴:https://hasteb.in/hejigopo.sql
正如你所看到的那样@angular/http@6.1.2
在这个实例中失败了,但这个变量在随机@angular
依赖之间或者@ionic-native
到目前为止我尝试过的...
always-auth
到true
或false
_authToken
而不是_auth
npm login --registry=http://nexus.OMMITED.com/repository/npm-all
既--auth=TOKEN_OMITTED
与--authToken=TOKEN_OMITTED
地方NPM告诉我npm WARN invalid config auth-type="TOKEN_OMITTED"
,并提示输入用户名,我的用户名不过是引发此错误的电子邮件地址:npm WARN Name may not contain non-url-safe chars
只保留无限提示另一个用户名.我已经部署了一个 Nexus OSS 的本地实例,它是在 Nginx 反向代理后面到达的。
在任何将 docker 映像推送到在 Nexus 注册表上创建的存储库的尝试时,我413 Request Entity Too Large
都在推送过程中遇到
了 。
nginx.conf 文件看起来像这样:
http {
client_max_body_size 0;
upstream nexus_docker {
server nexus:1800;
}
server {
server_name nexus.services.loc;
location / {
proxy_pass http://nexus_docker/;
proxy_set_header Host $http_post;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
Run Code Online (Sandbox Code Playgroud)
nginx 是使用 docker 部署的,我已经使用docker login
. 我尝试了多个其他标志,例如 chunkin 等。但似乎没有任何效果。
nexus ×10
maven ×5
deployment ×3
docker ×2
java ×2
angular ×1
build.gradle ×1
gradle ×1
javascript ×1
maven-2 ×1
nexus3 ×1
nginx ×1
npm ×1