Adding services
See also: Services
You can add service declarations to your archive using the Services
parameter:
saker.jar.create(
Services: {
javax.annotation.processing.Processor: example.MyAnnotationProcessor
}
)
The above will cause the archive to contain a service declaration file with the path META-INF/services/javax.annotation.processing.Processor
that declares the example.MyAnnotationProcessor
implementation class.
You can specify multiple services and multiple implementation names as well:
saker.jar.create(
Services: {
example.one.Service: [
example.one.FirstServiceImplementation,
example.one.SecondServiceImplementation
],
example.two.Service: example.two.ServiceImplementation
}
)