1

Im currently using an SBT plugin that runs as part of the compile task but wish to amend it. Have contacted author but no responses.

Can anyone give me a high-level overview of steps to import the functionality into my project so I can customise it? Its a single Object.

  • If the object is 'hooking' into compile task then I assume it should still extend plugin?

  • Currently, I have a compile error on import sbt.Keys._

import sbt._ works

import sbt.Keys._ object Keys is not a member of package set.

Do I need SBT jar as an unmanaged dependency of my project?

build.properties contains sbt.version=0.13.5

BTW - I shall be keeping original authors details in the code to attribute the code to them.


Edit.

I am using sbt-cxf-wsdl2java plugin.

I mainly wish to upgrade the version of CXF being used by the plugin, since this is hardcoded not the plugin object code.

I could fork it, change code, create new plugin and push to a repo to then declare in my project but this seems a lot of effort for a relatively small change - hence my wish to 'embed' the plugin code in my application.

I guess I need to read the docs and figure out how plugins work in order to understand this - but if anyone can give me a few pointers to save me time then I would really appreciate it.

build.sbt (with the relevant plugin bits):

lazy val wsPackage = "com.myCompany"

seq(cxf.settings :_*)

cxf.wsdls := Seq(
    cxf.Wsdl((resourceDirectory in Compile).value / "My.wsdl", Seq("-p",  wsPackage), "modelOutputDir")
)

plugins.sbt

addSbtPlugin("com.ebiznext.sbt.plugins" % "sbt-cxf-wsdl2java" % "0.1.4")
JamieP
  • 1,664
  • 2
  • 13
  • 16
  • 2
    Could you show your full build.sbt file? – mfirry Apr 13 '15 at 14:15
  • Have you looked at http://www.scala-sbt.org/0.13/docs/Plugins.html ? It describes how to write a simple plugin. BTW, latest sbt version is 0.13.8, although I think it shouldn't matter for writing a plugin. – 0__ Apr 13 '15 at 14:25
  • @JamieP Can you share what SBT plugin you speak of? Might help answering the question. – Dale Wijnand Apr 14 '15 at 13:36
  • Thanks for your comments - I have edit my post above. – JamieP Apr 15 '15 at 08:03

1 Answers1

1

In build.sbt, you can override configuration keys (which are located in com.ebiznext.sbt.plugins.CxfWsdl2JavaPlugin.Keys). For example:

lazy val wsPackage = "com.myCompany"

Seq(cxf.settings :_*)

cxf.cxfVersion := "3.1.2" // override CXF version

cxf.wsdls := Seq(
  cxf.Wsdl((resourceDirectory in Compile).value / "My.wsdl", Seq("-p",  wsPackage, "-impl", "-mark-generated"), "unique wsdl id")
)
Damien Beaufils
  • 544
  • 6
  • 10