2014-11-25 47 views
0

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

struggeling这几个小时 任何想法?

谢谢。

回答

0

由于您正在创建快照,因此您需要使用快照回购:http://repo.spring.io/snapshot/而不是发布回购(其实应该是http://repo.spring.io/release/)。

不过,我建议你使用当前的里程碑(1.0.0.M2),并使用里程碑式回购:http://repo.spring.io/milestone/

+0

由于这项工作。我现在还有其他问题。希望我能在这个地方有一个工作的例子。 – rayman 2014-11-25 15:55:59

+0

[Spring XD](http://projects.spring.io/spring-xd/)有kafka [source](https://github.com/spring-projects/spring-xd/tree/master/modules/source/kafka /)和[sink](https://github.com/spring-projects/spring-xd/tree/master/modules/sink/kafka/)使用适配器的模块。 – 2014-11-25 16:33:46

+0

我尝试过使用与Spring XD相同的配置的Spring Integration。仍然生产者从未工作。我创建了新的问题:http://stackoverflow.com/questions/27147241/spring-integration-kafka-adaptor-not-producing-message请看看。谢谢。 – rayman 2014-11-26 10:53:20