Commit d6486036 authored by Phillip Webb's avatar Phillip Webb

Exclude *.jar and *.groovy from generated JARs

Update `JarCommand` to exclude `**/*.groovy` and `**/*.jar` by default.
parent c852fb5a
......@@ -68,6 +68,12 @@ import org.springframework.util.StringUtils;
*/
public class JarCommand extends OptionParsingCommand {
private static final String[] DEFAULT_INCLUDES = { "public/**", "static/**",
"resources/**", "META-INF/**", "*" };
private static final String[] DEFAULT_EXCLUDES = { ".*", "repository/**", "build/**",
"target/**", "**/*.jar", "**/*.groovy" };
private static final Layout LAYOUT = new Layouts.Jar();
public JarCommand() {
......@@ -93,13 +99,11 @@ public class JarCommand extends OptionParsingCommand {
this.includeOption = option(
"include",
"Pattern applied to directories on the classpath to find files to include in the resulting jar")
.withRequiredArg().defaultsTo("public/**", "static/**",
"resources/**", "META-INF/**", "*");
.withRequiredArg().defaultsTo(DEFAULT_INCLUDES);
this.excludeOption = option(
"exclude",
"Pattern applied to directories on the claspath to find files to exclude from the resulting jar")
.withRequiredArg().defaultsTo(".*", "repository/**", "build/**",
"target/**");
.withRequiredArg().defaultsTo(DEFAULT_EXCLUDES);
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment