NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
gustafc
Joined: 11 Jun 2010 Posts: 2
|
Posted: Fri Jun 11, 2010 9:30 am Post subject: wsimport always rebuilds web service clients |
|
|
I have a NetBeans (6.8) project which consumes a number of different web services. The client code is auto-generated by NetBeans through the Ant wsimport task.
Every time I build, all web service clients are rebuilt even though the web services haven't changed, causing an unnecessarily slow build. If I did Ant manually, I'd just give the wsimport element a produces child element pointing at the output directory, but I can't figure out how to make NetBeans do the same thing. I experimented with "Edit Web Service Attributes" ⇒ "wsimport options", but that only allows me to add attributes to the wsimport element, not child elements.
How do I avoid the unnecessary web service client rebuilds? The only thing I can come up with is copy/pasting the generated Ant tasks from jaxws-build.xml to build.xml, but I'm hoping for a prettier way.
[Side note: Wouldn't it be a sane default behavior for NetBeans to automatically generate the depends/produces elements? Not to mention why the Ant task doesn't do this implicitly, considering that the one of the main points of a build tool is avoiding unnecessary recompilation, nag nag nag etc.]
(This question has also been asked on Stack Overflow.) |
|
| Back to top |
|
 |
mkuchtiak Posted via mailing list.
|
Posted: Thu Jun 17, 2010 4:50 pm Post subject: Re: wsimport always rebuilds web service clients |
|
|
Sorry for late response:
The depends/produces elements should prevent unnecessary
client-generation in project/build action:
<wsimport
sourcedestdir="${build.generated.dir}/jax-wsCache/AddNumbers_org"
destdir="${build.generated.dir}/jax-wsCache/AddNumbers_org" ...>
<depends
file="${basedir}/${conf-dir}xml-resources/web-service-references/AddNumbers_org/wsdl/AddNumbers_org.wsdl"/>
<produces dir="${build.generated.dir}/jax-wsCache/AddNumbers_org"/>
</wsimport>
Note:
As designed in Netbeans, the generated classes go into build directory
that's cleaned on Clean or Clean&Build action.
The Compile on Save / Deploy on save option forces user to use Clean &
Build instead of Build only.
Try to switch off the Compile on Save feature and check whether the
Build action still triggers the wsimport-generation.
mk
gustafc wrote:
| Quote: | I have a NetBeans (6. project which consumes a number of different web services. The client code is auto-generated by NetBeans through the Ant wsimport task.
Every time I build, all web service clients are rebuilt even though the web services haven't changed, causing an unnecessarily slow build. If I did Ant manually, I'd just give the wsimport element a produces child element pointing at the output directory, but I can't figure out how to make NetBeans do the same thing. I experimented with "Edit Web Service Attributes" ⇒ "wsimport options", but that only allows me to add attributes to the wsimport element, not child elements.
How do I avoid the unnecessary web service client rebuilds? The only thing I can come up with is copy/pasting the generated Ant tasks from jaxws-build.xml to build.xml, but I'm hoping for a prettier way.
[Side note: Wouldn't it be a sane default behavior for NetBeans to automatically generate the depends/produces elements? Not to mention why the Ant task doesn't do this implicitly, considering that the one of the main points of a build tool is avoiding unnecessary recompilation, nag nag nag etc.]
(This question has also been asked on Stack Overflow.) (http://stackoverflow.com/questions/3021101/in-netbeansant-how-do-i-avoid-wsimport-rebuilding-web-service-clients-every-bui)
|
|
|
| Back to top |
|
 |
gustafc
Joined: 11 Jun 2010 Posts: 2
|
Posted: Mon Jun 21, 2010 8:16 am Post subject: Re: wsimport always rebuilds web service clients |
|
|
Yes, I know about the produces/depends elements. The problem is that the file with the wsimport invocations is auto-generated by NetBeans, so adding things there seems utterly pointless as additions won't propagate to other developers, and even if they did, they'd be lost if someone fiddled with the web service reference settings through the IDE.
Right now, what I've done is that in build.xml I override the auto-generated targets calling wsimport, and provide the produces/depends elements as well as print a little warning about this not being the auto-generated targets and that any changes made to the web service reference through the IDE won't take effect until the overriding targets are updated. It works well, but I'd like to work with the IDE rather than against it.
| mkuchtiak wrote: | Sorry for late response:
The depends/produces elements should prevent unnecessary
client-generation in project/build action:
<wsimport
sourcedestdir="${build.generated.dir}/jax-wsCache/AddNumbers_org"
destdir="${build.generated.dir}/jax-wsCache/AddNumbers_org" ...>
<depends
file="${basedir}/${conf-dir}xml-resources/web-service-references/AddNumbers_org/wsdl/AddNumbers_org.wsdl"/>
<produces dir="${build.generated.dir}/jax-wsCache/AddNumbers_org"/>
</wsimport>
Note:
As designed in Netbeans, the generated classes go into build directory
that's cleaned on Clean or Clean&Build action.
The Compile on Save / Deploy on save option forces user to use Clean &
Build instead of Build only.
Try to switch off the Compile on Save feature and check whether the
Build action still triggers the wsimport-generation.
mk
gustafc wrote:
| Quote: | I have a NetBeans (6.8) project which consumes a number of different web services. The client code is auto-generated by NetBeans through the Ant wsimport task.
Every time I build, all web service clients are rebuilt even though the web services haven't changed, causing an unnecessarily slow build. If I did Ant manually, I'd just give the wsimport element a produces child element pointing at the output directory, but I can't figure out how to make NetBeans do the same thing. I experimented with "Edit Web Service Attributes" ⇒ "wsimport options", but that only allows me to add attributes to the wsimport element, not child elements.
How do I avoid the unnecessary web service client rebuilds? The only thing I can come up with is copy/pasting the generated Ant tasks from jaxws-build.xml to build.xml, but I'm hoping for a prettier way.
[Side note: Wouldn't it be a sane default behavior for NetBeans to automatically generate the depends/produces elements? Not to mention why the Ant task doesn't do this implicitly, considering that the one of the main points of a build tool is avoiding unnecessary recompilation, nag nag nag etc.]
(This question has also been asked on Stack Overflow.) (http://stackoverflow.com/questions/3021101/in-netbeansant-how-do-i-avoid-wsimport-rebuilding-web-service-clients-every-bui)
|
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|