Custom jar in gradle

I have compiled a jar file and I need to include on my project.
It works ok on my PC because if I add flatDir { dirs ‘C:\work\lib’ } to my build gradle, put my jar there and import it as a dependency.

Now I need a jenkins build. in linux. I cannot have “'C:\work\lib” anymore.
I tried creating a folder on resources there and adding that jar as a library. The IDE does not complain since it can find the file but when I run the application It cannot find the .jar file

im also getting Could not get unknown property ‘premiumRepoUser’ for root project ‘aptitude’ of type org.gradle.api.Project. on jenkins. Where should i place the gradle settings…

thank you for the help with these 2 issues.

You may put the jars into the libs directory in the root of the project and specify a relative path to it in the build.grade:

repositories {
    //...
    flatDir {
        dirs 'libs'
    }
}

Your second question is answered in this topic.

Thank you for the solution !!! very very helpful !!