CAS-5.1.0-RC3 作为Gradle项目导入Eclipse

本文介绍了如何在Eclipse Mars中导入CAS-5.1.0-RC3 Gradle项目。首先,需要安装Buildship插件,然后修改build.gradle文件以解决导入时的Grgit异常,同时利用Maven本地仓库和自定义镜像加速构建。接着,调整buildscript和subprojects的repositories以适应个人环境,并确保所有依赖项能够正确解析。最后,解决Eclipse中的循环依赖警告问题。
摘要由CSDN通过智能技术生成

准备环境

      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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值