NetBeans Gradle project



我刚刚在NetBeans 8.0.2中创建了一个空的Gradle项目,并试图添加rxjava依赖。这是我的构建。

apply plugin: 'java'
apply plugin: 'application'
mainClassName = "newpackage.main"
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
// NetBeans will automatically add "run" and "debug" tasks relying on the
// "mainClass" property. You may however define the property prior executing
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
//
// Note however, that you may define your own "run" and "debug" task if you
// prefer. In this case NetBeans will not add these tasks but you may rely on
// your own implementation.
if (!hasProperty('mainClass')) {
    ext.mainClass = 'newpackage.main'
}
repositories {
    mavenCentral()
    jcenter()
    // You may define additional repositories, or even remove "mavenCentral()".
    // Read more about repositories here:
    //   http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories
}
dependencies {
    // TODO: Add dependencies here ...
    // You can read more about how to add dependency here:
    //   http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies
    testCompile group: 'junit', name: 'junit', version: '4.10'
    compile 'io.reactivex:rxjava:1.2.0'
    runtime files('libs/rxjava-1.2.0.jar')
}

但是在我的主类中我不能使用rx。*类。即使下载和导入。jar文件NetBeans不能找到他们。我错在哪里?在android工作室,我只需要添加gradle的依赖关系和它的ok。这里没有。我如何使NetBeans通过gradle看到我的依赖关系?

您必须点击"Reload project"(在项目的上下文菜单中)以便NetBeans在build.gradle中拾取您的更改

相关内容

  • 没有找到相关文章