Change additional metadata file lookup logic

Update ConfigurationMetadataAnnotationProcessor to find the additional
metadata json file using createResource rather than getResource. Prior
to this commit the file could be skipped when multiple files were
contained on the classpath.

Fixes gh-2271
pull/2300/head
Phillip Webb 10 years ago
parent 44d81d43f6
commit 7c29c96da6

@ -343,14 +343,10 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
private ConfigurationMetadata mergeManualMetadata(ConfigurationMetadata metadata) {
try {
FileObject manualMetadata = this.processingEnv.getFiler().getResource(
StandardLocation.CLASS_PATH, "",
FileObject manualMetadata = this.processingEnv.getFiler().createResource(
StandardLocation.CLASS_OUTPUT, "",
"META-INF/additional-spring-configuration-metadata.json");
if (!"file".equals(manualMetadata.toUri().getScheme())) {
// We only want local files, not any classpath jars
return metadata;
}
InputStream inputStream = manualMetadata.openInputStream();
InputStream inputStream = manualMetadata.toUri().toURL().openStream();
try {
ConfigurationMetadata merged = new ConfigurationMetadata(metadata);
try {

Loading…
Cancel
Save