我无法使用Gradle导入快照

我们喜欢:

我无法解决SNAPSHOT依赖关系。我已经在oss sonatype上发布了该项目

我的主班:

package com.github.sitrakary.unitconvert.gui;

// import a class from the SNAPSHOT dependencies.
import com.github.sitrakary.unitconvert.Converter; // Can't resolve 'Converter'

public class App {
  public static void main(String args[]) {
    System.out.println();
  }
}

Gradle构建文件:

group 'com.github.sitrakary'
version '0.1-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile group: 'com.github.sitrakary',  name:'unit-converter', version:'1.0-SNAPSHOT', changing: true

    testCompile group: 'junit', name: 'junit', version: '4.12'

}

错误

Information:java: Errors occurred while compiling module 'unit-converter-gui_main'
Information:javac 9.0.1 was used to compile java sources
Information:Module "unit-converter-gui_main" was fully rebuilt due to project configuration/dependencies changes
Information:26/01/2018 12:30 - Compilation completed with 1 error and 0 warnings in 3s 470ms
Error:java: Illegal char <:> at index 84: C:\Users\Sitraka\IdeaProjects\unit-converter-gui\Could not find com.github.sitrakary:unit-converter:1.0-SNAPSHOT.

该图显示了依赖关系

我们喜欢:

我通过将sonatype添加到build.gradle文件中的存储库中解决了该问题。

group 'com.github.sitrakary'
version '0.1-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
    // add sonatype repository
    maven {
        url 'https://oss.sonatype.org/content/repositories/snapshots/'
    }
}

dependencies {
    compile group: 'com.github.sitrakary',  name:'unit-converter', version:'1.0-SNAPSHOT', changing: true

    testCompile group: 'junit', name: 'junit', version: '4.12'
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章