在pom文件中test case类间的依赖如何配置

本文介绍如何通过Maven配置实现不同项目间测试用例的复用。主要步骤包括:将待复用的测试用例进行打包并放置到仓库中;在使用该测试用例的项目的pom文件中添加相应的依赖。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

如果app-bs中的test case类需要用到exa-client中test case的类:
1. 把exa-client的test case打包放到repository目录中.
在exa-client的pom文件中增加下面配置:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

2. 在app-bs的pom文件中增加对exa-client test case依赖.

<dependency> <!-- reuse src/test/java code from exa-client -->
<groupId>exa</groupId>
<artifactId>exa-client</artifactId>
<version>${exa.platform.version}</version>
<scope>test</scope>
<classifier>tests</classifier> <!-- for example, the build test jar is named "exa-client-2.4.0-SNAPSHOT-tests.jar"-->
</dependency>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值