如何从Maven项目外部链接源? [英] How to link source from outside of maven project?

查看:100
本文介绍了如何从Maven项目外部链接源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Maven中,是否可以从项目文件夹外部链接其他依赖的java src,以便在构建主程序包时,maven可以将此类包含在最终的jar中? 就像我们可以在Eclipse中将任何源文件夹链接到我们的项目一样,而eclipse会将其视为常规项目源吗?

In Maven, is it possible to link additional dependent java src from outside the project folders, so that when we build our main package, maven may include such classes into final jar?
just as we can link any source folder to our project in Eclipse and eclipse treats it as regular project source?

推荐答案

在Maven中,是否可以从项目文件夹外部链接其他依赖的Java src

In Maven, is it possible to link additional dependent java src from outside the project folders

从技术上讲,可以将源文件夹添加到内部版本,通常使用构建辅助工具-maven-插件.但是,对于在给定模块 outside 中的目录,我建议不要这样做,maven模块应该是自包含的.

Technically, it's possible to add source folders to a build and this is usually done using the build-helper-maven-plugin. However, I would recommend against doing so for directories outside a given module, a maven module should be self contained.

这篇关于如何从Maven项目外部链接源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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