From 158b6a5c074ad57250bae7477b54d4e942b79c08 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 15 May 2014 10:36:23 +0200 Subject: [PATCH] Skip the execution of repackage in parent projects If an execution of the repackage goal is present in a project with 'pom' packaging, it is now skipped. This allows to configure the plugin in the parent. Fixes gh-867 --- .../src/it/jar-pom/pom.xml | 41 +++++++++++++++++++ .../boot/maven/RepackageMojo.java | 5 +++ 2 files changed, 46 insertions(+) create mode 100644 spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml new file mode 100644 index 0000000000..86bffdcc61 --- /dev/null +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-pom + pom + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + + + + + + + org.springframework + spring-context + 3.2.3.RELEASE + + + javax.servlet + javax.servlet-api + 3.0.1 + provided + + + diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java index 135bf50971..12ba6db928 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java +++ b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java @@ -110,6 +110,11 @@ public class RepackageMojo extends AbstractDependencyFilterMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { + if (project.getPackaging().equals("pom")) { + getLog().debug("repackage goal could not be applied to pom project."); + return; + } + File source = this.project.getArtifact().getFile(); File target = getTargetFile(); Repackager repackager = new Repackager(source) {