简体   繁体   中英

How setup java-first webservice client-jar in Maven?

Need some advice on how to setup maven-build of the client-jar for java-first webservices...

Previously, I have been working with wsdl-first webservices, where you simply save the wsdl in version-control and then generate the java client classes from it.

But recently I switched to another project, where most webservices are already existing as java-first, and we should now convert the builds from Ant to Maven.

What is the best way to set this up in maven and version-control to ensure you get the latest version of the wsdl?

Obviously you dont want to save the wsdl into version-control, since it is generated at runtime...

I guess one way is in your maven-build to start app-server on localhost, deploy the webservice to it, then build the client-jar from the localhost-url. Problem is the build might then fail if some dependencies (db-connections, other webservice, etc) are not available at build-time.

So is there some better way to do this?

I guess one way is in your maven-build to start app-server on localhost, deploy the webservice to it, then build the client-jar from the localhost-url.

Instead you could use maven wsgen plugin to generate the client artifacts in the directory of your choice. wsdl generation would be optional here.

There is nothing wrong in checking in the WSDL in version control. every time some one changes the public methods they need to update the WSDL manually or else your option of doing it by deploying it to local host is also nice idea but the client-generation would not be that frequent so you can rely on this too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM