简体   繁体   English

如何使用第三方 java 库 github 项目?

[英]How do I make use of a third-party java library github project?

When there's no obvious compiled jars provided on a github project page, I've been downloading the clear code and kludging them into subdirectories in my codebase to make use of third party code (or, most of the time, just not using the code at all).当 github 项目页面上没有提供明显的已编译 jars 时,我一直在下载清晰的代码并将它们放入我的代码库的子目录中以使用第三方代码(或者,大多数时候,只是不使用代码全部)。 I know that's not the right way to go about this;我知道这不是 go 的正确方式; what is?什么是?

There's a popular post about importing github projects into Eclipse: Importing a GitHub project into Eclipse ...and I've recently learned how to make my own projects depend on one another.有一篇关于将 github 项目导入 Eclipse 的热门帖子: 将 GitHub 项目导入 Eclipse ...我最近学会了如何让我自己的项目相互依赖。 Is this the practice, then, to fill up your workspace with projects you're not actually going to work on, so that you can declare dependencies?那么,这是不是用你实际不打算处理的项目来填充你的工作空间,以便你可以声明依赖关系的做法? I remember making dependency references to web resources in the past (itch.io, maybe?) in some configuration, where I didn't have to go download the code.我记得过去在某些配置中对 web 资源进行依赖引用(可能是 itch.io?),我不必 go 下载代码。 Is there a more elegant solution like that for github?有没有像 github 这样更优雅的解决方案?

I'm using Eclipse, and the current library I'd like to use is: https://github.com/FasterXML/jackson我正在使用 Eclipse,我想使用的当前库是: https://github.com/FasterXML/jackson

If you're trying to just use FasterXML, the jars are hosted on MvnRepository as well as a lot of other projects.如果您只想使用 FasterXML,jars 托管在MvnRepository以及许多其他项目上。

If a github project's artifact isn't available on MvnRepository or some other online repository you could potentially clone, build the war/jar file yourself, and then manually import it into your project instead of copy and pasting code directly into your project.如果 github 项目的工件在 MvnRepository 或其他在线存储库中不可用,您可以克隆、自己构建 war/jar 文件,然后手动将其导入到您的项目中,而不是将代码直接复制和粘贴到您的项目中。 This would give you access to the library.这将使您可以访问图书馆。

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

相关问题 如何在TeamCity构建的Java项目中引用第三方jar库? - How do I reference third-party jar libraries into a Java project being built by TeamCity? 我(可以)轻松地使用第三方库来处理Java RMI的序列化吗? - Can I (easily) use a third-party library to handle serialization for Java RMI? 如果没有第三方库,您可以在Java 7中进行基本的EC操作吗? - Can you do basic EC operations in Java 7 without a third-party library? Android Studio:根据第三方库的来源制作应用程序 - Android Studio: make application depending on sources of third-party library 维护第三方Java库依赖项的补丁 - Maintaining patches of third-party Java library dependencies 在Java中检测和处理第三方库文件句柄泄漏 - Detecting and handling third-party library filehandle leaks in Java 引用在 Java 中使用第三方库的类 - reference a class that uses a third-party library in Java 如何自动列出Java + React项目中使用的所有第三方组件? - How to automatically list all third-party components used in a java + React project? 如何模拟来自第三方库的类的静态调用 - How to mock a static call on a class from a third-party library 我可以在 java 中使用第三方 scala 库吗? - Can I use a third party scala library in java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM