如何在 Maven 中使用 JitPack.io 使用 GitHub Repo

How to use GitHub Repo using JitPack.io in Maven

我想使用 https://github.com/liquibase/liquibase 版本 3.5.0-SNAPSHOT

我在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>

但编译时出现以下错误:

[错误] 无法在项目 XYZ 上执行目标:无法解析项目的依赖关系 com.XYZ:jar:0.0.1-SNAPSHOT: 找不到 org.liquibase:liquibase-core:jar https://github.com/liquibase/liquibase 中的 :3.5.0-SNAPSHOT 缓存在本地存储库中,在 liquibase-repository 的更新间隔结束或强制更新之前不会重新尝试解析 -> [帮助 1]

JitPack 和下载此存储库似乎有问题。根据JitPack提供的the maven modular example,依赖应该定义如下:

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

下面应该可以工作:

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

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

[ERROR] Failed to execute goal on project my-app: Could not resolve dependencies for project com.mycompany.app:my-app:jar:1.0-SNAPSHOT: Failure to find com.github.liquibase.liquibase:liquibase-core:jar:0885bc4 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]

您可以通过尝试使用 liquibase 父存储库(而不仅仅是 liquibase-core 模块)看到这绝对是一个问题,如下所示:

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

这也报错了。根据此提交的 JitPack's log,源代码似乎存在编译错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project liquibase-core: Compilation failure

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

似乎最好的方法是 file an issue 与 JitPack 的人一起,看看他们是否可以阐明它。