0

I have a webserver written in Scala using scalatra (embedded jetty) and building with Gradle.
I am trying to create a distributable which will contain the structure bin/lib/etc.

The code below creates what I want when run gradle distZip but I am struggling to find what is needed to compile and place the runnable jar in the bin folder.
What steps am I missing?

distributions {
    main {
        baseName = 'webServer'
        contents {
            into('bin') {
                // What goes here???
            }
            into('lib') {
                from configurations.runtime
            }
            into('etc') {
                from ('src/main/webapp/WEB-INF')
            }
        }
    }
}
LK__
  • 6,515
  • 5
  • 34
  • 53

1 Answers1

1

I assume you want to copy the jar file that is produced by the jar task, added by the scala plugin. The jar task, of type Jar, has an archivePath property containing the name of the archive file produced by the task. So what you want is

from jar.archivePath
JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255