Maven POM Changes
Following are the changes required in the service pom.xml:
Ensure minimum version of mobile-service-parent
Assumes the project uses mobile-service-parent. Check for latest version.
|
<parent>
<groupId>gov.va.mobile.service</groupId>
<artifactId>mobile-service-parent</artifactId>
<version>2.1.6</version>
<relativePath/>
</parent>
Remove vamf properties
Remove the following properties:
<vamf.service.basepath>/users/v2</vamf.service.basepath>
<vamf.service.version.majorVersion>2</vamf.service.version.majorVersion>
<vamf.service.main>gov.va.sms.v2.service.Application</vamf.service.main>
Add the following property:
<start-class>gov.va.vamf.user.v2.Application</start-class>
Add these values to the application.properties file under src/main/resources.
spring.application.name=user-services-v2
server.servlet.context-path=/users/v2
Configure the Tiles plugin
| At the current time the lastest version is 2.4.2 |
Set the NGSS Tiles version POM property in the service module to allow easy, DRY, upgrading when necessary:
<properties>
<!-- ... other project properties -->
<ngss-maven-tiles.version>2.4.2</ngss-maven-tiles.version>
</properties>
The following tiles are required for a standard Java service:
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>gov.va.mobile.tools.maven:skaffold-tile:${ngss-maven-tiles.version}</tile>
<tile>gov.va.mobile.tools.maven:jacoco-integration-tests-tile:${ngss-maven-tiles.version}</tile>
<tile>gov.va.mobile.tools.maven:jib-maven-plugin-tile:${ngss-maven-tiles.version}</tile>
<tile>gov.va.mobile.tools.maven:filegen-tile:${ngss-maven-tiles.version}</tile>
<tile>gov.va.mobile.tools.maven:dibr-readme-generator-tile:${ngss-maven-tiles.version}</tile>
<tile>gov.va.mobile.tools.maven:vv-automation-tile:${ngss-maven-tiles.version}</tile>
</tiles>
</configuration>
</plugin>
The name of ci-file-generator has changed to ngss-filegen-maven-plugin as of version 5.0 to be more descriptive.
The prefix that can now be used to run the plugin, as opposed to the full plugin name, is filegen (examples are below).
|
Add the test lib to the pom
skaffold-test-lib is a library we maintain that helps wire together skaffold with our testing. Documentation on it can
be found here.The three main features
gained are in removing k8sServiceProperty references to url and port and replacing them with:
@Override
public String getServiceUrl() {
return SkaffoldTestSupport.getServiceUrl("vista-site-info-service-v1", 8080, "/vsis/v1");
}
@Override
public String getActuatorUrl() {
return SkaffoldTestSupport.getServiceUrl("vista-site-info-service-v1", 8081);
}
@Override
public String getWireMockHost() {
return SkaffoldTestSupport.getHost("wiremock");
}
@Override
public int getWireMockPort() {
return SkaffoldTestSupport.getPort("wiremock", 8080);
}
Which will communicate with the Skaffold API server (by default running on port 50051) to set the correct port and URL.
These annotations will only be valid when used with Junit 5 methods that are annotated with @Test
|
Below is the dependency needed in the service pom:
<skaffold-test-lib.version>1.2.0</skaffold-test-lib.version>
...
<dependency>
<groupId>gov.va.mobile.lib</groupId>
<artifactId>skaffold-test-lib</artifactId>
<version>${skaffold-test-lib.version}</version>
<scope>test</scope>
</dependency>