在您的AEM專案中包含協力廠商套件組合

在本文中,我們將逐步說明在您的AEM專案中包含第三方OSGi套件組合的相關步驟。基於本文目的,我們將在AEM專案中包含jsch-0.1.55.jar。 如果OSGi可在maven存放庫中取得,請在專案的POM.xml檔案中包含套件的相依性。

NOTE
我們假設第三方jar是OSGi套件
<!-- https://mvnrepository.com/artifact/com.jcraft/jsch -->
<dependency>
    <groupId>com.jcraft</groupId>
    <artifactId>jsch</artifactId>
    <version>0.1.55</version>
</dependency>

如果您的OSGi套件組合位於您的檔案系統上,請在專案基底目錄(C:\aemformsbundles\AEMFormsProcessStep\localjar)下建立名為​ localjar ​的資料夾,相依性看起來會像這樣

<dependency>
    <groupId>jsch</groupId>
    <artifactId>jsch</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/localjar/jsch-0.1.55-bundle.jar</systemPath>
</dependency>

建立檔案夾結構

我們正在將此組合新增至位於​ c:\aemformsbundles ​資料夾中的AEM專案​ AEMFormsProcessStep

  • 從專案的C:\aemformsbundles\AEMFormsProcessStep\all\src\main\content\META-INF\vault資料夾開啟​ filter.xml
    記下篩選元素的根屬性。

  • 建立下列檔案夾結構C:\aemformsbundles\AEMFormsProcessStep\all\src\main\content\jcr_root\apps\AEMFormsProcessStep-vendor-packages\application\install

  • apps/AEMFormsProcessStep-vendor-packages ​是filter.xml中的根屬性值

  • 更新專案POM.xml的相依性區段

  • 開啟命令提示。 以我的案例瀏覽至專案的資料夾(c:\aemformsbundles\AEMFormsProcessStep)。 執行以下命令

mvn clean install -PautoInstallSinglePackage

如果一切順利,套件會與協力廠商套件一起安裝在您的AEM執行個體中。 您可以使用felix Web主控台檢查套件組合。 協力廠商套件組合可在crx存放庫的/apps資料夾中使用,如下所示
協力廠商

recommendation-more-help
8de24117-1378-413c-a581-01e660b7163e