Я только что создал пустой проект Gradle в NetBeans 8.0.2 и попытался добавить зависимость rxjava. Вот моя сборка.Проект NetBeans Gradle
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. * Classes. Даже после загруженного и импортированного файла .jar NetBeans can not find em. Где я не прав? В студии Android мне нужно просто добавить зависимости градиентов и все в порядке. Здесь нет. Как я могу заставить NetBeans видеть мои зависимости через gradle?
Угадайте, это помогло – TooLazy