问题描述
我目前正在学习软件开发,并基于使用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
感谢任何帮助,因为我不知道如何解决此问题
解决方法
您要么需要:
- 使用
assignment1
在同一台计算机上构建clean install
,使其在本地存储库中可用。 - 使用
assignment1
将clean deploy
部署到Maven存储库,然后将其用作<repository>
。