我正在尝试将spring-data-aerospike依赖项添加到gradle构建文件中。
下面是我的build.gradle文件。
group 'spring-data-as-demo'
version '1.0-SNAPSHOT'
apply plugin: 'java'
sourceCompatibility = 1.8
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compile group: 'com.aerospike', name: 'spring-data-aerospike', version: '1.0.0.RELEASE'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
错误是 -
$ gradle clean compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve com.aerospike:spring-data-aerospike:1.0.0.RELEASE.
Required by:
project :
> Could not resolve com.aerospike:spring-data-aerospike:1.0.0.RELEASE.
> Could not parse POM https://repo1.maven.org/maven2/com/aerospike/spring-data-aerospike/1.0.0.RELEASE/spring-data-aerospike-1.0.0.RELEASE.pom
> Could not find org.springframework.data.build:spring-data-parent:1.9.0.BUILD-SNAPSHOT.
Searched in the following locations:
https://repo1.maven.org/maven2/org/springframework/data/build/spring-data-parent/1.9.0.BUILD-SNAPSHOT/maven-metadata.xml
https://repo1.maven.org/maven2/org/springframework/data/build/spring-data-parent/1.9.0.BUILD-SNAPSHOT/spring-data-parent-1.9.0.BUILD-SNAPSHOT.pom
https://repo1.maven.org/maven2/org/springframework/data/build/spring-data-parent/1.9.0.BUILD-SNAPSHOT/spring-data-parent-1.9.0.BUILD-SNAPSHOT.jar
file:/Users/rajkumar.natarajan/.m2/repository/org/springframework/data/build/spring-data-parent/1.9.0.BUILD-SNAPSHOT/maven-metadata.xml
file:/Users/rajkumar.natarajan/.m2/repository/org/springframework/data/build/spring-data-parent/1.9.0.BUILD-SNAPSHOT/spring-data-parent-1.9.0.BUILD-SNAPSHOT.pom .
file:/Users/rajkumar.natarajan/.m2/repository/org/springframework/data/build/spring-data-parent/1.9.0.BUILD-SNAPSHOT/spring-data-parent-1.9.0.BUILD-SNAPSHOT.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
2 actionable tasks: 1 executed, 1 up-to-date
但是当我将项目创建为maven时,下面是pom.xml。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>spring-data-as-mvn-demo</groupId>
<artifactId>spring-data-as-mvn-demo</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.aerospike</groupId>
<artifactId>spring-data-aerospike</artifactId>
<version>1.0.2.RELEASE</version>
</dependency>
</dependencies>
当我使用mvn clean compile
编译项目时,它是成功的。
我是否需要添加不同的存储库来解决依赖关系?
另外,我尝试标记[spring-data-Aerospike],但标签无法以某种方式被识别。