[英]Getting lift sources from maven repository
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 . 我可以通过从Starting with Lift运行maven命令(之前我没有maven经验)来创建项目框架。 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. 看起来它从这里下载依赖项,并且有编译的.jar文件以及源代码 - 有lift-mapper-1.0.jar和lift-mapper-1.0-sources.jar ,但只下载了lift-mapper-1.0.jar到我的本地存储库。 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? 那么,有没有办法告诉Maven下载与源的依赖关系?
The maven-dependency-plugin has a sources goal that will obtain the sources for all dependencies that are available. maven-dependency-plugin有一个源目标,它将获取所有可用依赖项的源。 Simply run mvn dependency:sources
to obtain the sources. 只需运行mvn dependency:sources
来获取源代码。
If you are using Eclipse, the m2eclipse plugin handles source resolution and attachment for you. 如果您使用的是Eclipse,那么m2eclipse插件会为您处理源解析和附件。 You can set it to automatically obtain sources in the Maven preferences. 您可以将其设置为自动获取Maven首选项中的源。 Window > Preferences... -> Maven , then enable Download Artifact Sources . Window > Preferences ... - > Maven ,然后启用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). 您还可以在任何jar(包括不使用Maven管理的jar)上的Maven弹出菜单中手动调用“Download Sources”操作。 Then plugin will use Maven repository indexes to lookup the corresponding Maven artifact and download its sources. 然后插件将使用Maven存储库索引来查找相应的Maven工件并下载其源。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.