How to copying META-INF directories to output directory?

I'm writing a new CharsetProvider, and it requires that I have a file called java.nio.charset.spi.CharsetProvider in the META-INF/services directory. I have that in my src directory, but when I compile my project the META-INF directory isn't copied over to my classes directory. I've tried adding the name of the file to the compiler resource, but that didn't work. I tried adding META-INF to the resources. That didn't work.

How can I tell Intellij that I need this file copied to the classes directory?

1 comment
Comment actions Permalink

Hello Charlie,

I'm writing a new CharsetProvider, and it requires that I have a file
called java.nio.charset.spi.CharsetProvider in the META-INF/services
directory. I have that in my src directory, but when I compile my
project the META-INF directory isn't copied over to my classes
directory. I've tried adding the name of the file to the compiler
resource, but that didn't work. I tried adding META-INF to the
resources. That didn't work.

How can I tell Intellij that I need this file copied to the classes
directory?


You need to add the name of the file itself (or a wildcard, for example,
*CharsetProvider) to the resource patterns.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.