Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven - Generate Jar and War

I have a CXF WS project that I would use it in another project, I would consume this WS in a Web Project but I don't know how to generate Jar file.

Please have you any idea or an example?

Thank you

like image 788
Mohamed Avatar asked Sep 06 '25 03:09

Mohamed


1 Answers

The maven-war-plugin supports creating a separate artifact that just contains the classes.

http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html

See the 'attachClasses' parameter. No need to add in the jar plugin or mess with the packaging. Just add the war plugin to pluginManagement and turn this on.

However, I fear this this isn't what you want. To consume a CXF web service, you need a client. To get a client, follow the instructions in the CXF samples for how to generate and use client stubs. You'll want a separate maven project for this.

like image 55
bmargulies Avatar answered Sep 08 '25 12:09

bmargulies