jmeter依赖jar包找不到类路径

这两天我在纠结这个问题,为啥我maven打包放在jmeter路径下后,jmeter的bean Shell 就是找不到这个类。
纠结很久解开了。我记录下,留给后来的朋友。  

Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase; import com.aliba . . . '' : Typed variable declaration : Class: GatewayEncryptReq not found in namespace

        后来看了本次打包的路径是这样子的。

        很明显这块有一个BOOT-INF/classes 路径,阻碍了jmeter正确识别到类。

        如果想知道自己jar包里面长啥样的可以看这个:

        jar tf  test-demo.jar 

        下一步就是去掉这个BOOT-INF/classes ,让jmeter的beanshell正确识别到jar包里面的类。

        

<plugin>
       <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
        <skip>true</skip>
         </configuration>
</plugin>

        一定要加configuration

        再次打包就会变成不带BOOT-INF/classes的

        将jar包再次引入jmeter,成功识别到类。

        噢耶~~ 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值