Ah, yes. The declared dependency between the compileJava task and the wsgen
task was a copy and paste error. I was trying to figure out the wsgen task
based on the way you showed me how to run a wsimport task.
Removing that line means that the wsgen task is not called during the build.
In order to make it happen, I added
jar.dependsOn(wsgen)
but when the wsgen task ran, it still couldn't find the compiled SIB. :(
Here's my (customized) project layout, in case that's the problem:
sourceSets {
main {
java { srcDirs = [] }
groovy { srcDir 'src' }
}
test {
java { srcDirs = [] }
groovy { srcDir 'tests' }
resources { srcDir 'resources' }
}
}
I find this layout works really well for Eclipse projects that combine Java
and Groovy, as mine normally do.
Ken
On Thu, Sep 2, 2010 at 4:43 PM, Rene Groeschke <[email protected]> wrote:
> Hi again,
> sorry the snippet
>
> -- compileJava.dependsOn(wsgen) --
>
> confused me, since if the wsgen task depends on output of the
> compileJava task (compiled classes) you cannot configure the compileJava
> task to be dependent by wsgen.
>
> To add the compileJava output to the classpath of your wsgen task you
> can write:
>
> task wsgen(dependsOn: compileJava) {
> doLast{
> ant {
> taskdef(name:'wsgen',
> classname:'com.sun.tools.ws.ant.WsGen',
> classpath:(configurations.jaxws + sourceSet.main.classes).asPath)
> wsgen(keep:true,
> destdir: 'bin',
> sourcedestdir:'src',
> resourcedestdir:'resources',
> genwsdl:'true',
> sei:'mypackage.MySIB')
> }
> }
> }
>
> does this solve your wsgen classpath problems?
>
> regards,
> René
>
>
> Am 02.09.10 22:20, schrieb Kenneth Kousen:
> > My situation is actually the opposite of that. I'm assuming my SIB and
> SEI
> > were already compiled, and then I want to add their compiled classes to
> the
> > classpath when I run wsgen. The wsgen tool takes the compiled SIB as an
> > argument.
> >
> > Ken
> >
> > On Thu, Sep 2, 2010 at 4:16 PM, Rene Groeschke <[email protected]>
> wrote:
> >
> >> Hi Ken,
> >>
> >> do add the wsgen output to your compileJava classpath you can configure
> >> the compileJava task like this:
> >>
> >> compileJava{
> >> dependsOn(wsgen)
> >> setClasspath(files("bin") + getClasspath())
> >> }
> >>
> >> regards,
> >> René
> >>
> >>
> >>
> >> Am 02.09.10 21:44, schrieb Kenneth Kousen:
> >>> I'm trying to run the wsgen task inside gradle. The tool requires that
> >> the
> >>> directory of compiled classes be added to the classpath in order to
> run.
> >>>
> >>> My current setup includes:
> >>>
> >>> configurations {
> >>> jaxws
> >>> }
> >>>
> >>> task wsgen(dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME) {
> >>> doLast{
> >>> ant {
> >>> taskdef(name:'wsgen',
> >>> classname:'com.sun.tools.ws.ant.WsGen',
> >>> classpath:configurations.jaxws.asPath)
> >>> wsgen(keep:true,
> >>> destdir: 'bin',
> >>> sourcedestdir:'src',
> >>> resourcedestdir:'resources',
> >>> genwsdl:'true',
> >>> sei:'mypackage.MySIB')
> >>> }
> >>> }
> >>> }
> >>> compileJava.dependsOn(wsgen)
> >>>
> >>> dependencies {
> >>> ...
> >>> jaxws 'com.sun.xml.ws:jaxws-tools:2.1.4'
> >>> }
> >>>
> >>> The message I get is:
> >>> error: Could not find class file for mypackage.MySIB
> >>>
> >>> If I run wsgen from the command line, I need to add the 'bin' directory
> >> to
> >>> the classpath of the wsgen command. I see in the docs how to add
> >> specific
> >>> files to the classpath, but how do I add the entire directory?
> >>>
> >>> Thanks,
> >>>
> >>> Ken
> >>>
> >>
> >> --
> >> ------------------------------------
> >> Rene Groeschke
> >>
> >> [email protected]
> >> http://www.breskeby.com
> >> http://twitter.com/breskeby
> >> ------------------------------------
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >> http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >
>
>
> --
> ------------------------------------
> Rene Groeschke
>
> [email protected]
> http://www.breskeby.com
> http://twitter.com/breskeby
> ------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
--
Kenneth A. Kousen
President
Kousen IT, Inc.
Email: [email protected]
Site: http://www.kousenit.com
Blog: http://kousenit.wordpress.com
Twitter: @kenkousen