Java 解析gradle依赖项时发生Eclipse错误

Java 解析gradle依赖项时发生Eclipse错误,java,eclipse,gradle,dependencies,Java,Eclipse,Gradle,Dependencies,我已经在build.gradle中添加了依赖项com.sun.mail:javax.mail:1.5.4,但是Eclipse没有解决这个依赖项并抛出这个错误 Illegal entry in Gradle Dependencies: D:/Programs/Eclipse/unresolved dependency - com.sun.mail javax.mail 1.5.4 PluginName Unknown org.springsource.ide.eclipse.gradle

我已经在build.gradle中添加了依赖项com.sun.mail:javax.mail:1.5.4,但是Eclipse没有解决这个依赖项并抛出这个错误

Illegal entry in Gradle Dependencies: D:/Programs/Eclipse/unresolved dependency - com.sun.mail javax.mail 1.5.4 PluginName      Unknown org.springsource.ide.eclipse.gradle.core.classpathcontainer
我曾多次尝试清理和重建项目,刷新依赖项,但仍然出现相同的错误,依赖项无法下载。有什么不对劲

我的build.gradle文件:


我确实不知道为什么,但它开始工作了,依赖性刚刚下载

apply plugin: 'java'
apply plugin: 'eclipse'

sourceCompatibility = 1.7
targetCompatibility = 1.7
version = '1.0'

jar {
    manifest {
        attributes 'Implementation-Title': 'PluginName',
               'Implementation-Version': version
    }
}

repositories {
    mavenCentral()
    maven {
        name 'Sponge maven repo'
        url 'http://repo.spongepowered.org/maven'
    }
}

dependencies {
    compile 'org.spongepowered:spongeapi:2.1-SNAPSHOT'
    compile 'com.sun.mail:javax.mail:1.5.4'
}

test {
    systemProperties 'property': 'value'
}

uploadArchives {
    repositories {
        flatDir {
            dirs 'repos'
        }
    }
}