准备环境
1)Eclipse mars
2)通过market安装buildship插件
解压后,修改build.gradle文件以下内容
1、注释掉删除线部分,加上红字内容,解决导入时候提示Grgit .get not found异常
ext {
publishSnapshots = Boolean.getBoolean("publishSnapshots")
publishReleases = Boolean.getBoolean("publishReleases")
sonatypeUsername = System.getProperty("sonatypeUsername")
sonatypePassword = System.getProperty("sonatypePassword")
/*
Open the Git repository in the current directory.
Get commit id of HEAD.
git = org.ajoberstar.grgit.Grgit.open()
def gitHead = git.head()
currentRevision = gitHead.id
currentAbbreviatedRevision = gitHead.abbreviatedId
*/
currentRevision = "cas-5.1.0-RC3"
}
2、注释掉删除线部分,加上红字内容,继续使用原来的Maven缓存,和启用自己的Maven仓库镜像
buildscript {
repositories {
maven {
url "C:/Users/Devloper/.m2/repository"
url "http://localhost:8081/nexus/content/groups/public/"
}
/*
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://maven.eveoh.nl/content/repositories/releases" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "http://repo.spring.io/plugins-release" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://repo.spring.io/snapshot" }
*/
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
classpath "com.netflix.nebula:gradle-lint-plugin:7.3.0"
classpath "org.standardout:gradle-versioneye-plugin:1.4.0"
classpath "org.springframework.build.gradle:propdeps-plugin:0.0.7"
classpath "com.gradle:build-scan-plugin:1.0"
classpath "org.ajoberstar:grgit:1.7.2"
classpath "io.spring.gradle:dependency-management-plugin:1.0.1.RELEASE"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.moowork.gradle:gradle-node-plugin:1.1.1"
}
}
……
subprojects {
task allDependenciesInsight(type: DependencyInsightReportTask, description: "Produce insight information for all dependencies") {
doLast {}
}
task allDependencies(type: DependencyReportTask, description: "Display a graph of all project dependencies") {
doLast {}
}
if (Boolean.getBoolean("enableKotlin")) {
apply plugin: "kotlin"
}
apply plugin: "java-library"
apply plugin: "checkstyle"
apply plugin: "findbugs"
apply plugin: "project-report"
apply plugin: "propdeps"
apply plugin: "propdeps-maven"
apply plugin: "propdeps-idea"
apply plugin: "propdeps-eclipse"
apply from: rootProject.file("gradle/tasks.gradle")
ext.libraries = rootProject.ext.libraries
repositories {
maven {
url "C:/Users/Devloper/.m2/repository"
url "http://localhost:8081/nexus/content/groups/public/"
}
/*
mavenLocal()
maven { url "https://build.shibboleth.net/nexus/content/repositories/releases" }
maven { url "https://raw.github.com/vt-middleware/maven-repo/master" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://oss.sonatype.org/content/repositories/releases" }
maven { url "http://repo.maven.apache.org/maven2" }
/**
下面这行得留着,要不dependencies.gradle文件的duo_client_java:master-SNAPSHOT会找不到
*/
maven { url "https://jitpack.io" }
maven { url "http://developer.jasig.org/repo/content/groups/m2-legacy/" }
maven { url "http://files.couchbase.com/maven2" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/libs-snapshot" }
maven { url "https://dl.bintray.com/uniconiam/maven" }
jcenter()
*/
}
……
}
3、给下面这些地址加到maven私服,并且映射到Public Repositories里面
http://repo.spring.io/plugins-release/
https://maven.eveoh.nl/content/repositories/releases
https://plugins.gradle.org/m2/
http://repo.spring.io/plugins-release
https://build.shibboleth.net/nexus/content/repositories/releases
https://raw.github.com/vt-middleware/maven-repo/master
https://oss.sonatype.org/content/repositories/snapshots
https://oss.sonatype.org/content/repositories/releases
http://repo.maven.apache.org/maven2
http://developer.jasig.org/repo/content/groups/m2-legacy/
http://files.couchbase.com/maven2
https://repo.spring.io/milestone
https://repo.spring.io/snapshot
https://repo.spring.io/libs-snapshot
https://dl.bintray.com/uniconiam/maven
4、修改gradle.properties,干掉删除线,加上红字
pac4jSpringWebmvcVersion=2.0.0-RC2-SNAPSHOT
pac4jSpringWebmvcVersion=2.0.0-RC2
pac4jVersion=2.0.0-RC2-SNAPSHOT
pac4jVersion=2.0.0-RC2
5、Eclipse报编译异常“A cycle was detected in the build path of project ”
解决方法 Window -> Preferences... -> Java -> Compiler -> Building -> Building path problems -> Circular dependencies -> 将Error改成Warning