从 Maven 存储库获取 lift 源
我正在努力学习如何使用电梯。我可以通过运行 Starting with Lift< 的 Maven 命令来创建项目框架(我以前的 Maven 经验为零) /a>.它成功下载了所需的依赖项,一切正常,但它不下载源代码 - 我想看看 lift 从内部是如何工作的。
看起来它从这里下载依赖项是已编译的 .jar 文件以及源 - 有 lift-mapper-1.0.jar 和 lift-mapper-1.0-sources.jar,但只有 lift -mapper-1.0.jar 已下载到我的本地存储库。我可以手动下载源代码,但那里的文件夹不止几个。那么,有没有办法告诉Maven下载带有源的依赖项呢?
I'm trying to learn how to use lift. I can create project skeleton by running maven commands (I had zero maven experience before) from Starting with Lift. It successfully downloads needed dependencies and everything works fine, however it does not download sources - I'd like to see how lift works from inside.
Looks like it downloads dependencies from here and there are compiled .jar files as well as sources - there are lift-mapper-1.0.jar and lift-mapper-1.0-sources.jar, but only lift-mapper-1.0.jar is downloaded to my local repository. I could download sources manually, but there are more than just few folders there. So, is there a way to tell it to Maven to download dependencies with sources?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
maven-dependency-plugin 有一个源目标,它将获取源对于所有可用的依赖项。只需运行
mvn dependency:sources
即可获取源代码。如果您使用的是 Eclipse,m2eclipse 插件会为您处理源解析和附件。您可以在 Maven 首选项中将其设置为自动获取源。 窗口 > 首选项...->Maven,然后启用下载工件源。
您还可以从任何 jar(包括那些不使用 Maven 管理的 jar)的 Maven 弹出菜单中手动调用“下载源”操作。然后插件将使用 Maven 存储库索引来查找相应的 Maven 工件并下载其源代码。
The maven-dependency-plugin has a sources goal that will obtain the sources for all dependencies that are available. Simply run
mvn dependency:sources
to obtain the sources.If you are using Eclipse, the m2eclipse plugin handles source resolution and attachment for you. You can set it to automatically obtain sources in the Maven preferences. Window > Preferences...->Maven, then enable Download Artifact Sources.
You can also manually invoke "Download Sources" action from the Maven popup menu on any jars (including those that are not managed with Maven). Then plugin will use Maven repository indexes to lookup the corresponding Maven artifact and download its sources.