-
Notifications
You must be signed in to change notification settings - Fork 4
Working with Maven projects
As part of vRealize Automation Content Generator, we provide a Maven archetype definition that allows you to create new projects easily.
mvn archetype:generate \
-DarchetypeGroupId=com.vmware.devops \
-DarchetypeArtifactId=vrealize-automation-content-generator-project \
-DarchetypeVersion=1.0 \
-DgroupId=<your.group.id> \
-DartifactId=<myProject> \
-Dinstance=https://<vra-instance> \
-DloginInstance=https://<vra-instance> \
-Dusername=xxxx \
-Dpassword=xxxx \
-DrefreshToken=xxxx \
-Dinitialize=false
Breaking the command down:
-
-DarchetypeGroupId,-DarchetypeArtifactIdand-DarchetypeVersionare Maven options that notify what arhetype you want to generate -
-DgroupIdand-DartifactIdare standard Maven properties that describe your project. Refer to Maven documentation for more information. - (Optional)
-Dinstanceand-DloginInstancedescribe where is the vRealize Automation instance you'll be using- For on-prem deployments, both options should point to the vRealize Automation load balancer
- (Default) For vRA Cloud do not pass these options. It will default to
-Dinstance=https://api.mgmt.cloud.vmware.comand-DloginInstance=https://console.cloud.vmware.com
-
-Dusername-Dpasswordand the-DrefreshTokenare authentication options. You need to specify one of the two:-
-Dusernameand-Dpassword. This option works only for on-prem vRealize Automation deployments -
-DrefreshToken- refresh token. For additional information refer to VMware Cloud documentation or vRealize Automation documentation respectively
-
-
Dinitialize- reverse generate the existing content in the system. Works only when-DrefreshTokenis used. For username and password, reverse generation needs to be executed manually after the setup bellow.
After the project is created, if you're using username and password edit the initialized pom.xml file and update the following section as described:
<!-- If you're using username/password, uncommend this section -->
<!-- <argument>-u</argument>-->
<!-- <argument>${target.username}</argument>-->
<!-- <argument>-p</argument>-->
<!-- <argument>${target.password}</argument>-->
<!-- And remove this -->
<argument>-t</argument>
<argument>${target.refreshToken}</argument>
<!--END-->
There are 2 sections that need to be updated.
mvn clean compile will compile all the sources in your project. You can use this to verify there are ano syntax errors when editing.
mvn clean install will run any tests in the projects. See Custom objects.
mvn clean deploy -PreverseGenerate will reverse generate existing content from the system and import the sources in the project. See [Reverse generation](Generation and reverse generation)
mvn clean deploy - create or update vRealize Automation content in the system. See Generation