Maven插件类加载 [英] Maven plugin classloading

查看:145
本文介绍了Maven插件类加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以解释核心类加载器的加载方式资源,例如,何时使用surefire测试插件?

Could anybody please explain how the Core Classloader loads resources when, for instance, surefire test plugin is used?

我特别需要知道的是加载来自目标/类+目标/测试类以及项目依赖项的项目源和资源的顺序.

What I'd especially need to know is the order in which project sources and resources from target/classes + target/test-classes AND project dependencies are loaded.

例如,如果我有一个既存在于项目中又存在于依赖项中的资源.首先加载哪个?

For instance, if I have a resource which exists both in a project and in a dependency. Which one is loaded first?

谢谢

推荐答案

原来答案很简单.

首先,可以在调试模式下看到插件类路径$ mvn test -X

First off, one can see the plugin classpath in the debug mode, $mvn test -X

第一个条目是target/test-classes,然后是target/classes,然后是插件以及所有项目依赖项.

And the first entry is target/test-classes, then target/classes and then plugins and all the project dependencies.

这篇关于Maven插件类加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆