簡體   English   中英

Maven-Plugin:無法運行任務“紗線”

[英]Maven-Plugin: Failed to run task 'yarn'

生成項目並運行frontend-maven-plugin會導致運行任務失敗。

眼鏡:

  • Node.js 6.11.4
  • npm 3.10.10
  • 紗1.2.1
  • Maven 3.3.9(3.5.0)
  • 操作系統:Windows 10 64bit and 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>

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM