簡體   English   中英

Maven 插件問題:maven-enforcer-plugin:3.0.0-M3:enforce 有些 Enforcer 規則失敗

[英]Problem with Maven plugin :maven-enforcer-plugin:3.0.0-M3:enforce Some Enforcer rules have failed

一點背景信息:我是 AEM 項目的 FE 開發人員。 該項目是作為雲服務的 SPA AEM。 我正在從命令行運行作者實例。

我的電腦規格是:

  • CPU:Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz 3.00 GHz
  • 內存:24.0 GB
  • 固態硬盤:476 GB
  • 操作系統:Windows 10 專業版

對於我們正在使用的 AEM 項目

  • Java SDK 11
  • Maven 3.6.3

我已經設置好了一切,路徑變量,JAVA_HOME,mvn。 它們都運行良好,甚至嘗試使用“舊”版本的 AEM 構建其他類型的項目,例如 6.5 構建完美。 我對他們沒有問題。 但是使用此版本的 AEM 我收到此錯誤

[WARNING] Rule 9: org.apache.maven.plugins.enforcer.RequireFileChecksum failed with message:
There have been changes detected in a file which is supposed to be immutable according to https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html#file-structure: src/conf.dispatcher.d/renders/default_renders.any
[WARNING] Rule 10: org.apache.maven.plugins.enforcer.RequireFileChecksum failed with message:
There have been changes detected in a file which is supposed to be immutable according to https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html#file-structure: src/conf.dispatcher.d/virtualhosts/default_virtualhosts.any
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for xxxxxx 1.0.0-SNAPSHOT:
[INFO]
[INFO] xxxxxx ................................. SUCCESS [  0.270 s]
[INFO] xxxxxx - Core .......................... SUCCESS [ 59.232 s]
[INFO] xxxxxx - UI Frontend ................... SUCCESS [ 19.876 s]
[INFO] xxxxxx - UI Frontend React ............. SUCCESS [ 39.613 s]
[INFO] xxxxxx - Repository Structure Package .. SUCCESS [  0.991 s]
[INFO] xxxxxx - UI apps ....................... SUCCESS [ 12.990 s]
[INFO] xxxxxx - UI content .................... SUCCESS [  4.178 s]
[INFO] xxxxxx - UI config ..................... SUCCESS [  0.314 s]
[INFO] xxxxxx - All ........................... SUCCESS [  1.052 s]
[INFO] xxxxxx - Integration Tests ............. SUCCESS [ 12.166 s]
[INFO] xxxxxx - Dispatcher .................... FAILURE [  0.030 s]
[INFO] xxxxxx - UI Tests ...................... SKIPPED
[INFO] xxxxxx - Project Analyser .............. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:34 min
[INFO] Finished at: 2021-08-22T15:11:20-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (enforce-checksum-of-immutable-files) on project xxxxxxx.dispatcher.cloud: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :xxxxxx.dispatcher.cloud

我一直在網站上搜索,這個問題的一些答案對我不起作用。

  • 我嘗試從“gitbash”命令行運行所有內容,但遇到了同樣的問題。
  • 我試圖更改 pom.xml 中的版本,沒有用。
  • 我嘗試使用 Eclipse IDE 和所有內置工具構建項目,但收到錯誤org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce is missing
  • 禁用防火牆和防病毒軟件,不
  • 使用其他版本的 Maven,如 3.8.2
  • 刪除.m2目錄並重新下載所有插件,不起作用

許多答案之一告訴我在 pom.xml 中注釋掉調度程序模塊,然后我就可以正常構建。 其他人也在做同樣的事情,並使用crx 包管理器上傳ui.apps/target/*.zip我做到了,但我不確定結果是否是“最好的”。 最后,我在 Mac Pro 中安裝了相同的項目,並且沒有出現問題。 我希望有人能幫我解決這個問題。 謝謝閱讀。

[WARNING] Rule 9: org.apache.maven.plugins.enforcer.RequireFileChecksum failed with message:
There have been changes detected in a file which is supposed to be immutable according to https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html#file-structure: src/conf.dispatcher.d/renders/default_renders.any

Maven Enforcer 插件正在使用requireFileChecksum 規則檢查某些文件是否具有特定checksum

在你的pom.xml的某個地方應該聲明 Enforcer Maven 插件,這樣你就可以看到規則和它應用的哈希。 這個 xml 片段來自 maven 插件文檔。

<requireTextFileChecksum>
  <file>E:\java-workspace\apache-maven-enforcer\maven-enforcer\target\checkout\enforcer-rules\target\classes/foo.txt</file>
  <checksum>d41d8cd98f00b204e9800998ecf8427e</checksum>
  <type>md5</type>
</requireTextFileChecksum>

根據文件系統文件的哈希值檢查該哈希值。 也許當您更改aem版本時,您需要升級其中一些文件。

如此處所討論: https : //github.com/adobe/aem-guides-wknd/pull/202

Adobe 已經報告了 Adob​​e AEM WKND 項目的問題和修復:

某些 Windows 用戶遇到 Maven 執行器問題,其中似乎默認調度程序文件已被修改。 不清楚這是否是 Mac 和 Windows 之間的差異或結帳過程中發生的某些事情的結果。 大多數用戶只是想將代碼庫安裝到本地環境中,這種檢查是不必要的。 刪除 Windows 構建的強制執行。

這樣你就可以 :

為 Windows 環境中的用戶跳過 Dispatcher 執行插件。

使用此處報告的提交對您的 dispatcher/pom.xml 進行更改:

https://github.com/adobe/aem-guides-wknd/pull/202/commits/bebcf5d2236c75a95055d5ff71ea58f66379f271

更換線:

<goal>enforce</goal>

和:

<goal>display-info</goal>

暫無
暫無

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

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