如何获得org.mangosdk.spi.ProviderFor依赖项以编写自定义Lombok转换? [英] How to get org.mangosdk.spi.ProviderFor dependency for writing a custom Lombok transformation?

查看:340
本文介绍了如何获得org.mangosdk.spi.ProviderFor依赖项以编写自定义Lombok转换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写Lombok自定义转换,但由于Lombok处理程序需要使用org.mangosdk.spi.ProviderFor批注而无法使用,所以在Maven存储库中找不到它,因此我陷入了困境.进行自定义Lombok转换时,应该如何获得这种依赖关系?

I am writing a Lombok custom transformation, but I am stuck because Lombok handlers require using org.mangosdk.spi.ProviderFor annotation, and I can't find it in the Maven repositories. How are you supposed to get that dependency when making a custom Lombok transformation?

我尝试查看如何在 https://github.com/rzwitserloot/lombok,但是它们似乎只是在lib目录中拥有自己的库副本,我认为这是管理依赖项的一种非常灵活的方法,因此我不会在我自己的项目中考虑.

I tried looking at how that dependency is retrieved in https://github.com/rzwitserloot/lombok, but they just seem to have their own copy of the library in lib directory, which I think is a very inflexible way to manage your dependencies, so I wouldn't consider it for my own project.

因此,如果我有一个针对Lombok扩展的Maven项目,该如何获取该org.mangosdk.spi.ProviderFor类?

So if I have a Maven project for a Lombok extension, how should I get that org.mangosdk.spi.ProviderFor class?

推荐答案

Lombok使用Ant + Ivy而不是Maven.龙目岛不需要使用ProviderFor批注.注释所做的只是自动生成META-INF/services文件,该文件已超出标准Java API集.您也可以手动维护此类文件.

Lombok uses Ant+Ivy and not Maven. Lombok does not require the usage of the ProviderFor annotation. All that annotation does is automatically generate the META-INF/services file, which is past of the standard java set of APIs. You can also maintain such a file by hand.

有关服务提供商界面的更多信息,您还可以查看文档的SPI项目.

For more information about the Service Provider Interface, you can also have a look at the documentation of the SPI project.

有一个类似项目当前具有更好的maven支持.

There is a similar project that currently has better maven support.

NB.由于Google Code即将关闭,因此该项目正在迁移到Github

NB. Since Google Code is going down soon, this project is in the process of being migrated to Github

披露:我是Lombok开发人员

Disclosure: I am a Lombok developer

这篇关于如何获得org.mangosdk.spi.ProviderFor依赖项以编写自定义Lombok转换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆