简体   繁体   English

在 Nexus 存储库中找不到工件(快照)

[英]Could not find artifact (snapshot) in Nexus repository

I installed the Nexus repository in my notebook, then upload a snapshot project in it.我在我的笔记本中安装了 Nexus 存储库,然后在其中上传了一个快照项目。 This is how it looks:这是它的样子:

在此处输入图像描述

Now, I'm trying to build a Docker image, with another project that has the previous project as a dependency.现在,我正在尝试构建一个 Docker 图像,另一个项目将以前的项目作为依赖项。 This is my Dockerfile:这是我的 Dockerfile:

FROM maven:3.5.2-jdk-8-alpine AS MAVEN_BUILD
COPY settings.xml /usr/share/maven/ref/
COPY pom.xml /build/
RUN echo $(route -n | awk '/UG[ \t]/{print $2}')
RUN sed -i "s/localhost/$(route -n | awk '/UG[ \t]/{print $2}')/g" /build/pom.xml
COPY src /build/src/
WORKDIR /build/
RUN mvn package -DskipTests=true

# Other stuff that doesn't matter...

I've added this lines to pom.xml to resolve dependencies from Nexus (locahost is replaced (see Dockerfile) with docker gateway IP):我已将此行添加到 pom.xml 以解决来自 Nexus 的依赖项(locahost 被替换(请参阅 Dockerfile)为 docker 网关 IP):

<repositories>
    <repository>
        <id>maven-group</id>
        <url>http://localhost:8081/repository/maven-group/</url>
    </repository>
</repositories>

It works as expected until maven needs to dowload my own library dependecy, the one uploaded to Nexus, failing with the message:它按预期工作,直到 maven 需要下载我自己的库依赖项,即上传到 Nexus 的库,失败并显示消息:

[ERROR] Failed to execute goal on project springboot-servicio-producto: Could not resolve dependencies for project com.abarazal.springboot.app.producto:springboot-servicio-producto:jar:0.0.1-SNAPSHOT: Could not find artifact com.abarazal.springboot.app.commons:springboot-servicio-commons:jar:0.0.1-SNAPSHOT in maven-group (http://172.17.0.1:8081/repository/maven-group/) -> [Help 1]

In pom.xml the dependency is declared as:在 pom.xml 中,依赖声明为:

<dependency>
    <groupId>com.abarazal.springboot.app.commons</groupId>
    <artifactId>springboot-servicio-commons</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>

What am I missing to make it work?我缺少什么让它发挥作用?

Check if you have more than 10% free disk space.检查您的可用磁盘空间是否超过 10%。 This may be an issue caused by elastic search.这可能是弹性搜索引起的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM