Maven - Generate Jar and War

后端 未结 8 2088
轻奢々
轻奢々 2020-12-29 04:24

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

8条回答
  •  臣服心动
    2020-12-29 04:41

    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.

提交回复
热议问题