小编use*_*901的帖子

是否可以使用reflection-maven扫描web-Inf/lib中jar中的类?

我需要在maven构建过程中为特定接口创建一个子类列表,然后在运行时使用它来加载这些类.我在我的webapp pom中添加了reflection-maven(来自谷歌代码反射),但在maven构建期间,它只包括来自Web应用程序的类,而不包括该应用程序web-inf/lib文件夹中的打包jar中的类.以下是我使用的直接配置.我查看了插件源代码,它似乎扫描了以下内容:getProject().getBuild().getOutputDirectory().

反正我是否可以配置插件来扫描项目的相关jar文件?

<plugin>
    <groupId>org.reflections</groupId>
    <artifactId>reflections-maven</artifactId>
    <version>0.9.9-RC1</version>
    <executions>
        <execution>
            <goals>
                <goal>reflections</goal>
            </goals>
            <phase>process-classes</phase>
        </execution>
    </executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)

jar class maven reflections

1
推荐指数
1
解决办法
2595
查看次数

标签 统计

class ×1

jar ×1

maven ×1

reflections ×1