Gradle Wrapper, Hibernate source code and my .jars


(dmitry.goman) #1

I have modified Hibernate source code and used some personal jars, how to tell Gradle that these jars are now part of my project ?Because when I try to “gradlew clean install” Gradle doesn’t see my jars, it says package “nameofmypackage” doesn’t existe, but in Eclipse everything works just fine. I use gradle wrapper.


(Luke Daley) #2

I have modified Hibernate source code and used some personal jars

Where are these personal jars stored? How are they “used”?


(dmitry.goman) #3

They are stored in “C:\Users\gomand\TB\Instrumentation”. I modified buildpath inside my Eclipse project in order to use jars in this folder. How are they used ? Hmm I just call methods from this jar inside my Hibernate source code project.


(Luke Daley) #4

You need to make Gradle aware of these jars as well. Gradle doesn’t read the Eclipse metadata for this information.

Check out the userguide chapter on dependency management.


(dmitry.goman) #5

so if add smth lïek this in build.gradle file:

dependencies { compile files(‘libs/ch.hesge.csim2.instrumentor.runtime_1.0.0.jar’) }

it would work, righ ?


(Luke Daley) #6

Yes, assuming it’s not shadowed by something else on the classpath.


(dmitry.goman) #7

ok thank you, it works.


(Luke Daley) #8

You’re most welcome. Happy Gradle’ing.