Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sisu-users] Annotation processor not picking custom qualifiers


Hello,

I have a custom qualifier defined as follows:

@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Qualifier
public @interface MyQualifier {
}


@MyQualifier
public class MyComponent {

}

And I am using the sisu annotation processor in the maven build of my osgi application to produce the Named index:

            <plugin>
                <groupId>org.eclipse.sisu</groupId>
                <artifactId>sisu-maven-plugin</artifactId>
                <version>0.3.0</version>
                <executions>
                    <execution>
                        <id>index-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>index</goal>
                        </goals>
                        <configuration>
                            <!-- same include/exclude settings as maven-dependency-plugin -->
                        </configuration>
                    </execution>
                </executions>
            </plugin>

It turns out that classes annotated @Named show up in the index, while classes annotated @MyQualifier don't.

What am I doing wrong? This was tricky to find out because in development I am using BeanScanning=ON
while when deploying the final application I am using BeanScanning=INDEX under the assumption that the APT
would list in the index file also classes featuring my custom qualifier.



Back to the top