Legacy Knowledge Base
公開されました Jun. 30, 2025

モジュール マニフェストに追加された Apache Commons Lang3 ライブラリのバージョンが間違っている

Written By

Madeleine Clay

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

問題

  • Apache Commons Lang3を使用するサービス ビルダー モジュールがあります。 私たちの Liferay バージョンは Apache Commons Lang3 バージョン 3.11 を使用しています。
  • このモジュールでは、 build.gradle内で次のように依存関係を定義しました。
    compileOnly group: "com.liferay.portal", name: "release.dxp.api"
    compileOnly group: 'org.apache.commons', name: 'commons-lang3', version: '3.11'
  • ただし、モジュールをビルドすると、バージョン 3.12 がマニフェストに追加されます。
  • 依存関係タスクを確認すると、次のように表示されます。
    +--- com.liferay.portal:release.dxp.bom.third.party:7.4.13.u40
    | +--- org.apache.commons:commons-lang3:3.12.0 (c)
    | \--- javax.activation:activation:1.1 (c)
    +--- com.liferay.portal:release.dxp.bom:7.4.13.u40
    ...
    org.apache.commons:commons-lang3:3.11.0 -> 3.12.0
  • 意味 com.liferay.portal:release.dxp.bom.third.party マニフェストに 3.12 を追加しています。

Environment

  • 開発者ツール

解決策

この問題には 2 つの解決策が考えられます。

  1. 必要な bundle:version を compileInclude で build.gradleに含めます。 これにより、モジュール JAR のlibフォルダーにライブラリとそのすべての依存関係を埋め込み、モジュールのBundle-ClassPathマニフェストに JAR を追加することで、 release.dxp.api の外部にあるすべての依存関係がデプロイされます。ヘッダ:
    compileOnly group: "com.liferay.portal", name: "release.dxp.api"
    compileInclude group: "org.apache.commons", name: "commons-lang3", version: "3.11"
  2. または、 build.gradle のワークスペースの依存関係バージョンを上書きします (ワークスペースのルートにあるGETTING_STARTED.markdown#Overwrite_dependency_in_multiple_projects
    を参照してください):
    subprojects {
    configurations.all {
    resolutionStrategy.force 'org.apache.commons:commons-lang3:3.11'
    }
    }

追加情報

Did this article resolve your issue ?

Legacy Knowledge Base