JBoss.orgCommunity Documentation

第 58 章 Maven and RESTEasy

JBoss's Maven Repository is at: https://repository.jboss.org/nexus/content/groups/public/

RESTEasy is modularized into 20 plus components. Each component is accessible as a Maven artifact. As a convenience RESTEasy provides a BOM containing the complete set of components with the appropriate versions for the "stack".

It is recommended to declare the BOM in your POM file, that way you will always be sure to get the correct version of the artifacts. In addition, you will not need to declare the version of each RESTEasy artifact called out in the dependencies section.

Declare the BOM file in the dependencyManagement section of the POM file like this. Note that Maven version 2.0.9 or higher is required to process BOM files.

    
    <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>org.jboss.resteasy</groupId>
          <artifactId>resteasy-bom</artifactId>
          <version>${version.resteasy}</version>
          <type>pom</type>
          <scope>import</scope>
        </dependency>
      </dependencies>
    </dependencyManagement>
  
  

Declare the specific RESTEasy artifacts you require in the dependencies section of the POM file like this.

    
     <dependencies>
       <dependency>
          <groupId>org.jboss.resteasy</groupId>
          <artifactId>resteasy-client</artifactId>
       </dependency>
        ....
   </dependencies>
  
  

It is possible to reference a RESTEasy artifact version not in the current BOM by specifying a version in the dependency itself.

    
     <dependencies>
       <dependency>
          <groupId>org.jboss.resteasy</groupId>
          <artifactId>resteasy-client</artifactId>
          <version>${version.some.other}<version>
       </dependency>
        ....
   </dependencies>