runtimeOnly(project("project1")), because the module has more than 2 jar artifacts.
But this is not true. result:
org.gradle.api.InvalidUserCodeException: Querying the mapped value of task ‘:project1:shadowJar’ property ‘archiveFile’ before task ‘:project1:shadowJar’ has completed is not supported
If you have better answer, please add a comment about this, thank you!