2

I have a META-INF folder where the persitence.xml and orm.xml are located. When I build a jar file with following gradle those files are not getting included in the jar. How can i copy those files to the jar ?

Project structure

 src
 |
  - main(java/classes)
  - MET-INF(peristenc.xml, orm.xml)

Jar file code

jar {
    from {
     configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
     }
     {
      exclude "license/*.txt"
     }
}

Any help would be great

Sandeep Rao
  • 1,749
  • 6
  • 23
  • 41

1 Answers1

1

Add your files under your project-directory/src/main/resources/META-INF/your-dir-or-files and they should be picked up and added to the jar.

see META-INF/services in JAR with Gradle

Community
  • 1
  • 1
Carl Marcum
  • 109
  • 10