Issue
If you want to use multiple repositories for your custom code projects, you might face an issue when getting BOM files from Maven central, as the BOMs there might be out-of-date.
Therefore, Liferay recommends using our internal CDN site: https://repository-cdn.liferay.com/nexus/content/groups/public/com/liferay/portal/release.dxp.bom/
This introduces the question, how can you keep using Maven central too, for other dependencies, while prioritizing Liferay's CDN site for getting the BOMs.
Environment
- Liferay DXP 6.0 – 7.4 Quarterly Releases
- Using one of these build tools:
- Gradle
- Maven
Resolution
- For Gradle:
https://docs.gradle.org/current/userguide/declaring_repositories.html
Example config in build.gradle:
repositories { mavenCentral() maven { url "https://repo.spring.io/release" } maven { url "https://repository.jboss.org/maven2" } }
- For Maven:
https://maven.apache.org/guides/mini/guide-multiple-repositories.html
Example config in settings.xml:
<project>
...
<repositories>
<repository>
<id>my-repo1</id>
<name>your custom repo</name>
<url>http://jarsm2.dyndns.dk</url>
</repository>
<repository>
<id>my-repo2</id>
<name>your custom repo</name>
<url>http://jarsm2.dyndns.dk</url>
</repository>
</repositories>
...
</project>