简体   繁体   English

为什么JBoss Resteasy maven依赖项不起作用?

[英]Why won't JBoss Resteasy maven dependency work?

I added 我加了

<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-jaxrs-all</artifactId>
    <version>2.2.1.GA</version>
    <scope>provided</scope>
</dependency>

and I'm using 我正在使用

<repositories>
    <repository>
        <id>jboss</id>
        <url>http://repository.jboss.org/nexus/content/groups/public</url>
    </repository>
</repositories>

When I try to build, I get the following error. 当我尝试构建时,出现以下错误。 What am I doing wrong? 我究竟做错了什么?

[ERROR] Failed to execute goal on project tapvox-api: Could not resolve dependencies for project com.myproject.api:myproject-api:war:1.0-SNAPSHOT: Could not find artifact org.jboss.resteasy:resteasy-jaxrs-all:jar:2.2.1.GA in jboss ( http://repository.jboss.org/nexus/content/groups/public ) -> [Help 1] [错误]无法在项目tapvox-api上执行目标:无法解析项目com.myproject.api:myproject-api:war:1.0-SNAPSHOT的依赖项:找不到工件org.jboss.resteasy:resteasy-jaxrs-all :jar:2.2.1.GA在jboss中( http://repository.jboss.org/nexus/content/groups/public )-> [帮助1]

The dependency that you are trying to download does not have any jars or transitive dependencies. 您尝试下载的依赖项没有任何jar或传递性依赖项。 Since the default type is jar, then this will fail. 由于默认类型为jar,因此这将失败。 If you put 如果你把

<type>pom</type>

in your dependency, then you get the only artifact that this dependency has to offer. 在您的依赖项中,那么您将获得此依赖项必须提供的唯一工件。 See pom pom

I guess that you are trying to fetch the wrong dependency. 我猜您正在尝试获取错误的依赖关系。

You have to specify a dependency type. 您必须指定一个依赖类型。 Change your dependency to look like this: 更改您的依赖关系,如下所示:

<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-jaxrs-all</artifactId>
    <version>2.2.1.GA</version>
    <type>pom</type>                             <<<<<
    <scope>provided</scope>
</dependency>

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

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