Making jar from custom sourceset

I have a project which was not constructed using Gradle before, and I am adding Gradle to it.
(I have seem something similar but not quite sure how to apply to my case Gradle: custom source set as dependency for the main and test ones)
The original source folders are separated, so I added something similar to the following.

sourceSets {

      cus{
        java {
            srcDir 'cus'
        }

      }

   adm{
        java {
            srcDir 'adm'
        }

      }
	  
	 common{
        java {
            srcDir 'common'
        }

      }
}

Note: I do not have a “main” sourceSet.

Now I want package each sourceSet into a separate jar, and have the following (each sourceSet do have dependencies on each other)

task cusJar(type: Jar) {
    
    from(sourceSets.cus.output) {
        include '**/*.class'
    }
	
}

When I execute this, Gradle will also execute “compileCusJava”, but this task will fail, because it cannot find any of the jar files I defined in “dependencies” or other sourseSet.
How do I set this up correctly and efficiently?

Note: When I do “compileJava” everything is fine.

How did you configure the dependency to other sourceSets?

Have you used something like:

sourceSets {
    adm
    cus{
        compileClasspath += sourceSets.adm.output
    }
 }

No, I did not do that, at least not yet.
Because all my source folders have dependencies depends on each other, so I was wondering do I have to do that for all the sourceSets?

So I must do something like this for all my sourceSet? and if I add another one I have to add it to all other sourceSets? Or is there a more clever way of doing this?

sourceSets {

      cus{
        java {
            srcDir 'cus'
        }
        compileClasspath += sourceSets.adm.output + sourceSets.wkf.output + sourceSets.common.output
      }

   adm{
        java {
            srcDir 'adm'
        }

        compileClasspath += sourceSets.cus.output + sourceSets.wkf.output + sourceSets.common.output

      }
}

for common configurations you can do something like this:

sourceSets.all{
    compileClasspath += sourceSets.common.output
}

and then do the specific configurations per sourceSet. Why do you have
so many sourceSets? Maybe this could be better modeled using projects.

This is an old project and we were trying separate modules into different source folders and package them into different jars show our modularity.
I can see separating them into project sounds good, but there will be lots circular dependencies between the projects, not sure if it will cause problems.
Also, I am trying to preserve how the project presents in our Eclipse. (this is a good-to-have option but not necessary)