atteo / classindex

Index classes, do not scan them!
Apache License 2.0
263 stars 42 forks source link

No index file is generated after compile #44

Closed saadhamouine closed 6 years ago

saadhamouine commented 6 years ago

I have added classindex 3.4 as a maven dependency. The jar is included in the project classpath.

I'm using the @IndexSubclasses annotation on a class but after i compile no index file is generated. Does this work or am I missing a step?

I would appreciate some help!

marembo2008 commented 6 years ago

The issue might be that the annotation processor was not marked up during the compile phase. Which maven version are you using? This should normally be detected automatically through classpath scanning. You may need to add it explicitly on the maven-compiler-plugin, to determine that the plugin is actually failing to detect annotation processors in classpath: https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessors

saadhamouine commented 6 years ago

I'm using maven 3.5.2

saadhamouine commented 6 years ago

I have added this in the maven compiler plugin config:

<annotationProcessorPaths>
    <path>
        <groupId>org.atteo.classindex</groupId>
            <artifactId>classindex</artifactId>
        <version>3.4</version>
     </path>
</annotationProcessorPaths>

but still nothing.

sentinelt commented 6 years ago

@saadhamouine Hi, I'm just guessing, but maybe you are missing the fact, that @IndexSubclasses marks a class (or interface) whose subclasses (classes implementing interface) should be indexed?

sentinelt commented 6 years ago

@saadhamouine

I have also created a simple example: https://github.com/atteo/classindex-maven-example. After you 'mvn compile' the project, just see the content of file ' target/classes/META-INF/services/org.example.Entity'

saadhamouine commented 6 years ago

@sentinelt Hi, thank you for your response. what do you mean by subclasses should be indexed?

saadhamouine commented 6 years ago

@sentinelt It works now but the classes folder is not shown in eclipse i only find it with win file explorer. Do you know why is that?

saadhamouine commented 6 years ago

@sentinelt it's still not totaly working because jaxb doesn't fine the index files for data binding.