Remove @GrabResolvers before packaging jar in CLI
Since all dependencies are local in a jar there is no need for a GrabResolver (and it breaks the app because the default ivy GrapeEngine is used instead of the smart, pretty Boot one). Fixes gh-1179
This commit is contained in:
@@ -59,6 +59,23 @@ public class JarCommandIT {
|
||||
+ "resulting jar and at least one source file must be specified"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void jarCreationWithGrabResolver() throws Exception {
|
||||
File jar = new File("target/test-app.jar");
|
||||
Invocation invocation = this.cli.invoke("jar", jar.getAbsolutePath(),
|
||||
"bad.groovy");
|
||||
invocation.await();
|
||||
assertEquals(invocation.getErrorOutput(), 0, invocation.getErrorOutput().length());
|
||||
assertTrue(jar.exists());
|
||||
|
||||
Process process = new JavaExecutable().processBuilder("-jar",
|
||||
jar.getAbsolutePath()).start();
|
||||
invocation = new Invocation(process);
|
||||
invocation.await();
|
||||
|
||||
assertThat(invocation.getErrorOutput(), equalTo(""));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void jarCreation() throws Exception {
|
||||
File jar = new File("target/test-app.jar");
|
||||
|
||||
6
spring-boot-cli/src/it/resources/jar-command/bad.groovy
Normal file
6
spring-boot-cli/src/it/resources/jar-command/bad.groovy
Normal file
@@ -0,0 +1,6 @@
|
||||
@GrabResolver(name='clojars.org', root='http://clojars.org/repo')
|
||||
@Grab('redis.embedded:embedded-redis:0.2')
|
||||
|
||||
@Component
|
||||
class EmbeddedRedis {
|
||||
}
|
||||
Reference in New Issue
Block a user