简体   繁体   English

如何在我的Maven pom中包含apache-cxf作为依赖项?

[英]How can I include apache-cxf as a dependency in my Maven pom?

Apache CXF "syncs" their releases to the Maven central repository. Apache CXF将其发布“同步”到Maven中央存储库。 When I look at the CXF entries , there are no jar files, just the pom. 当我查看CXF条目时 ,没有jar文件,只有pom。

If I include the following section in my pom, the build fails because it can't download the cxf dependency: 如果我在我的pom中包含以下部分,则构建失败,因为它无法下载cxf依赖项:

<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf</artifactId>
    <version>2.1.3</version>
    <type>jar</type>
</dependency>

If I change the type to "pom," the build succeeds, but the appropriate jars are not downloaded (and thus, obviously, not included in the package.) 如果我将类型更改为“pom”,则构建成功,但不会下载相应的jar(因此,显然,不包含在包中)。

What am I missing? 我错过了什么?

See the samples. 查看样本。 What you did was depend on the aggregate project, and that has no effect. 你所做的是取决于聚合项目,这没有任何效果。

Typical is : 典型的是:

  <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <!-- Jetty is needed if you're using the CXFServlet -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
            <version>${cxf.version}</version>
        </dependency>

Point to the artifacts you need: 指向您需要的工件:

<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-api</artifactId>
    <version>2.1.3</version>
    <type>jar</type>
</dependency>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在通过JAX-RS(Apache-CXF实现)ExceptionMapper准备的错误响应中保留请求标头 - How can i preserve the request headers in error response prepared through JAX-RS ( Apache-CXF implementation) ExceptionMapper 在WebSphere上运行Apache-CXF - Running Apache-CXF on WebSphere 如何为Apache-CXF JAX-WS启用Spring Security - How to Enable Spring Security for Apache-CXF JAX-WS Apache-cxf JAXRSClient自定义日期格式 - Apache-cxf JAXRSClient custom Dateformat 如何指定MOXy JAXB作为Apache CXF 2.2.6的Apache CXF实现 - How can I Specify MOXy JAXB as my Apache CXF implementation for Apache CXF 2.2.6 我的Maven项目能否从依赖项中的pom导入依赖项? - Can my maven project import dependencies from a pom inside a dependency? Maven:对 pom 模块的依赖不包括其中的子模块 - Maven: Dependency to pom module is not include submodules from it 如何从项目的maven依赖树中删除旧的易受攻击的Apache commons集合版本依赖项? - How can I remove the old vulnerable Apache commons collection version dependency from my project's maven dependency tree? 如何在我的应用程序的 pom.xml 中包含库/sdk 的阴影 POM? - How can I include shaded POM of a library/sdk in my application's pom.xml? 查看导入列表后,如何确定要在POM中包含哪些Maven工件? - How do I figure out what maven artifacts to include in my POM after looking at the list of imports?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM