How to prevent a jar to compile multiple times during build

I have one source code folder named as “MyApp_Jmeld” folder inside my project workspace. I am creating jar of this folder but my requirement is to not create jar every time during the build instead jar will compile only once.

The goal is to create a Jar that we include in our normal library and path and not have to compile it and jar it for every build. I want to keep the Project and code around in case we ever have to change the underlying code for something (for which I am creating jar) but it hasn’t changed nor likely will and it’s unnecessary to build it each time nor have to bring project and code down from trunk or in branches going forward. So I want to break that dependency from workspace setup, builds, etc. and just reference the JAR – but don’t delete the Project or code (for which I am creating jar).

I am using gradle to make build.