I can't resolve a SNAPSHOT dependency. I already published the project on oss sonatype
My main class:
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 build file:
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'
}
Error
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.
Image showing the dependencies
I solved the issue by adding sonatype to repositories in my build.gradle file.
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'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With