Fork me on GitHub

This page discusses the use of the Rio plugin and goes into detail on how to build a service and build an OperationalString Archive (OAR). Specifically the using the rio:oar goal. Other goals of the plugin are fairly self explanatory. For the following goals, please refer to the goal specific documentation:

Building a Service

When building a service in a distributed environment, we want to build jars that account for the ability to instantiate a service implementation, and to account for classes that are needed for clients to communicate to the instantiated service. The table below outlines the types of jars we need to know about.

JAR file Description
service.jar This is the implementation jar for the service. The implementation jar contains all classes that the backend service requires to be instantiated. The implementation jar(s) will make up the classpath for the service.
service-api.jar The -api prefix is the naming convention used to indicate that this jar contains the API for using the service. The API (or download) jar contains the classes that clients need to access the service. Note that a download jar is required if the invoking client only knows about the interface the service you have developed (as opposed to knowing about any custom proxies and other service-specific support). In this case the client will use Rio's artifact: protocol to provision the requisite artifacts (as needed) and load the resolved jars from your local repository.

As discussed in the Conventions document, we create a multi-module project, where each module reflects the basic architectural elements of a distributed service.

Building an OperationalString Archive (OAR)

rio:oar

Using the Maven Rio Plugin, we create an additional artifact of type .oar for your project. The OAR contains the OperationalString and associated meta-data allowing you to deploy your service as an artifact.

A complete example from the springbean example follows:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-rio-plugin</artifactId>
    <version>${rio.plugin.version}</version>
    <extensions>true</extensions>
    <executions>
        <execution>
            <id>build-oar</id>
            <phase>package</phase>
            <goals>
                <goal>oar</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <opstring>${basedir}/src/main/opstring/springbean.groovy</opstring>
    </configuration>
</plugin>

Back to top

Version: 5.6. Last Published: 2017-01-01.