使用“maven-compiler-plugin”时抛出java.lang.AssertionError

时间:2015-12-15 15:17:59

标签: java maven

这是我earlier question的后续问题。现在,我已经运行了插件,但我在target/jsp-source中看不到任何结果。这是pom.xml中的内容

<build>
   <plugins>
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <version>3.1</version>
         <configuration>
            <source>1.8</source>
            <target>1.8</target>
         </configuration>
      </plugin>

      <plugin>
         <groupId>org.codehaus.mojo.jspc</groupId>
         <artifactId>jspc-maven-plugin</artifactId>
         <version>2.0-alpha-3</version>
         <executions>
            <execution>
               <phase>compile</phase>
               <goals>
                  <goal>compile</goal>
               </goals>
            </execution>
         </executions>
         <configuration>
            <inputwebxml>${basedir}/src/main/webapp/WEB-INF/web.xml</inputwebxml>
            <sources>
               <directory>${basedir}/src/main/webapp/jsp</directory>
               <includes>
                  <include>**/*.jsp</include>
               </includes>
            </sources>
         </configuration>
      </plugin>
   </plugins>
</build>

运行clean dependency:copy-dependencies install后,我发出以下异常Exception in thread "main" java.lang.AssertionError: Missing tools.jar at: /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/Classes/classes.jar. Expression: file.exists()

Exception in thread "main" java.lang.AssertionError: Missing tools.jar at: /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/Classes/classes.jar. Expression: file.exists()
   at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:395)
   at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:683)
   at org.codehaus.mojo.jspc.CompilationMojoSupport.findToolsJar(CompilationMojoSupport.groovy:371)
   at org.codehaus.mojo.jspc.CompilationMojoSupport.this$4$findToolsJar(CompilationMojoSupport.groovy)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:497)
   at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
   at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230)
   at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:912)
   at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:78)
   at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrent0(ScriptBytecodeAdapter.java:112)
   at org.codehaus.mojo.jspc.CompilationMojoSupport.execute(CompilationMojoSupport.groovy:318)
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
   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:307)
   at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
   at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
   at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
   at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:497)
   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)

0 个答案:

没有答案