Chapter 8. Deploying Red Hat JBoss BPM Suite artifacts to SOA Repository Artifact Model and Protocol (S-RAMP) repository

While Red Hat JBoss BPM Suite and S-RAMP are two independent products, it is possible to move artifacts between them. You can move artifacts from JBoss BPM Suite to S-RAMP using Maven or via a user interface.
This section provides information about these two processes.

8.1. Deploying Red Hat JBoss BPM Suite artifacts to SOA Repository Artifact Model and Protocol (S-RAMP) using Maven

Before you can deploy Red Hat JBoss BPM Suite artifacts to S-RAMP using Maven, you will need to enable the S-RAMP Maven Wagon. The Maven Wagon is a key feature that supports the S-RAMP Atom based REST API protocol. By enabling the S-RAMP Maven Wagon, users will be able to access artifacts from the S-RAMP repository as dependencies in a Maven project.
Enable the S-RAMP Maven Wagon by making an edit in the pom.xml file as shown below:
<build>
  <extensions>
    <extension>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-wagon</artifactId>
      <version>${s-ramp-wagon.version}</version>
    </extension>
  </extensions>
</build>
Once the S-RAMP Maven Wagon is enabled, you can deploy the JBoss BPM Suite artifacts to that S-RAMP repository. To do this, follow the steps below:
  1. Clone the git repository where you have saved the BPM Suite project by running this command:
    git clone http://localhost:8001/REPOSITORY_NAME
  2. On the command line, move into the folder that contains the project.
  3. Follow the instructions in Red Hat JBoss Fuse Service Works 6 Development Guide, Volume 3: Governance, section Deploying to S-RAMP. Use the URL from the example below:
    <distributionManagement>
      <repository>
        <id>local-sramp-repo</id>
        <name>S-RAMP Releases Repository</name>
        <url>sramp://S-RAMP_SERVER_URL/s-ramp-server/</url>
      </repository>
      <snapshotRepository>
        <id>local-sramp-repo-snapshots</id>
        <name>S-RAMP Snapshots Repository</name>
        <url>sramp://S-RAMP_SERVER_URL/s-ramp-server/</url>
      </snapshotRepository>
    </distributionManagement>
    With these settings, Maven deployments are sent directly to the S-RAMP repository using the S-RAMP API. Note that artifacts are added to the S-RAMP repository with an artifact type based on the Maven type of the project. You can override this behavior by adding a query parameter to the repository URL in the pom.xml file. For example:
    <distributionManagement>
      <repository>
        <id>local-sramp-repo</id>
        <name>S-RAMP Releases Repository</name>
        <url>sramp://S-RAMP_SERVER_URL/s-ramp-server/?artifactType=KieJarArchive</url>
      </repository>
    </distributionManagement>
    
    The above example causes the Maven artifact to be uploaded with an S-RAMP artifact type of KieJarArchive.
  4. Amend the maven plug-in in file pom.xml and add a dependency to it as follows in case the project does not contain decision tables:
    <plugins>
        <plugin>
          <groupId>org.kie</groupId>
          <artifactId>kie-maven-plugin</artifactId>
          <version>6.0.2-redhat-6</version>
          <extensions>true</extensions>
          <dependencies>
              <dependency>
                  <groupId>org.jbpm</groupId>
                  <artifactId>jbpm-bpmn2</artifactId>
                  <version>6.0.2-redhat-6</version>
              </dependency>
          </dependencies>  
         </plugin>
        </plugins>
    
    If the project contains decision tables, use this dependency for the kie-maven-plugin instead:
    <plugins>
        <plugin>
          <groupId>org.kie</groupId>
          <artifactId>kie-maven-plugin</artifactId>
          <version>6.0.2-redhat-6</version>
          <extensions>true</extensions>
          <dependencies>
              <dependency>
                   <groupId>org.drools</groupId>
                   <artifactId>drools-decisiontables</artifactId>
                   <version>6.0.2-redhat-6</version>
               </dependency>
          </dependencies>  
         </plugin>
        </plugins>
    
  5. Run a clean Maven deployment using the following command:
    mvn -s sramp-settings.xml deploy
    .

Note

For the Maven deployment to the S-RAMP repository, it is necessary to have credentials set in the settings.xml file. For further details on the credentials, refer to Red Hat JBoss Fuse Service Works (FSW) documentation on Authentication.