Question

I'm well aware to the very similar post about project specific JVM options in SBT. and it was most helpfull. I used @gourlaysama solution (from the comments) and used -J-XsomeOption syntax in the .sbtopts file. And locally, it works great! but I use jenkins with sbt plugin, which seems to ignore the .sbtopts file completely! so, is there any way to get jenkins to execute sbt with custom options for each sbt project?

configuring SBT globally would be a terrible idea, since jenkins runs many jobs, and I would'nt want those configurations to take place in any other project.

the project structure:

my-project/
|-- module1/
|   |-- src/
|   `-- build.sbt
|-- module2/
|   |-- src/
|   `-- build.sbt
...
|
|--- integration-test-module/
|    |-- src/
|    `-- build.sbt
|-- project/
|   |-- build.properties
|   |-- Build.scala
|   `-- plugins.sbt
|-- build.sbt
`-- .sbtopts
Was it helpful?

Solution

The .sbtopts file support is a feature of the sbt launch script (bash), not of sbt itself, but the Jenkins plugin calls the sbt launcher jar directly, hence your problem.

Your only options is to manually add your JVM/SBT options in the Jenkins build configuration, under the "Build using sbt" section, see the sbt plugin page.

A more long-term option would be to add support for reading .sbtopts to the Jenkins plugin.

Edit: I just added support for .sbtopts to the sbt jenkins plugin. It should be in the next (1.5) version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top