【问题标题】:maven print phase of the lifecycle during build构建期间生命周期的 Maven 打印阶段
【发布时间】:2019-09-28 09:55:54
【问题描述】:

如何打印 maven 构建项目时运行的阶段?假设我运行 mvn install ,那么我看到的是:

[INFO] --- jacoco-maven-plugin:0.8.3:prepare-agent (default-prepare-agent) @ site-order-parent ---
[INFO] argLine set to -javaagent:/Users/xxx/.m2/repository/org/jacoco/org.jacoco.agent/0.8.3/org.jacoco.agent-0.8.3-runtime.jar=destfile=/Users/xxx/Cdk/site-order/target/jacoco.exec
[INFO] 
[INFO] >>> maven-source-plugin:2.4:jar (attach-sources) > generate-sources @ site-order-parent >>>
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.3:prepare-agent (default-prepare-agent) @ site-order-parent ---
[INFO] argLine set to -javaagent:/Users/xxx/.m2/repository/org/jacoco/org.jacoco.agent/0.8.3/org.jacoco.agent-0.8.3-runtime.jar=destfile=/Users/xxx/Cdk/site-order/target/jacoco.exec
[INFO] 
[INFO] <<< maven-source-plugin:2.4:jar (attach-sources) < generate-sources @ site-order-parent <<<
[INFO] 
[INFO] 
[INFO] --- maven-source-plugin:2.4:jar (attach-sources) @ site-order-parent ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.3:report (default-report) @ site-order-parent ---
[INFO] Skipping JaCoCo execution due to missing execution data file.
[INFO] 
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ site-order-parent ---

我们看到了 &lt;plugin_name&gt; : version : goal (execution Id) @ artifact name 的格式,但我需要看看在发生这种情况时生命周期的哪个阶段处于活动状态?

【问题讨论】:

  • 使用 mvn 的 -X (debug) flag,你会得到更多的信息。
  • @spi ,我找到了,但没有找到任何阶段信息。我在日志中搜索了 phase 关键字,但一无所获。你确定我们在-X 中获得了阶段信息吗?
  • 对,确实将一些默认执行 ID 与阶段混淆了。无论如何,这里有一些有价值的信息:stackoverflow.com/questions/1709625/…
  • @khmarbaise,当我看到构建发生时,我想以有组织的方式看到它,就像现在编译阶段已经开始并且其中运行了这么多目标,现在测试阶段已经开始并且有这么多目标跑进去了。这有助于我更好地掌握构建过程中存在的位置。现在,只要在日志中看到插件和目标,我就必须对它可能处于哪个阶段进行逆向工程。
  • 不幸的是,目前没有这样的东西可以打印出生命周期阶段。

标签: java maven maven-3


【解决方案1】:

我在 cmets 中得到了完整的答案。因此,我将它们合并并代表他们发布。

正如@khmarbaise 评论的那样,目前这在 maven 3 中是不可能的。

但有些东西可能会有所帮助 - @spi 评论的buildplan-maven-plugin

How will this plugin be useful in our scenario ?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-05
    • 2016-08-05
    • 2021-01-25
    • 2016-02-18
    • 2011-12-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多