How to use GitHub Repo using JitPack.io in Maven

我的梦境 提交于 2019-12-12 05:46:04

问题


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

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] 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]


回答1:


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] 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]

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] 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

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.



来源:https://stackoverflow.com/questions/34930820/how-to-use-github-repo-using-jitpack-io-in-maven

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!