2017-10-20 692 views
1

構建項目和運行frontend-maven-plugin會導致運行任務失敗。Maven-Plugin:無法運行任務'yarn'

規格:

  • Node.js的6.11.4
  • NPM 3.10.10
  • 紗1.2.1
  • 的Maven 3.3.9(3.5.0)
  • 操作系統:Windows 10 64和Ubuntu 16.10

這就是日誌的樣子:

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:yarn (frontend: execute yarn install) on project zanata-frontend: Failed to run task: 'yarn ' failed. (error code 1) -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:yarn (frontend: execute yarn install) on project zanata-frontend: Failed to run task 
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) 
     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 io.takari.maven.builder.smart.SmartBuilderImpl.buildProject(SmartBuilderImpl.java:334) 
     at io.takari.maven.builder.smart.SmartBuilderImpl$ProjectBuildTask.run(SmartBuilderImpl.java:104) 
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
     at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
     at java.lang.Thread.run(Thread.java:745) 
Caused by: org.apache.maven.plugin.MojoFailureException: Failed to run task 
     at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute(AbstractFrontendMojo.java:95) 
     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) 
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) 
     ... 10 more 
Caused by: com.github.eirslett.maven.plugins.frontend.lib.TaskRunnerException: 'yarn ' failed. (error code 1) 
     at com.github.eirslett.maven.plugins.frontend.lib.YarnTaskExecutor.execute(YarnTaskExecutor.java:61) 
     at com.github.eirslett.maven.plugins.frontend.mojo.YarnMojo.execute(YarnMojo.java:65) 
     at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute(AbstractFrontendMojo.java:89) 
     ... 12 more 
[ERROR] 
[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/MojoFailureException 
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command 
[ERROR] mvn <goals> -rf :zanata-frontend 

前端Maven插件:

  <plugin> 
     <groupId>com.github.eirslett</groupId> 
     <artifactId>frontend-maven-plugin</artifactId> 
     <executions> 
      <!-- Download all dependency modules from yarn (or mirror). --> 
      <execution> 
      <id>frontend: execute yarn install</id> 
      <phase>generate-sources</phase> 
      <goals> 
       <goal>yarn</goal> 
      </goals> 
      <configuration> 
       <workingDirectory>${frontend.build.directory}</workingDirectory> 
      </configuration> 
      </execution> 
     </executions> 
     </plugin> 

回答

2

有同樣的問題。將frontend-maven-plugin從1.4升級到1.6爲我解決了它。真的不知道潛在的問題。試一試。

相關問題