Search code examples
javamavenjarmeta-inf

No .class file in the jar when adding a META-INF/services directory


I've just started to use Maven and I am having trouble creating a JAR of all my classes. In fact, I have to include a service located at WEB-INF/services/javax.annotation.processing.Processor

I've tested different issues with this problem and it appears that when I remove the /services directory, the JAR contains all the .class files.

I read that it could be a wrong Maven folder structure but the problem occurs just when I have the servicesdirectory present.

Here is an extract of my pom.xml file working with resources:

<resource>
    <directory>${myRessources}</directory>
        <includes>
            <include>META-INF/**/*</include>
         </includes>
</resource>

The maven console tell me that the resource is successfully copied so I assume this part is not the problem.

Any ideas?


Solution

  • I investigate and solved the problem : it was a bug --> http://jira.codehaus.org/browse/MCOMPILER-97 I add the compiler option -proc:none and it works fine now. Hope it helps other people !