AEMビルド時間を高速化



AEMビルド時間を上げる方法
最近、Mavenベースのプロジェクトのビルド時間を高速化するツールを見つけました.
Mavenデーモンは、速くビルド時間を提供するMaven Wrapperツールを言いましょう.
Mavenデーモンについてのいくつかの事実
  • ビルドは、長寿命バックグラウンドプロセス
  • で実行されます
  • ネイティブ実行可能
  • 並列CPU
  • でモジュールをビルドするために複数のCPUコアを使用します
    あなたがgithub repositoryで見つけることができるMavenデーモンに関する詳細情報.

    デーモンインストール
    SDKまたはBUSEを使用して、Mavenデーモンをインストールします
    $ sdk install mvnd
    
    $ brew install mvndaemon/homebrew-mvnd/mvnd
    
    インストールを確認できます
    ➜ ~ mvnd --version
    mvnd native client 0.2.0-darwin-amd64 (0cd0b3f04692b7970fda06c206c1fbaac68fe9ce)
    Terminal: org.jline.terminal.impl.PosixSysTerminal with pty org.jline.terminal.impl.jansi.osx.OsXNativePty
    Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
    Maven home: /usr/local/Cellar/mvnd/HEAD-1c610c3/libexec/mvn
    Java version: 15.0.1, vendor: N/A, runtime: /usr/local/Cellar/openjdk/15.0.1/libexec/openjdk.jdk/Contents/Home
    Default locale: en_GB, platform encoding: UTF-8
    OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
    

    Mavenデーモンのビルドタイム比較
    テストの目的のために私はAEMプロジェクトのビルド時間を比較します.プロジェクトは、測定の2倍前に構築されました.
    多くの要因が最終的なビルド時間(+数秒)に影響を与えることができるので、この測定は完璧ではありません.
    テスト目的のために、私はAEMプロジェクトArkType Version 24を使いました.

  • MVNクリーンインストールMVndクリーンインストール
  • MVN:26.586 s
  • mvnd : 12.654 s
  • mvn clean install
    
    [INFO] Reactor Summary for mysite 1.0.0-SNAPSHOT:
    [INFO]
    [INFO] mysite ............................................. SUCCESS [0.242 s]
    [INFO] My Site - Core ..................................... SUCCESS [6.994 s]
    [INFO] My Site - UI Frontend .............................. SUCCESS [11.099 s]
    [INFO] My Site - Repository Structure Package ............. SUCCESS [0.795 s]
    [INFO] My Site - UI apps .................................. SUCCESS [3.890 s]
    [INFO] My Site - UI content ............................... SUCCESS [1.672 s]
    [INFO] My Site - UI config ................................ SUCCESS [0.105 s]
    [INFO] My Site - All ...................................... SUCCESS [0.138 s]
    [INFO] My Site - Dispatcher ............................... SUCCESS [0.080 s]
    [INFO] My Site - UI Tests ................................. SUCCESS [0.274 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 26.586 s
    [INFO] Finished at: 2020-12-30T11:59:11+01:00
    [INFO] ------------------------------------------------------------------------
    
    mvnd clean install
    
    [INFO] Reactor Summary for mysite 1.0.0-SNAPSHOT:
    [INFO]
    [INFO] mysite ............................................. SUCCESS [0.016 s]
    [INFO] My Site - Core ..................................... SUCCESS [4.300 s]
    [INFO] My Site - UI Frontend .............................. SUCCESS [10.442 s]
    [INFO] My Site - Repository Structure Package ............. SUCCESS [0.178 s]
    [INFO] My Site - UI apps .................................. SUCCESS [1.126 s]
    [INFO] My Site - UI content ............................... SUCCESS [0.911 s]
    [INFO] My Site - UI config ................................ SUCCESS [0.156 s]
    [INFO] My Site - All ...................................... SUCCESS [0.107 s]
    [INFO] My Site - Dispatcher ............................... SUCCESS [0.078 s]
    [INFO] My Site - UI Tests ................................. SUCCESS [0.063 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 12.654 s (Wall Clock)
    [INFO] Finished at: 2020-12-30T11:59:58+01:00
    [INFO] ------------------------------------------------------------------------
    

  • MVNのクリーンインストールをインストールします
  • MVN:29.582 s
  • mvnd:12.995 s
  • mvn clean install -PautoInstallPackage
    
    [INFO] Reactor Summary for mysite 1.0.0-SNAPSHOT:
    [INFO]
    [INFO] mysite ............................................. SUCCESS [0.223 s]
    [INFO] My Site - Core ..................................... SUCCESS [7.354 s]
    [INFO] My Site - UI Frontend .............................. SUCCESS [11.338 s]
    [INFO] My Site - Repository Structure Package ............. SUCCESS [0.826 s]
    [INFO] My Site - UI apps .................................. SUCCESS [4.343 s]
    [INFO] My Site - UI content ............................... SUCCESS [2.885 s]
    [INFO] My Site - UI config ................................ SUCCESS [0.454 s]
    [INFO] My Site - All ...................................... SUCCESS [0.346 s]
    [INFO] My Site - Dispatcher ............................... SUCCESS [0.061 s]
    [INFO] My Site - UI Tests ................................. SUCCESS [0.374 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 29.582 s
    [INFO] Finished at: 2020-12-30T12:06:29+01:00
    [INFO] ------------------------------------------------------------------------
    
    mvnd clean install -PautoInstallPackage
    
    [INFO] Reactor Summary for mysite 1.0.0-SNAPSHOT:
    [INFO]
    [INFO] mysite ............................................. SUCCESS [0.005 s]
    [INFO] My Site - Core ..................................... SUCCESS [4.004 s]
    [INFO] My Site - UI Frontend .............................. SUCCESS [10.288 s]
    [INFO] My Site - Repository Structure Package ............. SUCCESS [0.177 s]
    [INFO] My Site - UI apps .................................. SUCCESS [1.433 s]
    [INFO] My Site - UI content ............................... SUCCESS [1.010 s]
    [INFO] My Site - UI config ................................ SUCCESS [0.292 s]
    [INFO] My Site - All ...................................... SUCCESS [0.227 s]
    [INFO] My Site - Dispatcher ............................... SUCCESS [0.079 s]
    [INFO] My Site - UI Tests ................................. SUCCESS [0.053 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 12.995 s (Wall Clock)
    [INFO] Finished at: 2020-12-30T12:08:30+01:00
    [INFO] ------------------------------------------------------------------------
    
    注意:
    あなたがBND Mavenプラグインバージョン5.1.0を使用する場合、あなたのAEMプロジェクトビルドはMavenデーモンで失敗します.
    [ERROR] Failed to execute goal biz.aQute.bnd:bnd-maven-plugin:5.0.0:bnd-process (bnd-process) on project lot-polish-airlines.core: bnd error: null: ConcurrentModificationException -> [Help 1]
    
    私たちが結果によって見ることができるように、Mavenデーモン造り時間は通常のMavenでより速くおよそ2 xです.インストールはかなり簡単だったので、これまでの任意の欠点に気付きませんでしたので、なぜそれを使用していくつかの時間を節約します.