简体   繁体   English

Maven Depedency:脱机命令问题

[英]Maven depedency:go-offline command issue

I am trying to use the following command: 我正在尝试使用以下命令:

RUN mvn clean dependency:go-offline

and I get the following error: 我收到以下错误:

[ERROR] Failed to execute goal on project wc-dao: Could not resolve dependencies for project com.whitecoats:wc-dao:jar:1.0: Could not find artifact com.whitecoats:wc-commons:jar:1.0 in central (https://repo.maven.apache.org/maven2) -> [Help 1]

My project folder: 我的项目文件夹:

1)wc-aws(JAR)
    -pom.xml
    -src
2)wc-admin(spring project WAR)
    -pom.xml
    -src
3)wc-dao(JAR)
    -pom.xml
    -src
-pom.xml

As I understand, maven is trying to look for an artifact online. 据我了解,maven正在尝试在线查找工件。 But the artifact is local java project (wc-dao) which my wc-admin(main project) is dependent on. 但是工件是我的wc-admin(主项目)所依赖的本地Java项目(wc-dao)。

How to resolve this? 如何解决呢?

The Error occurred in the following environment: 在以下环境中发生错误:
Docker: 码头工人:

FROM maven:3.6.1-jdk-8 as maven_builder

ENV HOME=/app

RUN mkdir $HOME

WORKDIR $HOME

ADD . $HOME

RUN mvn clean dependency:go-offline

RUN mvn clean install -T 2C -DskipTests=true

How to resolve the issue? 该如何解决?

Maven misses the artifact Maven错过了神器

 com.whitecoats:wc-commons:jar:1.0

which seems to be not included in your project. 似乎没有包含在您的项目中。

Could not find artifact com.whitecoats:wc-commons:jar:1.0 找不到工件com.whitecoats:wc-commons:jar:1.0

You need to install wc-commons into local maven repository to be able to access it from another project, use: 您需要将wc-commons安装到本地maven存储库中,以便能够从另一个项目访问它,请使用:

mvn install -pl wc-commons
mvn dependency:go-offline

Don't forget to use correct version of wc-commons dependency: it should be the same as in pom.xm file of wc-commons . 不要忘记使用正确版本的wc-commons依赖:它应该与wc-commons pom.xm文件中的相同。

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

相关问题 Maven Dependency Plugin go-offline不下载一些插件 - Maven Dependency Plugin go-offline not downloading some plugins 如何使用Maven依赖项包含本地工件 - How to include local artifacts with Maven dependency:go-offline Maven dependecy:go-offline 不下载传递依赖 - Maven dependecy:go-offline doesn't download transitive dependencies 具有依赖项的Docker Maven:在Docker映像中构建时脱机未拾取本地jar - Docker maven with dependency:go-offline not picking up local jars when built in docker image mvn 依赖项:升级少数依赖项后离线失败 - mvn dependency:go-offline fails after upgrading few dependencies Maven的虔诚不能在primfaces工作? - Maven depedency not working in primefaces? Maven 3项目间集成与战争包装 - maven 3 interproject depedency with war packaging 从“openjdk:8-jdk-alpine”为 Spring 启动应用构建 docker 图像时无法运行“RUN./mvnw dependency:go-offline -B” - Unable to run 'RUN ./mvnw dependency:go-offline -B' when building docker image from "openjdk:8-jdk-alpine" for Spring Boot app 适用于opencv_contrib的Maven - Maven depedency for opencv_contrib 是否有离线模式的maven命令行选项? - Is there a maven command line option for offline mode?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM