如何在Maven中使用JitPack

如何在Maven中使用JitPack

本文介绍了如何在Maven中使用JitPack.io使用GitHub Repo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用版本3.5.0- SNAPSHOT

I wants to use https://github.com/liquibase/liquibase version 3.5.0-SNAPSHOT

我在pom.xml中添加了以下内容

I have added the following in pom.xml

<dependency>
            <groupId>liquibase</groupId>
            <artifactId>liquibase-core</artifactId>
            <version>3.5.0-SNAPSHOT</version>
        </dependency>

<repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
</repository>

但编译时收到以下错误:

but got following error when compile:

[ERROR]无法在项目XYZ上执行目标:无法解析项目com.XYZ:jar:0.0.1-SNAPSHOT的依赖关系:未找到org.liquibase:liquibase-core:jar:3.5.0-SNAPSHOT in https://github.com/liquibase/liquibase 缓存在本地存储库中,解决方案将不会被重新尝试,直到液位库的更新间隔已经过时或更新被强制 - > [帮助1]

[ERROR] Failed to execute goal on project XYZ: Could not resolve dependencies for project com.XYZ:jar:0.0.1-SNAPSHOT: Failure to find org.liquibase:liquibase-core:jar:3.5.0-SNAPSHOT in https://github.com/liquibase/liquibase was cached in the local repository, resolution will not be reattempted until the update interval of liquibase-repository has elapsed or updates are forced -> [Help 1]

推荐答案

似乎有一个问题与JitPack并下载此存储库。根据JitPack提供的,依赖关系应定义如下:

There seems to be an issue with JitPack and downloading this repository. According to the maven modular example that JitPack provides, the dependency should be defined as follows:

<dependency>
    <groupId>com.github.User.Repo</groupId>
    <artifactId>Module</artifactId>
    <version>Commit/Tag</version>
</dependency>

然后应该执行以下操作:

The following should then work:

<dependency>
    <groupId>com.github.liquibase.liquibase</groupId>
    <artifactId>liquibase-core</artifactId>
    <version>f7f3b8f60b</version>
</dependency>

但它也无法解决依赖关系:

But it also fails resolving the dependency:

[ERROR]无法在项目中执行目标my-app:无法解析项目com.mycompany.app:my-app:jar:1.0-SNAPSHOT的依赖关系:找不到com.github .liquibase.liquibase:在本地存储库中缓存了中的liquibase-core:jar:0885bc4,直到jitpack.io的更新间隔过去或更新被强制,分辨率才会被重新尝试 - > [帮助1]

您可以看到这绝对是一个问题,只是试图使用liquibase父存储库(不只是liquibase-core模块)如下:

You can see that this is definitely an issue by just trying to use the liquibase parent repository (not just the liquibase-core module) as follows:

<dependency>
    <groupId>com.github.liquibase</groupId>
    <artifactId>liquibase</artifactId>
    <version>f7f3b8f60b</version>
</dependency>

哪些也出错了。根据对于此提交,看起来源文件有一个编译错误:

Which also errors out. According to JitPack's log for this commit, it looks like there is a compilation error with the source:

[ERROR] / home / jitpack /建造/ liquibase核/ SRC /主/爪哇/ liquibase /解析器/型芯/ formattedsql / FormattedSqlChangeLogParser。
java:[213,209]')'expected

[ERROR] /home/jitpack/build/liquibase-core/src/main/java/liquibase/parser/core/formattedsql/FormattedSqlChangeLogParser. java:[213,209] ')' expected

似乎最好的路由是,看看他们是否可以摆脱一些问题,这个问题与com / github / liquibase / liquibase / master-liquibase-parent-3.4.2-g0885bc4-236 / build.logrel =nofollow点亮它。

It seems like the best route would be to file an issue with the JitPack folks and see if they can shed some light on it.

这篇关于如何在Maven中使用JitPack.io使用GitHub Repo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!