[Solved] How to Compile gradle project with another project as a dependency?

Hi

This is not a jme related question, but following instruction on the web i could not add one project as a dependency to other project so decided to ask here.

when compiling i am getting

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':distTar'.
> Configuration with name 'default' not found.

This is project structure :

And i want add jme3-lwjgl3 as dependency to sim-eth-es project.

Here is how i am doing it, but it does not work

Adding these lines to settings.gradle in sim-eth-es project :

include ":jme3-lwjgl3"
project(':jme3-lwjgl3').projectDir = new File(settingsDir, '../jmonkeyengine/jme3-lwjgl3')

and adding this to build.gradle in sim-eth-es project :

dependencies {
 
    //add your dependencies 
    ...
    compile project(':jme3-lwjgl3')
}

but i am getting this error when building project :

Could not determine the dependencies of task ':distTar'.
> Configuration with name 'default' not found.

Anyone can help, please ?

Don’t depend on it as another project… because that’s for subprojects within a master project which this is not.

Just depend on the regular dependency. Make sure mavenLocal is in your repo list… and make sure to ‘gradle install’ the dependencies.

Else you will have to create a parent project with a settings file that has all of the subprojects in it, etc… it’s ultimately a mess.

1 Like

Thanks, i could publish to maven local repo using ‘gradle install’.