Unable to build the module: Could not find com.liferay.portal:release.dxp.api errors
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.
Issue
- Sometimes users face the following error while building their modules:
Task modules: test-search-results-limit:compileJava FAILED
FAILURE: Build failed with an exception.
what went wrong:
Execution failed for task ':modules:test-search-results-limit:compileJava'.
> Could not resolve all files for configuration ':modules:test-search-results-limit:compileclasspath'.
> Could not find com.liferay.portal:release.dxp.api:.
Required by:
project:modules:test-search-results-limit
Environment
- Liferay DXP 7.3 and above
- LDS
Resolution
-
The error "com.liferay.portal:release.dxp.api" was not found, according to the developers, This error also occurs when using Community Edition in the development environment as this dependencey "com.liferay.portal:release.dxp.api" is only included in the Enterprise Edition. Thus, users must check if they are using Community Edition for their development environment.
-
Also, if it is not a community edition, another possible cause is that they might use Portal instead of DXP.
-
The workaround is here: in the 'build.gradle' the "release.dxp.api" needs to be used as a "compileOnly" dependency. For example:
compileOnly group: "com.liferay.portal", name: "release.dxp.api", version: "Enter the Dxp version that are you using"
-
Users also specify the product version, and they can do so in the 'gradle.properties' of the "liferay-workspace" root folder: liferay.workspace.product = Dxp version that are you using at your end
Additional Information
-
com.liferay.portal:release.dxp.api simplifies and streamlines the development process for Liferay DXP applications by offering pre-built functionalities and promoting code quality.
Did this article resolve your issue ?