简体   繁体   English

附加源-Maven相关性[NetBeans]

[英]Attach Sources - Maven Dependancies [NetBeans]

I am running NetBean 7.4 on Mac and I am sort of new to Maven dependancies. 我在Mac上运行NetBean 7.4,并且对Maven依赖关系有点陌生。 I have been given a project that uses Maven to download a framework for networking simulation. 我得到了一个使用Maven下载网络仿真框架的项目。 Turned out that the framework has a bug and the teacher gave us a public GitHub repository with all the source code for the framework, so that we can also modify it. 原来,该框架存在错误,老师给了我们一个公共GitHub存储库,其中包含该框架的所有源代码,以便我们也可以对其进行修改。

How do I connect the GitHub link (with sources) to NetBeans in order to being able to modify the framework classes? 我如何将GitHub链接(带有源代码)连接到NetBeans,以便能够修改框架类? The "Attach Sources..." button that appears on the framework classes asks for a JAR or ZIP (if I download the ZIP from GitHub it doesn't work). 出现在框架类上的“附加源...”按钮要求提供JAR或ZIP(如果我从GitHub下载ZIP,则无法使用)。 Moreover, it looks like the framework files in the Dependancies folder cannot be modified anyway (read-only files). 而且,看起来Dependancies文件夹中的框架文件仍然无法修改(只读文件)。

Thank you all. 谢谢你们。

to "connect" 2 different projects, the checked out source's version needs to be equal to the version in maven pom.xml. 要“连接” 2个不同的项目,检出源的版本必须等于maven pom.xml中的版本。

So clone the github repository, figure out which branch/tag matches the version in your project and check it out. 因此,克隆github存储库,找出哪个分支/标记与项目中的版本匹配并进行检查。 Then open the project(s). 然后打开项目。 If you did that correctly (and assuming the github project is actually maven), your project's dependencies section will list them with project-like icon. 如果您正确地做到了这一点(并假设github项目实际上是Maven),则您项目的依赖项部分将使用类似项目的图标列出它们。 Then the projects are linked. 然后将项目链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM