I'm developing an annotation processor. And here is a classic maven project structrue.
project
- src/main
- java // SOURCE_PATH
- resources // SOURCE_PATH
- target
- classes // CLASS_PATH and CLASS_OUTPUT
- generated-sources
- annotations // SOURCE_OUTPUT
Everything is ok in maven with javac. But when I want to intergrate it into eclipse, I find eclipse apt only support CLASS_OUTPUT
and SOURCE_OUTPUT
.
I think CLASS_OUTPUT
is also ok because it's equals to CLASS_PATH
. Then I get the following exception
org.eclipse.core.internal.resources.ResourceException: Resource '/test-annotation-use-processer/target/classes/config.properties' does not exist.
at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:335)
at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:209)
at org.eclipse.core.internal.resources.File.getContents(File.java:275)
at org.eclipse.core.internal.resources.File.getContents(File.java:268)
at org.eclipse.jdt.internal.apt.pluggable.core.filer.IdeInputFileObject.openInputStream(IdeInputFileObject.java:86)
Well, the file does exists in disk. I don't know what's wrong for eclipse.
Is there any workaround to get resource in eclipse apt?
Filer
. I think it is relative to eclipse workspace (a vitrual path). If not, it is a bug for eclispe. – Mikkel