在尝试在IntelliJ Idea中构建Gradle项目时出错。

huangapple 未分类评论47阅读模式
英文:

Error while trying to build gradle project in Intellij Idea

问题

我正在尝试在Coursera上完成Java Spring课程,并下载了带有以下Gradle文件的项目。

buildscript {
	ext {
		springBootVersion = '2.1.0.RELEASE'
	}
    repositories {
        maven { url "https://repo.spring.io/libs-snapshot" }
        mavenLocal()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.0.2.RELEASE")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'war'

sourceCompatibility = 1.8
targetCompatibility = 1.8

war {
    baseName = 'gs-convert-jar-to-war'
    version =  '0.1.0'
}

repositories {
    mavenCentral()
    maven { url "https://repo.spring.io/libs-snapshot" }
    maven { url "http://maven.springframework.org/milestone" }
    
    flatDir {
    	dirs 'lib'
    }
}

dependencies {

    compile("org.springframework.boot:spring-boot-starter-web")
    compile("org.springframework.boot:spring-boot-starter-actuator")
    compile("org.springframework.boot:spring-boot-starter-aop")
    compile("org.springframework.boot:spring-boot-starter-test")
    compile("org.springframework.boot:spring-boot-starter-jetty")
    compile("org.springframework.boot:spring-boot-starter-data-jpa")
    compile("org.springframework.data:spring-data-rest-webmvc")
    
    
    compile("org.apache.httpcomponents:httpclient:4.5.6")
    
    
    compile("org.hsqldb:hsqldb")
    
    compile("com.google.guava:guava:17.0")
    compile("org.apache.commons:commons-lang3:3.3.2")
    compile("com.squareup.retrofit:retrofit:1.6.0")
    compile("commons-io:commons-io:2.4")
    
    compile("com.github.davidmarquis:fluent-interface-proxy:1.3.0")
    compile(":mobilecloud.handin:1.0.0")
    compile(":video.up.test:1.0.0")
    compile(":autograder.handin:1.0.0")
    compile(":autograder.spec:1.0.0")
    
    testCompile("junit:junit")
}

不幸的是,我在IntelliJ Idea中遇到了以下错误:

A problem occurred configuring root project 'mobile-cloud-asgn1'.
> Failed to notify project evaluation listener.
   > org.gradle.api.tasks.SourceSetOutput.getClassesDir()Ljava/io/File;

我对Java和Gradle都很陌生,以前从未遇到过这样的错误,所以我不知道如何修复它。有人可以帮助我吗?

附注:带有项目模板的存储库:https://github.com/juleswhite/mobile-cloud-asgn1

英文:

I am trying to accomplish a Java Spring course at Coursera and downloaded the project with this gradle file.

buildscript {
	ext {
		springBootVersion = '2.1.0.RELEASE'
	}
    repositories {
        maven { url "https://repo.spring.io/libs-snapshot" }
        mavenLocal()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.0.2.RELEASE")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'war'

sourceCompatibility = 1.8
targetCompatibility = 1.8

war {
    baseName = 'gs-convert-jar-to-war'
    version =  '0.1.0'
}

repositories {
    mavenCentral()
    maven { url "https://repo.spring.io/libs-snapshot" }
    maven { url "http://maven.springframework.org/milestone" }
    
    flatDir {
    	dirs 'lib'
    }
}

dependencies {

    compile("org.springframework.boot:spring-boot-starter-web")
    compile("org.springframework.boot:spring-boot-starter-actuator")
    compile("org.springframework.boot:spring-boot-starter-aop")
    compile("org.springframework.boot:spring-boot-starter-test")
    compile("org.springframework.boot:spring-boot-starter-jetty")
    compile("org.springframework.boot:spring-boot-starter-data-jpa")
    compile("org.springframework.data:spring-data-rest-webmvc")
    
    
    compile("org.apache.httpcomponents:httpclient:4.5.6")
    
    
    compile("org.hsqldb:hsqldb")
    
    compile("com.google.guava:guava:17.0")
    compile("org.apache.commons:commons-lang3:3.3.2")
    compile("com.squareup.retrofit:retrofit:1.6.0")
    compile("commons-io:commons-io:2.4")
    
    compile("com.github.davidmarquis:fluent-interface-proxy:1.3.0")
    compile(":mobilecloud.handin:1.0.0")
    compile(":video.up.test:1.0.0")
    compile(":autograder.handin:1.0.0")
    compile(":autograder.spec:1.0.0")
    
    testCompile("junit:junit")
}

Unfortunately, I have this error in IntelliJ Idea :

A problem occurred configuring root project 'mobile-cloud-asgn1'.
> Failed to notify project evaluation listener.
   > org.gradle.api.tasks.SourceSetOutput.getClassesDir()Ljava/io/File;

I am quite a newbie to Java and Gradle and never faced errors like this, so I have no idea how to fix it. Can anyone help me?<br/>
P.S. Repository with project template: https://github.com/juleswhite/mobile-cloud-asgn1

huangapple
  • 本文由 发表于 2020年5月5日 16:42:12
  • 转载请务必保留本文链接:https://java.coder-hub.com/61609130.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定