更新时间:2023-09-18 08:49:58
简短答案:否.
长答案:一旦声明了依赖关系(无论是在公共部分还是在活动配置文件中),当Maven尝试进行依赖时,它都必须是可解析的;否则,构建将失败.
Long answer: Once dependency is declared - either in common part or in an active profile - it must be resolvable when Maven attempts it; otherwise the build fails.
如果maven允许请求的行为,则构建的可重复性将受到很大影响.
If maven allowed the requested behavior, the reproducibility of build would suffer a lot.
如果晦涩难懂和不可复制性对您来说不是问题,那么这里有一个提示:
If obscurity and irreproducibility is not an issue for you, here is a hint how to do it:
无论如何,我强烈不鼓励将这些东西包括进Maven构建中.将其作为单独的功能(通过命令行中的ant调用)通常就足够了.
In any case, I strongly discourage including such things into maven build. Having it as separate functionality, invoked via ant from commandline, might often be enough.