【发布时间】:2017-08-10 20:19:45
【问题描述】:
我试图着手进行春季数据审计。所以我从下面写的一个简单的 build.gragle 开始。但我无法获得 javax.persistence 的所有类。* 我的意思是 @Entity 超过任何 POJO 给了我无法解析符号并且没有可用的导入。我无法弄清楚我缺少什么我的 gradle 文件。
buildscript {
ext {
springBootVersion = '1.5.2.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
jar {
baseName = 'auditTest'
version = '1.0.0-SNAPSHOT'
}
repositories {
mavenCentral()
mavenLocal()
}
group = 'com.shubham'
version = '1.0.0-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.data:spring-data-jpa:1.11.1.RELEASE')
}
但后来我从Spring's Getting Started with JPA 页面复制了 gradle 文件。 javax.persistance 的所有课程都可用。
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.2.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
jar {
baseName = 'Audit'
version = '0.1.0'
}
repositories {
mavenCentral()
maven { url "https://repository.jboss.org/nexus/content/repositories/releases" }
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile("org.springframework.boot:spring-boot-starter-data-jpa")
testCompile("org.springframework.boot:spring-boot-starter-test")
}
那么我在build.gradle 文件中遗漏了什么?
【问题讨论】:
-
似乎缺少指向 repo 的 url
https://repository.jboss.org/nexus/content/repositories/releases。因此,没有下载 jar。 -
我已尝试包含该网址。它没有工作