NOTE: The following resolution requires customization and should only be implemented at the discretion of your team. Liferay Support will not be able to assist with designing or implementing customizations.
Issue
- After adding the following dependencies to the
build.gradlefile of a Liferay REST module, the module fails to deploy:
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.2'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.2'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.2'
ERROR [fileinstall-directory-watcher][DirectoryWatcher:1164] Unable to start bundle: .../osgi/modules/FormsDetails.jar
com.liferay.portal.kernel.log.LogSanitizerException: org.osgi.framework.BundleException: Could not resolve module: FormsDetails [...] Unresolved requirement: Import-Package: io.jsonwebtoken; version="0.11.0" [Sanitized]
at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi.jar:?]
Environment
- Liferay DXP 7.4
Resolution
- Instead of manually adding JJWT dependencies, use the ones provided by Liferay. Add the following dependency to your
build.gradlefile:
compileInclude group: "io.jsonwebtoken", name: "jjwt-api", version: "0.11.2"
compileInclude group: "io.jsonwebtoken", name: "jjwt-impl", version: "0.11.2"
compileInclude group: "io.jsonwebtoken", name: "jjwt-jackson", version: "0.11.2"
Additional Information