testable-agent dependence is required in order to have agent jar downloaded

This commit is contained in:
金戟 2020-11-28 19:52:20 +08:00
parent b4d6a8357e
commit 7b273affe3
5 changed files with 33 additions and 9 deletions

14
.gitignore vendored
View File

@ -1,10 +1,9 @@
# maven ignore
target/
*.jar
*.war
*.zip
*.tar
*.tar.gz
# gradle ignore
build/
.gradle/
# eclipse ignore
.settings/
@ -34,3 +33,8 @@ Thumbs.db
# others
note/
*.jar
*.war
*.zip
*.tar
*.tar.gz

View File

@ -21,6 +21,12 @@
<version>${testable.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.alibaba.testable</groupId>
<artifactId>testable-agent</artifactId>
<version>${testable.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>

View File

@ -34,6 +34,12 @@
<version>${testable.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.alibaba.testable</groupId>
<artifactId>testable-agent</artifactId>
<version>${testable.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>

View File

@ -19,7 +19,7 @@
</properties>
```
在`dependencies`列表添加`testable-processor`依赖:
在`dependencies`列表添加TestableMock依赖:
```xml
<dependencies>
@ -29,6 +29,12 @@
<version>${testable.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.alibaba.testable</groupId>
<artifactId>testable-agent</artifactId>
<version>${testable.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
```
@ -56,11 +62,13 @@
## 在Gradle项目中使用
在`build.gradle`文件中添加`testable-processor`依赖:
在`build.gradle`文件中添加TestableMock依赖:
```groovy
dependencies {
testCompile('com.alibaba.testable:testable-processor:0.3.1')
testImplementation('com.alibaba.testable:testable-processor:0.3.1')
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.3.1')
testRuntimeOnly('com.alibaba.testable:testable-agent:0.3.1')
}
```

View File

@ -19,7 +19,7 @@
</plugin>
```
> 当使用`testable-maven-plugin`插件时,应该移除`maven-surefire-plugin`插件上的TestableMock相关配置
> 当使用`testable-maven-plugin`插件时,应该移除`maven-surefire-plugin`插件上的TestableMock相关配置,同时可以从项目的`pom.xml`文件中移除对`com.alibaba.testable:testable-agent`包的显示依赖
`testable-maven-plugin`插件能够与Jacoco插件直接同时使用无需额外适配因此能使`pom.xml`文件编写起来更简单且美观。