我在哪里可以找到org.springframework.cassandra.config jar。我只看到org.springframework.data.cassandra

时间:2018-11-28 16:11:38

标签: java spring gradle

让gradle版本可以正常工作(from a previous question related to this one),Andy Wilkinson为我回答了,没有任何问题。正在为Cassandra寻找一个Lone org.springframework包...

我遇到的麻烦如下:

org.springframework.cassandra.config.CassandraCqlClusterFactoryBean;并导入

org.springframework.cassandra.core.keyspace.CreateKeyspaceSpecification;

我一直发现的只是导入 我已经拥有的org.springframework.data.cassandra。问题是core.keyspace.CreateKeySpaceSpefication和config.CassandraCqlClusterFactoryBean不存在。

我一直在搜寻互联网,但是我仍然需要该软件包。这是我可能需要Marcelo帮助的地方。一旦有了这些,所有PFS项都将构建,并且我们将处于良好状态。

显然,社区被迫使用“ org.springframework.data.cassandra”,该项目上没有以下内容:
    CassandraCqlClusterFactoryBean以上是     CassandraClusterFactoryBean; (没有Cql),这是我的问题。

以下函数无法编译,因为data.cassandra版本上不存在我需要的方法

public CassandraCqlClusterFactoryBean cluster() {
    CassandraCqlClusterFactoryBean cqlClusterFactoryBean = new CassandraCqlClusterFactoryBean();
    cqlClusterFactoryBean.setContactPoints(properties.getContactPoints());
    cqlClusterFactoryBean.setPort(properties.getPort());
    cqlClusterFactoryBean.setUsername(properties.getUsername());
    cqlClusterFactoryBean.setPassword(properties.getPassword());
    cqlClusterFactoryBean.setKeyspaceCreations(getKeyspaceCreations());
    cqlClusterFactoryBean.setQueryOptions(getQueryOptions());
    return cqlClusterFactoryBean;
}

安迪也建议不要将这些jar文件放在我的/ jdk / jre / lib文件夹中。如果是这种情况,并且导入无法正常工作,我应该将jar文件放在哪里以使项目正确构建?

我以前使用过JAVA,并为CISCO Appliance构建了一个简单的JAVA代码库,所有导入工作都很棒!

我们正在使用Gradle构建此文件,这是我的Gradle文件,供Andy Wilkinson帮助使用。

buildscript {
  ext {
    springBootVersion = '1.5.17.RELEASE'
  }
  repositories {
    mavenCentral()
    maven { url 'https://repo.spring.io/snapshot' }
    maven { url 'https://repo.spring.io/milestone' }
  }
  dependencies {
    classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
  }
}

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
//apply plugin: 'war'

version = '0.0.1'
sourceCompatibility = 1.8

repositories {
  jcenter()
  mavenCentral()
  flatDir {
    dirs 'repository'
  }
  mavenCentral()
}



ext {
  springCloudVersion = 'Edgware.SR3'
}

dependencies {
  compile('org.springframework.boot:spring-boot-starter-aop')
  compile('org.springframework.boot:spring-boot-starter-security')
  compile('org.springframework.boot:spring-boot-starter-web')
  compile("org.springframework.boot:spring-boot-devtools")
  compile('org.springframework.boot:spring-boot-starter-actuator')

  compile group: 'joda-time', name: 'joda-time'

  compile group: 'com.myproject', name: 'all_pfs', version: '7.1.9'
  compile group: 'com.myproject', name: 'pfs-client', version: '7.1.9'
  compile group: 'com.myproject.pfs.wic', name: 'pfs-wic', version: '1.1.0.RC3'
  compile group: 'com.picketlink.picketlink', name: 'picketlink-fed', version: '2.0.3-SNAPSHOT'

  compile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
  compile group: 'commons-lang', name: 'commons-lang', version: '2.6'
  compile group: 'org.apache.httpcomponents', name: 'httpclient'
  compile group: 'xstream', name: 'xstream', version: '1.2.2'
  compile group: 'javax.ejb', name: 'javax.ejb-api', version: '3.2'

  compile group: 'io.springfox', name: 'springfox-swagger2', version:'2.6.1'
  compile group: 'io.springfox', name: 'springfox-swagger-ui', version:'2.6.1'

  // https://mvnrepository.com/artifact/org.apache.commons/commons-io
  compile group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'

  // https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils
  compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.8.3'



  // https://mvnrepository.com/artifact/org.codehaus.jackson/jackson-mapper-asl
  compile group: 'org.codehaus.jackson', name: 'jackson-mapper-asl', version: '1.9.13'



  // https://mvnrepository.com/artifact/org.springframework/spring-messaging
  compile group: 'org.springframework', name: 'spring-messaging', version: '4.2.6.RELEASE'


  // https://mvnrepository.com/artifact/org.springframework/spring-websocket
  compile group: 'org.springframework', name: 'spring-websocket', version: '4.3.11.RELEASE'

  // https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox
  compile group: 'org.apache.pdfbox', name: 'pdfbox', version: '2.0.11'

  // compile ("org.springframework.boot:spring-boot-starter-data-elasticsearch")
  // compile ("net.java.dev.jna:jna:4.1.0")


  compile('org.springframework.boot:spring-boot-starter-test')

  // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa
  compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '1.5.6.RELEASE'


  // https://mvnrepository.com/artifact/com.microsoft.sqlserver/sqljdbc4
  testCompile group: 'com.microsoft.sqlserver', name: 'sqljdbc4', version: '4.0'

  compile name: "sqljdbc4-4.0"

  //Added to implement slf4j logger
  compile group: 'org.slf4j', name:'slf4j-api', version: '1.7.2'
  //compile group: 'ch.qos.logback', name:'logback-classic', version: '1.0.9'
  //compile group: 'ch.qos.logback', name:'logback-core', version: '1.0.9'

  // https://mvnrepository.com/artifact/com.itextpdf/itextpdf
  compile group: 'com.itextpdf', name: 'itextpdf', version: '5.5.13'

  // https://mvnrepository.com/artifact/com.itextpdf.tool/xmlworker
  compile group: 'com.itextpdf.tool', name: 'xmlworker', version: '5.5.13'

  // jsoup HTML parser library @ https://jsoup.org/
  compile 'org.jsoup:jsoup:1.11.3'

  compile group: 'com.datastax.cassandra',name: 'cassandra-driver-core',version:'3.2.0'
  compile('org.springframework.boot:spring-boot-starter-data-cassandra')

  compile('org.projectlombok:lombok:1.18.2')

  compile group: 'com.myproject.set.fusion.audit.client', name: 'audit-client', version: '2.0.1.RELEASE'

  compile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.3'

}

dependencyManagement {
  imports {
    mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
  }
}

OF注意::当我扫描gradle文件时,我注意到我所有的JAR文件都是“ HERE!”。显然,当我执行CLEAN and BUILD时,我所有的JAR文件都放在这里。如果是这样,那么我是否应该不能对我需要的所有JAR文件进行引用,然后将其从/ jdk / jre / lib目录中删除?

有什么想法和建议吗?

1 个答案:

答案 0 :(得分:1)

您可以添加

compile group: 'org.springframework.data', name: 'spring-data-cassandra', version: '2.0.4.RELEASE'

这也应该使org.springframework.cassandra.config.CassandraCqlClusterFactoryBean也可以导入。(即,它包含在spring-data-cassandra-2.0.4.RELEASE.jar中,将被下拉)