Ashish Sood
Ashish Sood

Reputation: 192

How to add a xml a file as dependency using gradle?

I have a project build on gradle and it has a directory src/main/dist/deploy. In deploy folder there is a xml file. This xml file i want to add as a dependency in the jar file which my build.gradle is generating. This jar i am adding in the lib folder of another project that has a dependency on my gradle project. The other project is built using ant. When classes bundled in gradle jar are loaded from ant project they are unable to read that xml file from the gradle jar.

Upvotes: 1

Views: 1548

Answers (1)

RaGe
RaGe

Reputation: 23697

The standard java plugin does not look in src/main/dist/deploy for resources.

You should either move the xml file into java plugin's standard resource folder src/main/resources, or add the dist/deploy folder to your main sourceSet's resource list.

Upvotes: 0

Related Questions