@@ -182,7 +182,7 @@ private Object getMainClass(Jar bootJar) {
182182 }
183183
184184 private Task createPomTask (final Project project ) {
185- return project .getTasks ().create ("thinPom" , PomTask .class , new Action <PomTask >() {
185+ Task result = project .getTasks ().create ("thinPom" , PomTask .class , new Action <PomTask >() {
186186 @ Override
187187 public void execute (final PomTask thin ) {
188188 project .getTasks ().withType (Jar .class , new Action <Jar >() {
@@ -203,7 +203,14 @@ public void execute(Task task) {
203203 thin .setOutput (new File (resourcesDir , "META-INF/maven/"
204204 + project .getGroup () + "/" + project .getName ()));
205205 }
206- }).mustRunAfter ("resolveMainClassName" , "test" );
206+ });
207+ if (project .getTasks ().findByName ("resolveMainClassName" ) != null ) {
208+ result .mustRunAfter ("resolveMainClassName" , "test" );
209+ }
210+ if (project .getTasks ().findByName ("bootJarMainClassName" ) != null ) {
211+ result .mustRunAfter ("bootJarMainClassName" , "test" );
212+ }
213+ return result ;
207214 }
208215
209216 private Task createPropertiesTask (final Project project ) {
@@ -291,7 +298,7 @@ public void execute(Task task) {
291298 List <String > args = new ArrayList <>(Arrays .asList (
292299 "-Dthin.root=." , "-Dthin.dryrun" , "-jar" ,
293300 "../spring-boot-thin-wrapper.jar" ));
294- args .add (1 , "-Dthin.archive=" + thinJar .getArchiveName ());
301+ args .add (1 , "-Dthin.archive=" + thinJar .getArchivePath ());
295302 String thinRepo = getThinRepo (project );
296303 if (thinRepo != null ) {
297304 args .add (1 , "-Dthin.repo=" + thinRepo );
0 commit comments