File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/jar Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2012-2014 the original author or authors.
2
+ * Copyright 2012-2015 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -308,18 +308,19 @@ private void visitModule(ModuleNode module) {
308
308
// We only need to do it at most once
309
309
break ;
310
310
}
311
- // Remove GrabReolvers because all the dependencies are local now
312
- removeGrabResolver (module .getClasses ());
313
- removeGrabResolver (module .getImports ());
311
+ // Disable the addition of a static initializer that calls Grape.addResolver
312
+ // because all the dependencies are local now
313
+ disableGrabResolvers (module .getClasses ());
314
+ disableGrabResolvers (module .getImports ());
314
315
}
315
316
316
- private void removeGrabResolver (List <? extends AnnotatedNode > nodes ) {
317
+ private void disableGrabResolvers (List <? extends AnnotatedNode > nodes ) {
317
318
for (AnnotatedNode classNode : nodes ) {
318
319
List <AnnotationNode > annotations = classNode .getAnnotations ();
319
320
for (AnnotationNode node : new ArrayList <AnnotationNode >(annotations )) {
320
321
if (node .getClassNode ().getNameWithoutPackage ()
321
322
.equals ("GrabResolver" )) {
322
- annotations . remove ( node );
323
+ node . setMember ( "initClass" , new ConstantExpression ( false ) );
323
324
}
324
325
}
325
326
}
You can’t perform that action at this time.
0 commit comments