Last active
March 4, 2016 11:14
-
-
Save LudgerPeters/570708438dbcb3f08106 to your computer and use it in GitHub Desktop.
Annotation Processor causing javac to not return the correct error codes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.test; | |
| import java.util.Set; | |
| import javax.annotation.processing.AbstractProcessor; | |
| import javax.annotation.processing.RoundEnvironment; | |
| import javax.annotation.processing.SupportedAnnotationTypes; | |
| import javax.annotation.processing.SupportedSourceVersion; | |
| import javax.lang.model.element.TypeElement; | |
| import javax.lang.model.SourceVersion; | |
| @SupportedSourceVersion(SourceVersion.RELEASE_8) | |
| @SupportedAnnotationTypes("*") | |
| public class AnnotationProcessor extends AbstractProcessor{ | |
| public AnnotationProcessor() { | |
| System.out.println("Using Test AnnotationProcessor"); | |
| } | |
| @Override | |
| public boolean process(Set<? extends TypeElement> arg0, RoundEnvironment arg1) { | |
| // TODO Auto-generated method stub | |
| return false; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class HelloWorld { | |
| public static void main(String[] args) { | |
| System.out.println("hello world"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| com.test.AnnotationProcessor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| echo running compile with a corrupted jar | |
| javac -cp annotationProcessor.jar;corruptedJar.jar HelloWorld.java | |
| echo Error level %errorlevel% | |
| echo running compile without the corrupted jar | |
| javac -cp annotationProcessor.jar HelloWorld.java | |
| echo Error level %errorlevel% | |
| echo running compile without the annotationProcessor but with the corrupted jar | |
| javac -cp corruptedJar.jar HelloWorld.java | |
| echo Error level %errorlevel% |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I forgot to add the annotation processor meta inf file you can put the javax.annotation.processing.Processor in META-INF\ services\