title: execution default of spring-boot-maven-plugin repackage failed
body: <p>I've got a simple <a href="https://github.com/lapots/hero-journey" rel="nofollow noreferrer">project</a> that is doing nothing for now and which is just a simple <code>Spring Boot 2</code> application which supposed to use <code>java 9</code>.</p>
  
  <p>When I run <code>mvnw clean package</code> over <code>hero-journey</code> folder I get this error</p>
  
  <pre><code>ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.M5:repackage (default) on project hero-journey-web: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.M5:repackage failed.: RuntimeException -&gt;
   [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.M5:repackage (default) on project hero-journey-web: Execution default of goal org.springframework.boot:spring-boot-maven-plugin
  :2.0.0.M5:repackage failed.
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:564)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:564)
          at org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:39)
          at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:122)
          at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:50)
  Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.M5:repackage failed.
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
          ... 27 more
  Caused by: java.lang.RuntimeException
          at org.springframework.asm.ClassVisitor.visitModule(ClassVisitor.java:148)
          at org.springframework.asm.ClassReader.readModule(ClassReader.java:762)
          at org.springframework.asm.ClassReader.accept(ClassReader.java:663)
          at org.springframework.asm.ClassReader.accept(ClassReader.java:527)
          at org.springframework.boot.loader.tools.MainClassFinder.createClassDescriptor(MainClassFinder.java:267)
          at org.springframework.boot.loader.tools.MainClassFinder.doWithMainClasses(MainClassFinder.java:223)
          at org.springframework.boot.loader.tools.MainClassFinder.findSingleMainClass(MainClassFinder.java:203)
          at org.springframework.boot.loader.tools.Repackager.findMainMethod(Repackager.java:365)
          at org.springframework.boot.loader.tools.Repackager.findMainMethodWithTimeoutWarning(Repackager.java:354)
          at org.springframework.boot.loader.tools.Repackager.buildManifest(Repackager.java:325)
          at org.springframework.boot.loader.tools.Repackager.repackage(Repackager.java:255)
          at org.springframework.boot.loader.tools.Repackager.repackage(Repackager.java:248)
          at org.springframework.boot.loader.tools.Repackager.repackage(Repackager.java:193)
          at org.springframework.boot.maven.RepackageMojo.repackage(RepackageMojo.java:221)
          at org.springframework.boot.maven.RepackageMojo.execute(RepackageMojo.java:208)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
          ... 28 more
  [ERROR]
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
  [ERROR]
  [ERROR] After correcting the problems, you can resume the build with the command
  [ERROR]   mvn &lt;goals&gt; -rf :hero-journey-web
  </code></pre>
  
  <p>It does not provide any particular information about the cause except <code>RuntimeException</code> and that something happen (it seems) on class parsing. </p>
  
  <p><code>mvn -version</code> looks like this</p>
  
  <pre><code>Apache Maven 3.5.0
  Maven home: L:\installed\apache-maven-3.5.0\bin\..
  Java version: 9, vendor: Oracle Corporation
  Java home: C:\Program Files\Java\jdk-9
  </code></pre>
  
  <p>What is the problem? </p>
  
  <p>My main <code>pom.xml</code> looks like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.lapots.breed.hero.journey&lt;/groupId&gt;
      &lt;artifactId&gt;hero-journey&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
  
      &lt;name&gt;hero-journey&lt;/name&gt;
      &lt;description&gt;Start the journey towards the greatest powers&lt;/description&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.0.M5&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;modules&gt;
          &lt;module&gt;hero-journey-web&lt;/module&gt;
      &lt;/modules&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;9&lt;/java.version&gt;
      &lt;/properties&gt;
  
      &lt;distributionManagement&gt;
          &lt;repository&gt;
              &lt;id&gt;google-drive-repository&lt;/id&gt;
              &lt;url&gt;file://L:/google-drive/m2-artifactory/mvn-releases&lt;/url&gt;
          &lt;/repository&gt;
          &lt;snapshotRepository&gt;
              &lt;id&gt;google-drive-snapshot&lt;/id&gt;
              &lt;url&gt;file://L:/google-drive/m2-artifactory/mvn-snapshots&lt;/url&gt;
          &lt;/snapshotRepository&gt;
      &lt;/distributionManagement&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-snapshots&lt;/id&gt;
              &lt;name&gt;Spring Snapshots&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/snapshot&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-milestones&lt;/id&gt;
              &lt;name&gt;Spring Milestones&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;google-drive-releases&lt;/id&gt;
              &lt;url&gt;file://L:/google-drive/m2-artifactory/mvn-releases&lt;/url&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/releases&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;google-drive-snapshots&lt;/id&gt;
              &lt;url&gt;file://L:/google-drive/m2-artifactory/mvn-snapshots&lt;/url&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/releases&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;pluginRepositories&gt;
          &lt;pluginRepository&gt;
              &lt;id&gt;spring-snapshots&lt;/id&gt;
              &lt;name&gt;Spring Snapshots&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/snapshot&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/pluginRepository&gt;
          &lt;pluginRepository&gt;
              &lt;id&gt;spring-milestones&lt;/id&gt;
              &lt;name&gt;Spring Milestones&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/pluginRepository&gt;
      &lt;/pluginRepositories&gt;
  
  
  &lt;/project&gt;
  </code></pre>
  
  <p>My subproject <code>pom.xml</code> looks like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;com.lapots.breed.hero.journey&lt;/groupId&gt;
          &lt;artifactId&gt;hero-journey&lt;/artifactId&gt;
          &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;artifactId&gt;hero-journey-web&lt;/artifactId&gt;
      &lt;description&gt;Hero Journey - web application&lt;/description&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>