【发布时间】:2019-10-27 18:02:56
【问题描述】:
我尝试通过exec-maven-plugin 部署npm module。我使用来自https://github.com/arkanjoms/nexus-npm 的nexus-npm 工具。
在我的 pom 中我是这样执行的:
<execution>
<id>Deploy module via nexus-npm</id>
<goals>
<goal>exec</goal>
</goals>
<phase>deploy</phase>
<configuration>
<workingDirectory>${project.build.directory}/npm</workingDirectory>
<executable>nexus-npm</executable>
<arguments>
<argument>deploy</argument>
</arguments>
<environmentVariables>
<HOME>${project.build.directory}/npm</HOME>
</environmentVariables>
</configuration>
</execution>
一切正常,但是当部署失败时,maven 构建仍被标记为成功。部署不成功时如何告诉maven构建应该失败?
npm ERR! publish Failed PUT 400
npm ERR! code E400
npm ERR! Repository is read only: npm-internal-snapshots : mypackage
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Apps\npm-cache\_logs\2019-06-12T11_02_39_129Z-debug.log
[default.js-info]: Rollback files.
[default.js-info]: Cleaning files.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:12 min (Wall Clock)
[INFO] Finished at: 2019-06-12T13:02:39+02:00
[INFO] Final Memory: 43M/396M
[INFO] ------------------------------------------------------------------------
为了澄清我知道部署失败的原因,这不是我的问题。我只想知道部署出错时如何将maven构建标记为失败。
【问题讨论】: