Converting package level Java annotation to Kotlin

Is it possible to convert a package level Java annotation to Kotlin?

Java annotation (

package com.myexample.annotation;

@Retention(RUNTIME) @Target(PACKAGE)
public @interface MyAnnotation {


Application of annotation (

package com.myexample

The following does not seem to work (although it does compile) - my annotation processor does not detected any of the classes in the package com.myexample:


package com.myexample.annotation

@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.FILE])
annotation class MyAnnotation


package com.myexample

import com.myexample.annotation.MyAnnotation