I’m extending a Liferay 7 portal by adding a new “basic” app under the standard modules/apps directory:
liferay-portal/
└── modules/
└── apps/
└── basic/
├── basic-api/
│ └── build.gradle
└── basic-rest-impl/
└── build.gradle
I want basic-rest-impl to depend on basic-api. Both modules compile fine if I run them individually, but when I run my usual ant all the Gradle deploy step for basic-rest-impl always fails.
[beanshell] Executing Gradle task: deploy
...
FAILURE: Build failed with an exception.
* Where:
Build file '/home/me/dev/projects/liferay-portal/modules/apps/basic/basic-rest-impl/build.gradle' line: 12
* What went wrong:
A problem occurred evaluating project ':apps:basic:basic-rest-impl'.
> Project with path ':apps:basic:basic-api' could not be found in project ':apps:basic:basic-rest-impl'.
What I’ve tried
Declaring the dependency
Inbasic-rest-impl/build.gradleI have:dependencies { compile project(':apps:basic:basic-api') compileOnly group: 'com.liferay', name: 'portal-kernel', version: '7.4.0' // … }Including sub-modules
I createdmodules/apps/basic/settings.gradlewith:include ':apps:basic:basic-api' include ':apps:basic:basic-rest-impl'Applying Liferay defaults
In the rootbuild.gradle(liferay-portal folder) I have:apply plugin: "com.liferay.app.defaults.plugin"Cache cleaning
Ranant all-cleanandgradle --stop && gradle clean build --refresh-dependencies.
Despite all that, Gradle still cannot see the basic-api project when invoked through Ant’s deploy task.
My question
What Gradle (or Liferay) configuration am I missing so that
compile project(':apps:basic:basic-api')
is resolved correctly when I run ant all? In other words, how do I tell the Gradle build that my new modules/apps/basic folder is part of the multi-project build so that basic-rest-impl can find basic-api?