How to get org.mangosdk.spi.ProviderFor dependency for writing a custom Lombok transformation?

回眸只為那壹抹淺笑 提交于 2019-12-21 05:04:56

问题


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?

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.

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


回答1:


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.

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

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

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

Disclosure: I am a Lombok developer




回答2:


use the unofficial maven repository 'http://www.ebi.ac.uk/~maven/m2repo'



来源:https://stackoverflow.com/questions/30217603/how-to-get-org-mangosdk-spi-providerfor-dependency-for-writing-a-custom-lombok-t

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!