如何组织和共享实用程序库/类(不是代码片段)
我多年来在各种项目中编写了许多临时和通用实用程序类。 其中一些是其他库的包装器/适配器。
对于 Java 来说,共享此代码是一个挑战,因为每个实用程序类可能具有非常不同的依赖项(例如,我有一些类需要 guava,而其他类则需要 commons-lang)。
显而易见的选择是github我的代码并博客关于它。令人烦恼的是,我为每个实用程序类创建了一个项目(Maven pom)(更不用说很多 jar 了)。
其他人如何共享实用程序代码(不是完整的库)?
I have many many adhoc and general utility classes that I have written over the years in various projects.
Some of them are wrappers/adapters to other libraries.
For Java its a challenge to share this code because each utility class may have very different dependencies (for example I have some classes that require guava and others commons-lang).
The obvious choice is to github my code and blog about it. Annoyingly I have make a project (Maven pom) for each utility class (not to mention lots of jars).
How do others share utility code (not full blow libraries)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您只是想保存它们,但不想制作一个完整的项目,请尝试https: //gist.github.com。如果您也发表了相关博客,则可以加分,您可以将要点直接嵌入到您的博客文章中。
If they're things you just want to save, but don't want to make a full-blown project out of, try https://gist.github.com. Bonus points if you blog about it too, you can embed the gist directly in your blog post.
Apache commons 库提供了许多实用程序类。它们被分组到具有相关功能的库中。也许您可以为这些库做出贡献来共享您的代码。
The Apache commons libraries provide a lot of utility classes. They are grouped together into libraries with related functionality. Perhaps you could contribute to these libraries to share your code.