How to configure Maven Plugin - Nolio LCM in VS code
search cancel

How to configure Maven Plugin - Nolio LCM in VS code

book

Article ID: 256447

calendar_today

Updated On:

Products

CA Release Automation - DataManagement Server (Nolio)

Issue/Introduction

There is a new feature of LCM available via Maven Plugin - Nolio LCM which allows to manage, create and update RA application and processes at code level without login to ROC UI.

Can we configure this plugin to work with VS code, as this is one of the preferred editor.

Environment

Version: 6.8 or higher

Component: CA RELEASE AUTOMATION

Resolution

The Maven Plugin - Nolio LCM can be configured with Microsoft Visual Studio Code (a.k.a. vscode). Follow the steps below for configuration.

1: Download the VS code for your respective environment and install the same

2: With successful installation of VS code, launch VS code application

3: Install the below plugins

   

  • code-groovy

4: Once the above plugin are installed, launch VS code Command Palette (CTRL+SHIFT+P on Windows) and run command "Developer: Reload Window"

5: Open VS code Command Palette and execute command Maven: Create Maven Project

   Note: If prompted for Java please install the appropriate java

   used maven-archetype-quickstart with version 1.4 

6: A Maven project with name demo is created in the selected directory. In VS code editor open the directory "demo" consisting maven project.

7: Navigate to the maven repository i.e.  ~/.m2/repository (windows) or "${user.home}/.m2/repository" and create below directories

com -> nolio -> lcm -> noliolcm-maven-plugin -> 1.0.0 (The version 1.0.0 should be same what the version of jar and pom file is)

8: Download the Maven Plugin - Nolio LCM and place the noliolcm-maven-plugin-1.0.0.jar and noliolcm-maven-plugin-1.0.0.po file in above directory.

9: Open the created demo project in Visual studio code and edit the created pom.xml file to include the nolio LCM plugin

<plugin>
          <groupId>com.nolio.lcm</groupId>
          <artifactId>noliolcm-maven-plugin</artifactId>
          <version>1.0.0</version>
</plugin>

10: Set the maven executable path in the VS code. Open settings in VS code and filter for maven setting and update Maven > Executable: Path

The example path will be(Windows)  ~/.m2\wrapper\dists\apache-maven-3.6.3-bin\****\apache-maven-3.6.3\bin\mvn

11: Try to build the maven project from VS code Command Palette (CTRL+SHIFT+P on Windows) > Maven: Execute Commands... > Clean

Build Success Output

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.658 s
[INFO] Finished at: 2023-01-02T15:58:34+05:30
[INFO] ------------------------------------------------------------------------

12: Add profile having details of nolio instance in Maven settings.xml. It can be even added at project level also, but we are going to add it to global project settings level. The settings.xml file, if not present create the one at path ~/.m2(windows) or "${user.home}/.m2/"

settings-1.0.0.xsd">
 <localRepository/>
 <interactiveMode/>
 <offline/>
 <pluginGroups/>
 <servers/>
 <mirrors/>
 <proxies/>
<profiles>
 <profile>
 <id>default</id>
 <activation>
 <activeByDefault>true</activeByDefault>
 </activation>
 <properties>
 <nolioUser>superuser</nolioUser>
 <nolioPassword>****</nolioPassword>
 <nolioHost>http://localhost:8080</nolioHost>
 </properties>
 </profile>
 </profiles>
<activeProfiles/>
</settings>

Only profile section (If the file is present just add the only profile section as below.)

<profile>
 <id>default</id>
 <activation>
 <activeByDefault>true</activeByDefault>
 </activation>
 <properties>
 <nolioUser>superuser</nolioUser>
 <nolioPassword>*****</nolioPassword>
 <nolioHost>http://localhost:8080</nolioHost>
 </properties>
 </profile>

12: With above configuration the complete project is setup up. Inside your maven project i.e. demo\scr\main create a resources directory if not present.

13: Create a deploy.nolio file in the resources directory created above. This will be mapping to noliolcm:deploy goal. The file syntax will be groovy. To let VS code know the mapping of groovy language syntax for *.nolio file, navigate to VS Code > File > Preferences > Settings > Key in File Associations > Files > Add Item as below

14: Add a static print statement to deploy.nolio file as below

println("Demo application from LCM")

15: Execute a command in VS code Command Palette (CTRL+SHIFT+P on Windows) > Maven: Execute Commands... > Custom > noliolcm:deploy 

 

The build output will print the static message

The Nolio (a.k.a CARA) LCM plugin is configured for maven project in VS code.

Additional Information

Please refer to Tech Doc Maven Plugin - Nolio LCM for more details