Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not support annotationProcessors #138

Closed
renatoathaydes opened this issue Sep 8, 2015 · 2 comments
Closed

Does not support annotationProcessors #138

renatoathaydes opened this issue Sep 8, 2015 · 2 comments
Labels

Comments

@renatoathaydes
Copy link

The Maven Compiler plugin supports declaration of annotation processors like this:

<annotationProcessors>
<annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor>
</annotationProcessors>

When I use this with the Groovy Eclipse plugin, an error occurs:

Compilation failure
[ERROR] Failure executing groovy-eclipse compiler:
[ERROR] Unrecognized option : -processor
@eric-milles
Copy link
Member

Batch compiler does have support for this option. There is a bug in the compiler adapter.

        if (config.getAnnotationProcessors() != null) {
            StringBuilder procArg = new StringBuilder();
            for (String proc : config.getAnnotationProcessors()) {
                if (proc != null && proc.trim().length() > 0) {
                    procArg.append(proc);
                    procArg.append(",");
                }
            }
            if (procArg.length() > 0) {
                procArg.replace(procArg.length() - 1, procArg.length(), "");
                args.put("-processor ", "\"" + procArg.toString() + "\"");
            }
        }

Extra space after -processor prevents recognition of the compiler argument.

@eric-milles
Copy link
Member

Fixed compiler adapter (revision 2.9.2-02) available through bintray.

  <pluginRepositories>
    ...
    <pluginRepository>
      <id>bintray</id>
      <name>Groovy Bintray</name>
      <url>https://dl.bintray.com/groovy/maven</url>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants