Skip to content

Commit 16cb44f

Browse files
committed
Merge branch '1.1.x'
2 parents 0074e9d + 376de01 commit 16cb44f

File tree

1 file changed

+7
-6
lines changed
  • spring-boot-cli/src/main/java/org/springframework/boot/cli/command/jar

1 file changed

+7
-6
lines changed

spring-boot-cli/src/main/java/org/springframework/boot/cli/command/jar/JarCommand.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2014 the original author or authors.
2+
* Copyright 2012-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -308,18 +308,19 @@ private void visitModule(ModuleNode module) {
308308
// We only need to do it at most once
309309
break;
310310
}
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());
314315
}
315316

316-
private void removeGrabResolver(List<? extends AnnotatedNode> nodes) {
317+
private void disableGrabResolvers(List<? extends AnnotatedNode> nodes) {
317318
for (AnnotatedNode classNode : nodes) {
318319
List<AnnotationNode> annotations = classNode.getAnnotations();
319320
for (AnnotationNode node : new ArrayList<AnnotationNode>(annotations)) {
320321
if (node.getClassNode().getNameWithoutPackage()
321322
.equals("GrabResolver")) {
322-
annotations.remove(node);
323+
node.setMember("initClass", new ConstantExpression(false));
323324
}
324325
}
325326
}

0 commit comments

Comments
 (0)