【问题标题】:Error using Gradle importing spring-integration-kafka使用 Gradle 导入 spring-integration-kafka 时出错
【发布时间】:2015-01-23 15:29:14
【问题描述】:

我的 gradle.build 脚本如下所示:

buildscript {
    repositories {
        mavenCentral()
        maven { url 'https://repo.spring.io/simple/ext-release-local' }

    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.9.RELEASE")

    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'war'
apply plugin: 'maven'
apply plugin: 'application'



jar {
    baseName = 'calc-service'
    version = '0.1.0'
}

ext {
    springBootVersion = '1.1.9.RELEASE'
    springIntegrationVersion = '4.0.3.RELEASE'
    springIntegrationKafkaVersion = '1.0.0.BUILD-SNAPSHOT'
}

repositories {
    mavenCentral()
    maven {
        url 'https://repository.apache.org/content/groups/public'
    }
    maven { url 'https://repo.springsource.org/libs-milestone' }


}

dependencies {
    compile 'org.springframework.boot:spring-boot-starter-web'
    compile 'org.springframework.boot:spring-boot-starter-actuator'
    compile 'org.projectreactor.spring:reactor-spring-context'
    compile 'javax.inject:javax.inject:1'


    //SI
   // compile "org.springframework.integration:spring-integration-core:$springIntegrationVersion"
    compile "org.springframework.integration:spring-integration-stream:$springIntegrationVersion"


    compile 'org.springframework.integration:spring-integration-mongodb:4.0.4.RELEASE'


    //kafka
    compile("org.springframework.integration:spring-integration-kafka:$springIntegrationKafkaVersion") {
        exclude module: 'log4j'
        exclude module: 'jms'
        exclude module: 'jmxtools'
        exclude module: 'jmxri'
    }

    compile("log4j:log4j:1.2.15") {
        exclude module: 'mail'
        exclude module: 'jms'
        exclude module: 'jmx'
        exclude module: 'jmxtools'
        exclude module: 'jmxri'
    }
    compile "commons-logging:commons-logging:1.1.1"

    //Required dependency for JSP
    providedRuntime 'org.apache.tomcat.embed:tomcat-embed-jasper'

    testCompile("org.springframework.boot:spring-boot-starter-test:$springBootVersion")
    testCompile("junit:junit")
}






task wrapper(type: Wrapper) {
    gradleVersion = '1.11'
}

我收到此错误:

Warning:<i><b>root project 'CalcMicroService': Web Facets/Artifacts will not be configured</b>
Details: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':runtime'.
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.springframework.integration:spring-integration-kafka:1.0.0.BUILD-SNAPSHOT.
Required by:
    :CalcMicroService:unspecified
Caused by: org.gradle.internal.resource.ResourceException: Unable to load Maven meta-data from https://repo.springsource.org/libs-milestone/org/springframework/integration/spring-integration-kafka/1.0.0.BUILD-SNAPSHOT/maven-metadata.xml.
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://repo.springsource.org/libs-milestone/org/springframework/integration/spring-integration-kafka/1.0.0.BUILD-SNAPSHOT/maven-metadata.xml'.
Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated</i>

为此奋斗了好几个小时 有什么想法吗?

谢谢。

【问题讨论】:

    标签: java spring gradle spring-boot spring-integration


    【解决方案1】:

    由于您要提取快照,因此您需要使用快照存储库:http://repo.spring.io/snapshot/ 而不是发布存储库(实际上应该是 http://repo.spring.io/release/)。

    但是,我建议您使用当前里程碑 (1.0.0.M2) 并使用里程碑回购:http://repo.spring.io/milestone/

    【讨论】:

    • 感谢您的工作。我现在有其他问题。希望我能在某个地方有这样的工作示例。
    • Spring XD 具有使用适配器的 kafka sourcesink 模块。
    • 我在 Spring Integration 中尝试了这个,它使用与 Spring XD 相同的配置。制片人仍然没有工作。我在stackoverflow.com/questions/27147241/… 创建了新问题,请看一下。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-25
    • 2016-08-19
    • 1970-01-01
    • 1970-01-01
    • 2014-10-27
    • 2018-08-28
    • 2021-04-12
    相关资源
    最近更新 更多