Skip to content
This repository was archived by the owner on Aug 20, 2019. It is now read-only.
This repository was archived by the owner on Aug 20, 2019. It is now read-only.

AutoTableBindPlugin在maven单元测试中识别classpath的问题 #24

@shadowedge

Description

@shadowedge

您好:
使用AutoTableBindPlugin在maven单元测试时,插件通过PathKit.getRootClassPath()默认识别的classpath是【project_root\target\test-classes\】目录,而这个目录下通常没有项目使用的model文件,因为只是针对测试生成的路径。
由于model文件通常都放置在【project_root\target\classes\】目录下,因此做了一下classpath指定:
String cp = PathKit.getRootClassPath();// target\test-classes
String path = rp.substring(0, cp.lastIndexOf("")).concat("\classes");
atbp.classpath(path);
指定后插件可以扫描到正确的classpath,但出现了另一个问题:获取到的全部class文件都少了一部分内容!即,原本名为foobar.model.demo的class被识别成了“r.model.demo”!
查看了下插件源码,发现open里面依然用了原来的classpath(ClassSearcher的83行):
String open = PathKit.getRootClassPath() + File.separator;
导致自定义的classpath被截断了。
麻烦作者确认下是否为bug?
或者说是classpath设定的使用方法不正确?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions