Gradle multi project build “Unable to find main class”

I’m trying to link two projects (include subproject :core:users from core project into webapp project).

Here’s my project hierarchy:

├── core
│   ├── build.gradle
│   ├── clients
│   │   ├── build.gradle
│   │   └── src/
│   ├── settings.gradle
│   └── users
│       ├── build.gradle
│       └── src/
├── gradle/
├── gradlew
├── gradlew.bat
└── webapp
    ├── build.gradle
    ├── settings.gradle
    └── src
        ├── main/
        └── test/

In my webapp/settings.gradle file I include :core:users like this:

project(':core').projectDir = new File(settingsDir, '../core/')

And then in my webapp/build.gradle

dependencies {
    compile project "core:users"

When I run webapp $ ../gradlew bootRepackage I get

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':core:users:bootRepackage'.
> Unable to find main class

But core project is not meant to have a main class, it’s more like library.

I have tried configuring my webapp/settings.gradle to include only clients instead of whole core like this:

project(':core:users').projectDir = new File(settingsDir, '../core/users/')

but then instead i get “cannot find task compile()” or something like that. Here you will find the rest of configurations