Including Google Maps API Library in EAR File?

I’m using in an app which has a WAR file contained in an EAR file deployed to a web server. Following the readme, I added:

repositories {

dependencies {
implementation ‘ latest version)’
implementation ‘org.slf4j:slf4j-simple:1.7.25’

to build.gradle for my WAR. This builds successfully and I can see the library included in my Eclipse environment. However, when I build the EAR and deploy it, I see:


indicating to me that the dependency isn’t being included in the EAR. Presumably, I need to edit build.gradle for the EAR, but it’s not clear to me how to do this. Copying the same edits from the WAR build file causes the compilation to fail:

Could not find method implementation() for arguments [] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Could anyone explain to me how to tell Gradle to include this library in the EAR?