Maven - 生成Jar和战争 [英] Maven - Generate Jar and War

查看:101
本文介绍了Maven - 生成Jar和战争的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个CXF WS项目,我会在另一个项目中使用它,我会在Web项目中使用这个WS,但我不知道如何生成Jar文件。

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?

谢谢

推荐答案

maven-war-plugin支持创建一个只包含类的单独工件。

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

请参阅'attachClasses'参数。无需添加jar插件或乱七八糟的包装。只需将war插件添加到pluginManagement并启用它。

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.

但是,我担心这不是你想要的。要使用CXF Web服务,您需要一个客户端。要获取客户端,请按照CXF示例中的说明了解如何生成和使用客户端存根。你需要一个单独的maven项目。

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.

这篇关于Maven - 生成Jar和战争的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆