rx-java设置
摇篮
compile 'io.reactivex:rxjava2:rxjava:2.1.1'
马文
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>2.1.1</version>
</dependency>
常春藤
<dependency org="io.reactivex.rxjava2" name="rxjava" rev="2.1.1" />
JFrog的快照
repositories {
maven { url 'https://oss.jfrog.org/libs-snapshot' }
}
dependencies {
compile 'io.reactivex:rxjava:2.0.0-SNAPSHOT'
}
如果您需要下载jar而不是使用构建系统,请pom使用所需版本创建一个Maven文件,如下所示:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.netflix.rxjava.download</groupId>
<artifactId>rxjava-download</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Simple POM to download rxjava and dependencies</name>
<url>http://github.com/ReactiveX/RxJava</url>
<dependencies>
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>2.0.0</version>
<scope/>
</dependency>
</dependencies>
</project>
然后执行:
$ mvn -f download-rxjava-pom.xml dependency:copy-dependencies
该命令下载rxjava-*.jar及其依赖项到./target/dependency/.
您需要Java 6或更高版本。