Confused about how to jar and collect projects

So I’ve been using Gradle to build my projects for a while, I’ve got all my configurations set up correctly to work but at the moment I’m doing this manually and it’s becoming a pain.

I have several projects that have to be built in a specific order. I can’t figure out for the life of me how to do this though.

Project A gets turned into a jar, Project B has it as a dependency. Then I have several ‘plugins’ that use Project B as a dependency. I want to jar the several plugins after Project B is jarred, then copy them into the build folder of Project B. Is this even possible or am I going to have to continue doing it manually?

If you’re modeling the dependencies as expected, you shouldn’t care about order. Naturally, if the plugins depend on project B, it will be built before the plugins, and if project B depends on project A, project A will be built first.

If you have a small sample project that shows what you’re doing manually, it should be very straight-forward to give you some alternatives.