Creating a Project using Maven and the Archetype


Bundle development involves the development of an application or a library. All the code for an application or a library is packaged and deployed as a deployment package. A bundle has a project structure in the development environment. 

Important

  • Use the developer account to develop an application or library.
  • A developer account is set with an administrator role. The developer account does not require the domain identifier to log in. You can log in to BMC Helix Innovation Studio with just the user name without the developer.com domain.

The following video (5:41) provides details to create a Maven project using BMC Helix Innovation Studio SDK and Integrated Development Environment (IDE) and deploying the project to your system.

The video shows an older version of BMC Helix Innovation Studio. Although there might be minor changes in the UI, the overall functionality remains the same.

icon_play.png https://youtu.be/_aXeUOGRlNY

To create a new project

To create a new application project or library project, use the Maven archetype with the BMC Helix Innovation Studio SDK. For your projects, decide where you want your project code to reside. We recommend that you do not place the project code at the BMC Helix Innovation Studio SDK location. For example, create a new project in the root directory.


  1. At the command prompt, navigate to the directory to create a project.
    For example, C:\projects
  2. Run the following command to create a project for application development or library development:

    mvn archetype:generate -DarchetypeGroupId=com.bmc.arsys -DarchetypeArtifactId=rx-sdk-archetype-application -DarchetypeCatalog=local

    The following table defines the arguments:

    Archetype argument

    Description

    -DarchetypeGroupId=com.bmc.arsys

    Maven uses BMC archetypes.

    -DarchetypeArtifactId=rx-sdk-archetype-application

    This argument sets the POM file to create an application package and generates a working UI.

    -DarchetypeCatalog=local

    This argument uses only the local catalog.

    For more information about the Maven archetype, see Maven archetype plugin in the Maven documentation.
    The command starts the archetype plugin in interactive mode and prompts for the property values. 

  3. Enter the values for the following properties:

  4. Confirm the configuration of all the properties.
  1. If any dependencies on other bundles exist, add the dependencies.
    See Using-components-from-another-application-or-library.
  2. If any third-party dependencies exist, add the third-party dependencies.
    See Using code from open-source v22.1.


To set up the development server environment properties in the project pom.xml file

After you create the application (or library) project, you must modify the user credentials in the project pom.xml file.  

  1. Open the parent pom.xml file located in project folder; for example, projects\work-order-lib\pom.xml.
  2. Modify the properties section that specifies the environment information provided with your Development Server instance.

    <!-- START: Bundle specific configuration. Verify and Change as per environment -->

      <developerUserName>developer</developerUserName>
      <developerPassword>mydeveloperpw</developerPassword>
      <overlayMode>1</overlayMode>

      <!-- Server name with Jetty port. -->
      <webUrl>https://developer.innovate.bmc.com</webUrl>

    <!-- END: Bundle specific configuration.-->

    The following table lists the properties in the pom.xml file:

    Property name

    Description

    developerUserName

    Application developer that you create while requesting a sandbox.

    developerPassword

    Application developer password.

    overlayMode

    Value of this property determines the application development mode.

    Valid values:

    0—Base Development Mode.

    1—(Default) Best Practice Customization Mode

    We recommend that you use Best Practice Customization Mode for developing your application.

    When you deploy the application for the first time, the overlayMode property determines how the application is deployed.

    If you develop the application in Base Development Mode (value 0), it is deployed in the Base Development Mode. Similarly, if you develop the application in the Best Practice Customization Mode (value 1), the application is deployed in the Best Practice Customization Mode.

    For more information, see the Customization-layer.

    webUrl

    webUrl of your sandbox. 
    For example: http://Calbro-dev.com:<8008>

  3. Save the changes.

To set up dependencies that are needed for your bundle

The dependencies on the other bundles are declared in the bundle\pom.xml file. Use the following content for the rx-sdk.bundledependencies tag:

The syntax is bundleid;version. Use commas to separate each bundle.

<properties>
<!-- Comma separated Bundle Dependencies with version.  -->
<rx-sdk.bundleDependencies>standardlib;${rx-sdk.version},com.bmc.arsys.rx.approval;${rx-sdk.version},com.bmc.arsys.rx.assignment;${rx-sdk.version},com.bmc.arsys.rx.foundation;${rx-sdk.version}</rx-sdk.bundleDependencies>
</properties>

Projects created by the archetype

The Maven archetype creates the following projects:

Project

Location

Parent project

<artifactId>/

Bundle project

<artifactId>/bundle/

Package project

<artifactId>/package/

The application bundle project and the deployment package project have their own build system pre-generated in the form of a Maven POM file. You can import these projects in Eclipse to customize and debug the application or library.

Warning

Some Maven repositories may not be available over HTTP, so if your Maven compilation fails due to the error, Return code is: 501, ReasonPhrase:HTTPS Required, then add the following entry in the <mirror> section in Settings.xml file located in your <maven installation>/conf directory.

<mirror>
<id>central-over-https</id>
<mirrorOf>central</mirrorOf>
<name>Maven Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</mirror>

Bundle attributes

Bundle (application or library) attributes and properties are defined in the project pom.xml file and bundle pom.xml file respectively.

The following table lists the project pom.xml file and bundle pom.xml file:

pom.xml file

Description

Sample code

Project pom.xml file

The project pom.xml file consists of the bundle attributes. The attribute values are defined in the maven-bundle-plugin configuration. You can edit this file to modify the attribute values.

The following code snippet illustrates a sample maven-bundle-plugin configuration in the project pom.xml file:

<properties>
   <rx-sdk.bundleId>${project.groupId}.${project.artifactId}</rx-sdk.bundleId>
   <rx-sdk.bundleName>${project.artifactId}</rx-sdk.bundleName>
   <rx-sdk.bundleFriendlyName>${project.name}</rx-sdk.bundleFriendlyName>
   <rx-sdk.bundleDescription>${project.description}</rx-sdk.bundleDescription>
   <rx-sdk.bundleDeveloperId>${project.groupId}</rx-sdk.bundleDeveloperId>
   <rx-sdk.bundleDeveloperName>${project.groupId}</rx-sdk.bundleDeveloperName>
   <rx-sdk.bundleIsApplication>true</rx-sdk.bundleIsApplication>
<properties>

Bundle pom.xml file

By default, the bundle pom.xml file consists of the properties that are used to define bundle-specific values. You can edit this file to customize your bundle.

The following code snippet illustrates a sample properties configuration in the bundle pom.xml file:

<plugin>
   <groupId>org.apache.felix</groupId>
   <artifactId>maven-bundle-plugin</artifactId>
   <version>${maven-bundle-plugin.version}</version>
   <extensions>true</extensions>
   <configuration>
       <instructions>
           <Bundle-Name>${rx-sdk.bundleName}</Bundle-Name>
           <Bundle-SymbolicName>${rx-sdk.bundleId}</Bundle-SymbolicName>
           <Bundle-Activator>com.mygroupid.bundle.MyApplication</Bundle-Activator>
<Bundle-Display-Version>${rx-sdk.bundleDisplayVersion}</Bundle-Display-Version>
           <Import-Package>*;resolution:=optional</Import-Package>
           <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
           <Bundle-Description>${rx-sdk.bundleDescription}</Bundle-Description>
           <Bundle-Vendor>${rx-sdk.bundleDeveloperId}</Bundle-Vendor>
           <RxBundle-DeveloperName>${rx-sdk.bundleDeveloperName}</RxBundle-DeveloperName>
           <RxBundle-FriendlyName>${rx-sdk.bundleFriendlyName}</RxBundle-FriendlyName>
           <RxBundle-IsApplication>${rx-sdk.bundleIsApplication}</RxBundle-IsApplication>
       </instructions>
   </configuration>
</plugin>

The following table lists the bundle properties:

Bundle property

Sample value

Bundle descriptor method

pom.xml node in the maven-bundle-plugin section

How to define value

Default value

Required

Description

ID

com.bmc.lunchorder

getIid()

<Bundle-SymbolicName>

Set property in the project\pom.xml file:

${rx-sdk.bundleId}

${project.groupId}.${project.artifactId}

Yes

Globally unique identifier for the bundle (i.e., Bundle Id)

Short Name

lunchorder

getName()

<Bundle-Name>

Set property in the project\pom.xml file:

${rx-sdk.bundleName}

${project.artifactId}

Yes

Bundle short name. Not a friendly name.

Friendly Name

Lunch Order

getFriendlyName()

<RxBundle-FriendlyName>

Set property in the project\pom.xml file:

${rx-sdk.bundleFriendlyName}

${project.name}

Yes

Friendly bundle name.

Description

An application that allows users to place lunch orders.

getDescription()

<Bundle-Description>

Set property in the project\pom.xml file:

${rx-sdk.bundleDescription}

${project.description}

Yes

Friendly long description of bundle. Derived during project creation.

Version

1.0.0.0

getVersion()

<Bundle-Version>

Set property in the project\pom.xml file:

${version}

${version}

Yes

Version of the bundle

Developer ID

com.bmc

developerId()

<Bundle-Vendor>

Set property in the project\pom.xml file:

 ${rx-sdk.bundleDeveloperId}

${project.groupId}

Yes

Id of bundle author. Not a friendly name.

Developer Name

BMC Software

getDeveloperName()

<RxBundle-DeveloperName>

Directly add <RxBundle-DeveloperName> node to the maven-bundle-plugin configuration

${project.groupId}

No

Friendly name of developer. Not in archetype or manifest by default.

Is Application?

true

getIsApplication()

<RxBundle-IsApplication>

Set property in the project\pom.xml file:

 ${rx-sdk.bundleIsApplication}

<based on archetype used>

 Yes

If you set this property value to true BMC Helix Innovation Studio creates an application. If you set this property value to false BMC Helix Innovation Studio creates a library..

Bundle Dependencies

com.bmc.arsys.rx.standardlib;1.0,com.bmc.arsys.rx.approval;2.0

getBependentBundles()

<RxBundle-Dependencies>

Directly add <RxBundle-Dependencies> node to the maven-bundle-plugin configuration

standardlib;9.5.00-SNAPSHOT

No

List of bundles that must be present before you deploy your code-based application.

Where to go from here

Deploying-your-application-for-the-first-time-to-start-working-in-BMC-Helix-Innovation-Studio

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*