Finding Artifacts

Using external artifacts in your project requires configuring their dependencies. To do this, look up the artifact’s attributes and plug them into dependency entries for your build system (either Gradle or Maven). Your build system downloads the dependency artifacts your project needs to compile successfully.

Before specifying an artifact as a dependency, you must first find its attributes. Artifacts have these attributes:

  • Group ID: Authoring organization
  • Artifact ID: Name/identifier
  • Version: Release number

Here you’ll learn how to find artifact attributes to specify artifact dependencies.

Finding Core Artifact Attributes

Each Liferay artifact is a JAR file whose META-INF/MANIFEST.MF file specifies OSGi bundle metadata the artifact’s attributes. For example, these two OSGi headers specify the artifact ID and version:

Bundle-SymbolicName:  [artifact ID]
Bundle-Version: [version]

This table lists each core Liferay DXP artifact’s group ID and artifact ID and where to find the artifact’s manifest, which lists the artifact version:

Core Liferay DXP Artifacts:

FileGroup IDArtifact IDVersionOrigin
portal-kernel.jarcom.liferay.portalcom.liferay.portal.kernel(see JAR’s MANIFEST.MF)fix pack ZIP, Liferay DXP installation, or Liferay DXP dependencies ZIP
portal-impl.jarcom.liferay.portalcom.liferay.portal.impl(see JAR’s MANIFEST.MF)fix pack ZIP or Liferay DXP .war
util-bridges.jarcom.liferay.portalcom.liferay.util.bridges(see JAR’s MANIFEST.MF)fix pack ZIP or Liferay DXP .war
util-java.jarcom.liferay.portalcom.liferay.util.java(see JAR’s MANIFEST.MF)fix pack ZIP or Liferay DXP .war
util-slf4j.jarcom.liferay.portalcom.liferay.util.slf4j(see JAR’s MANIFEST.MF)fix pack ZIP or Liferay DXP .war
util-taglibs.jarcom.liferay.portalcom.liferay.util.taglib(see JAR’s MANIFEST.MF)fix pack ZIP or Liferay DXP .war
com.liferay.* JAR filescom.liferay(see JAR’s MANIFEST.MF)(see JAR’s MANIFEST.MF)fix pack ZIP, Liferay DXP installation, Liferay DXP dependencies ZIP, or the OSGi ZIP

Next, you’ll learn how to find Liferay DXP app and independent module artifact attributes.

Finding Liferay App and Independent Artifacts

Independent modules and Liferay DXP app modules aren’t part of the Liferay DXP core. You must still, however, find their artifact attributes if you depend on them. The resources below provide the artifact details for Liferay DXP’s apps and independent modules:

ResourceArtifact Type
App ManagerDeployed modules
Reference DocsLiferay DXP modules (per release)
Maven CentralAll artifact types: Liferay DXP and third party, module and non-module

The App Manager is the best source for information on deployed modules. You’ll learn about it next.

App Manager

The App Manager knows what’s deployed on your Liferay instance. Use it to find deployed module attributes.

  1. In Liferay DXP, navigate to Control PanelAppsApp Manager.

  2. Search for the module by its display name, symbolic name, or related keywords. You can also browse for the module in its app. Whether browsing or searching, the App Manager shows the module’s artifact ID and version number.

Figure 1: You can inspect deployed module artifact IDs and version numbers.

Figure 1: You can inspect deployed module artifact IDs and version numbers.

Figure 2: The App Manager aggregates Liferay and independent modules.

Figure 2: The App Manager aggregates Liferay and independent modules.

If you don’t know a deployed module’s group ID, use the Felix Gogo Shell to find it:

  1. Navigate to the Gogo Shell portlet in the Control Panel → ConfigurationGogo Shell. Enter commands in the Felix Gogo Shell command prompt.

  2. Search for the module by its display name (e.g., Liferay Blogs API) or a keyword. In the results, note the module’s number. You can use it in the next step. For example, Gogo command results in the figure below show the Liferay Blogs API module number.

    Figure 3: Results from this Gogo command show that the modules number is 1173.

    Figure 3: Results from this Gogo command show that the module's number is `1173`.

  3. List the module’s manifest headers by passing the module number to the headers command. In the results, note the Bundle-Vendor value: you’ll match it with an artifact group in a later step:

    Figure 4: Results from running the headers command show the modules bundle vendor and bundle version.

    Figure 4: Results from running the `headers` command show the module's bundle vendor and bundle version.

  4. On Maven Central or MVNRepository, search for the module by its artifact ID.

  5. Determine the group ID by matching the Bundle-Vendor value from step 3 with a group listed that provides the artifact.

Next, Liferay DXP’s reference documentation provides Liferay DXP app artifact attributes.

Reference Docs

Liferay DXP’s app Javadoc lists each app module’s artifact ID, version number, and display name. This is the best place to look up Liferay DXP app modules that aren’t yet deployed to your Liferay DXP instance.

Follow these steps to find a Liferay DXP app module’s attributes in the Javadoc:

  1. Navigate to Javadoc for an app module class. If you don’t have a link to the class’s Javadoc, find it by browsing https://docs.liferay.com/dxp/apps.

  2. Copy the class’s package name.

  3. Navigate to the Overview page.

  4. On the Overview page, search for the package name you copied in step 2.

The heading above the package name shows the module’s artifact ID, version number, and display name. Remember, the group ID for all app modules is com.liferay.

Figure 5: Liferay DXP app Javadoc overviews list each app modules display name, followed by its group ID, artifact ID, and version number in a colon-separated string. Its a Gradle artifact syntax.

Figure 5: Liferay DXP app Javadoc overviews list each app module's display name, followed by its group ID, artifact ID, and version number in a colon-separated string. It's a Gradle artifact syntax.

Next, you’ll learn how to look up artifacts on MVNRepository and Maven Central.

Maven Central

Most artifacts, regardless of type or origin, are on MVNRepository and Maven Central. These sites can help you find artifacts based on class packages. It’s common to include an artifact’s ID in the start of an artifact’s package names. For example, if you depend on the class org.osgi.service.component.annotations.Component, search for the package name org.osgi.service.component.annotations on one of the Maven sites.

Now that you know the artifact’s attributes, you can configure a dependency on it.

Specifying Dependencies

Importing Packages

Exporting Packages

Resolving Third Party Library Package Dependencies

Deploying WARs (WAB Generator)

« Configuring DependenciesSpecifying Dependencies »
¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0