Grails

Annotations defined in plugin cause compile error

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.2 final
  • Fix Version/s: 1.2.1
  • Component/s: Plugins
  • Labels:
    None

Description

If a plugin has an annotation defined in src/groovy then grails will fail to start when the plugin is used in a project.

Here is the error:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, /Users/mike/.grails/1.2.0/projects/Patheos/plugins/solr-0.1/src/groovy/com/patheos/grails/solr/Solr.groovy: -1: Annotation @org.codehaus.groovy.grails.plugins.metadata.GrailsPlugin is not allowed on element ANNOTATION
[groovyc] @ line -1, column -1.

And here is the Annotation class it's complaining about:

package com.patheos.grails.solr
import java.lang.annotation.*

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Solr {
String field();
}

Activity

Hide
Mike Brevoort added a comment -

Note, if I change the class to a java class it works now. This worked on 1.1.1 with a groovy annotation class. Assuming the GrailsPlugin annotation is new.

Show
Mike Brevoort added a comment - Note, if I change the class to a java class it works now. This worked on 1.1.1 with a groovy annotation class. Assuming the GrailsPlugin annotation is new.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: