首页 > 解决方案 > 我自己的仓库的 POM 丢失,没有可用的依赖信息

问题描述

我目前正在学习软件开发并根据使用 jitpack 在另一个项目中使用一个项目的版本来完成一项任务。

第一个项目,我想在我的第二个项目中添加一个依赖项,只有三个类和一个 JUnit 测试。我改变了一些东西,所以我现在处于 V5.0 版本。

https://github.com/MohamedMoustafaNUIG/assignment1/releases/tag/V5.0

我的第二个项目还没有推送,但这是 pom 文件:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.nuig</groupId>
    <artifactId>assignment1_driver</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.github.MohamedMoustafaNUIG</groupId>
            <artifactId>assignment1</artifactId>
            <version>v5.0</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>
</project>

当我尝试使用依赖项(在 netbeans 中)构建时,出现此错误:

Failed to execute goal on project assignment1_driver: 
Could not resolve dependencies for project com.nuig:assignment1_driver:jar:1.0-SNAPSHOT: 
Failure to find com.github.MohamedMoustafaNUIG:assignment1:jar:v5.0 in 
https://jitpack.io was cached in the local repository, 
resolution will not be reattempted until the update interval of jitpack.io has 
elapsed or updates are forced -> [Help 1]

我也收到此警告:

The POM for com.github.MohamedMoustafaNUIG:assignment1:jar:v5.0 is missing, no dependency information available

即使 zip 文件(来自链接版本)具有 pom 文件。

任何帮助表示赞赏,因为我不知道如何解决这个问题

标签: mavennetbeansjitpack

解决方案


您要么需要:

  • assignment1同一台机器上构建clean install以使其在本地存储库中可用。
  • 部署assignment1到 Maven 存储库,clean deploy然后将其用作<repository>.

推荐阅读