2

I work with kotlin gradle project. When i try to integrate swagger, it shows

Could not resolve io.springfox:springfox-swagger2:3.0.0-SNAPSHOT. Possible solution: - Declare repository providing the artifact, see the documentation at

error for

  • springfox-swagger2:3.0.0-SNAPSHOT
  • springfox-swagger-ui:3.0.0-SNAPSHOT
  • springfox-spring-webflux:3.0.0-SNAPSHOT

while reimport gradle projects.

buildscript {
ext {
    kotlin_version = "1.2.51"
    springBootVersion = "2.0.3.RELEASE"

    junitPlatformVersion = '1.0.0-M2'
    junitJupiterVersion = '5.0.0-M2'
    junitVintageVersion = '4.12.0-M2'

    smack_version = '4.2.3'
}

repositories {
    mavenLocal()
    mavenCentral()
    maven { url "https://repo.spring.io/milestone" }
    maven { url "https://repo.spring.io/snapshot" }
    maven { url "https://repo.spring.io/libs-snapshot" }
}
dependencies {
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath "io.spring.gradle:dependency-management-plugin:1.0.3.RELEASE"
    classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}")

}

}

defaultTasks "clean", "build"

subprojects {

apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'

sourceCompatibility = 1.8

repositories {
    maven { url "https://repo.spring.io/libs-snapshot" }
    mavenLocal()
    mavenCentral()
    maven { url "http://archiva.hsenidmobile.com/repository/internal" }
    maven { url "https://repo.spring.io/milestone" }
    maven { url "https://repo.spring.io/snapshot" }
    maven { url "https://repo.spring.io/libs-snapshot" }
    maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' }
    jcenter()

}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

    compile("org.springframework.boot:spring-boot-starter-webflux:$springBootVersion") {
        exclude(module: "hibernate-validator")
    }

    compile("org.springframework.boot:spring-boot-starter-data-jpa:$springBootVersion")
    compile("org.springframework.boot:spring-boot-starter-security:$springBootVersion")
    compile("javax.servlet:javax.servlet-api:3.0.1")

    compile("io.jsonwebtoken:jjwt:0.7.0")

    compile("hms.common:hms-common-util:1.0.9")

    compile("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.0.pr4")
    compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.0.pr4")
    compile("org.postgresql:postgresql:42.1.4")
    compile("com.google.api-client:google-api-client:1.22.0")

    compile group: 'org.springframework.plugin', name: 'spring-plugin-core', version: '2.0.0.RELEASE'

    compile 'io.springfox:springfox-swagger2:3.0.0-SNAPSHOT'
    compile 'io.springfox:springfox-swagger-ui:3.0.0-SNAPSHOT'
    compile 'io.springfox:springfox-spring-webflux:3.0.0-SNAPSHOT'



    implementation "org.igniterealtime.smack:smack-tcp:$smack_version"
    implementation "org.igniterealtime.smack:smack-experimental:$smack_version"
    implementation "org.igniterealtime.smack:smack-java7:$smack_version"
    implementation "org.igniterealtime.smack:smack-extensions:$smack_version"
    implementation "org.igniterealtime.smack:smack-im:$smack_version"

    testCompile("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
    testCompile("org.junit.platform:junit-platform-runner:${junitPlatformVersion}")
    testCompile("org.springframework.boot:spring-boot-starter-test:$springBootVersion")
    testCompile("io.projectreactor:reactor-test:3.1.0.RELEASE")

    runtime("tanukisoft:wrapper:3.2.3")

    testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")    //JUnit5
    testRuntime("org.junit.vintage:junit-vintage-engine:${junitVintageVersion}") //JUnit4

}

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

}

Isuru Jayasinghe
  • 105
  • 3
  • 11

2 Answers2

1

add this repository

    <repository>
        <id>jcenter-snapshots</id>
        <name>jcenter</name>
        <url>http://oss.jfrog.org/artifactory/oss-snapshot-local/</url>
    </repository>

it's maven syntax but you can easily translate it to gradle

Etay Ceder
  • 160
  • 1
  • 9
  • I already added it to the repository. repositories { maven { url "https://repo.spring.io/libs-snapshot" } mavenLocal() mavenCentral() maven { url "http://archiva.hsenidmobile.com/repository/internal" } maven { url "https://repo.spring.io/milestone" } maven { url "https://repo.spring.io/snapshot" } maven { url "https://repo.spring.io/libs-snapshot" } maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' } jcenter() } – Isuru Jayasinghe Jan 30 '20 at 04:48
  • in this link: (https://springfox.github.io/springfox/docs/snapshot/) the documation i use to use swagger-web-flux, i check the links: (http://oss.jfrog.org/simple/oss-snapshot-local/io/springfox/) , (http://oss.jfrog.org/oss-snapshot-local/io/springfox/) both are working you can download manually the jars – Etay Ceder Jan 30 '20 at 15:46
1

Add this to your gradle build script root.

repositories {maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' }}
matthias_h
  • 11,356
  • 9
  • 22
  • 40
alcmontejo
  • 11
  • 2