Extensible Applications using META-INF/services

Answered

Hello,

I need to add support to Extensible Applications in my java application. They way to do it is by creating META-INF/services in the src directory. Inside that directory I need to add a file with name containing the classes and package name.
How can I do it using Intellij? Do I need to manually creating this and than adding it to Intellij, if so, how do I add it to the project to be included? Is it done using intellij?

Thanks,

0
6 comments

I recommend creating the resources directory (next to your src directory) with META-INF/services. All the files from the directory that is configured as the resource root will be available in the application classpath. See https://www.jetbrains.com/help/idea/configuring-content-roots.html .

1
Avatar
Permanently deleted user

Do I create the resources directory from Intellij or from the Windows Explorer?

0

Either way will work, why not create it with IntelliJ IDEA?

0
Avatar
Permanently deleted user

I am trying to Add content root after creating the META-INF/services but getting error.

I've attached screenshot including the project structure.

0

You don't need to add the new content root, just mark the resources directory as the Resources.

0
Avatar
Permanently deleted user

Working!!!.

Thanks,

0

Please sign in to leave a comment.