Maven version upgrade

  1. Upgrade to Spring boot 2.2.6

    <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.6.RELEASE</version> </parent>
  2. Upgrade to latest tracer

    <dependency> <groupId>org.egov.services</groupId> <artifactId>tracer</artifactId> <version>2.0.0-SNAPSHOT</version> </dependency>



  3. Add typescript export for generating interfaces for all API request/response classes like below. Modify the class names according to the service respectively

    <plugin> <groupId>cz.habarta.typescript-generator</groupId> <artifactId>typescript-generator-maven-plugin</artifactId> <version>2.22.595</version> <executions> <execution> <id>generate</id> <goals> <goal>generate</goal> </goals> <phase>process-classes</phase> </execution> </executions> <configuration> <jsonLibrary>jackson2</jsonLibrary> <classes> <class>org.egov.collection.model.PaymentResponse</class> <class>org.egov.collection.model.PaymentRequest</class> <class>org.egov.collection.model.PaymentSearchCriteria</class> <class>org.egov.collection.web.contract.RemittanceRequest</class> <class>org.egov.collection.web.contract.RemittanceResponse</class> <class>org.egov.collection.web.contract.RemittanceSearchRequest</class> <class>org.egov.collection.web.contract.PaymentWorkflowRequest</class> <class>org.egov.collection.web.contract.BankAccountServiceMappingReq</class> <class>org.egov.collection.web.contract.BankAccountServiceMappingResponse</class> <class>org.egov.collection.web.contract.BankAccountServiceMappingSearchReq</class> </classes> <customTypeNaming> <customTypeNaming>org.egov.collection.model.enums.Purpose:BillDetailPurpose</customTypeNaming> </customTypeNaming> <customTypeMappings> <customTypeMapping>org.egov.common.contract.request.User:User</customTypeMapping> <customTypeMapping>org.egov.common.contract.request.RequestInfo:RequestInfo</customTypeMapping> <customTypeMapping>org.egov.common.contract.response.ResponseInfo:ResponseInfo</customTypeMapping> </customTypeMappings> <namespace>Digit</namespace> <debug>true</debug> <outputKind>module</outputKind> </configuration> </plugin>



  4. Add an entry for new context-path as below



  5. Please make sure you replace all properties from flyway.xxx to spring.flyway.xxx in the application.properties spring.flyway.url= spring.flyway.user= spring.flyway.password= spring.flyway.table= spring.flyway.baseline-on-migrate= spring.flyway.outOfOrder= spring.flyway.locations= spring.flyway.enabled=

  6. Also make sure not to change flyway.table value, or delete this in your config

  7. Replace the property spring.flyway.baselineOnmigrate=db/migration/main byspring.flyway.locations=classpath:/db/migration/main

  8. Add CHANGELOG.md to each service

  9. Increment the service number/patch version in pom.xml

  10. Make sure the KafkaConsumers are working

  11. run the command - mvn clean package. If build is successful , test the application/services in local.

  12. Raise a PR to merge it with the master.

  13. Deployment to any environments should now work for both old and new spring versions.

 

Issues Observed :

  1.  

Fix : spring.flyway.locations=classpath:/db/migration/main Add this path to flyway.locations while running in local

2.

Fix : This error occurs when mvn clean package is run in terminal. Add lenient().when() , wherever Mockito.when() is used. - https://www.baeldung.com/mockito-unnecessary-stubbing-exception

3.

Fix : Add snapshot dependency in <repositories> section

<repository>
<id>repo.egovernments.org.snapshots</id>
<name>eGov ERP Releases Repository</name>
<url><https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/</url>>
</repository>

 

4.

Fix : Replace org.springframework.kafka.listener.config.ContainerProperties by org.springframework.kafka.listener.ContainerProperties

Remove below snippet -

properties.setPauseEnabled(true);
properties.setPauseAfter(0);
properties.setGenericErrorHandler(kafkaConsumerErrorHandler);

Replace factory.getContainerProperties().setErrorHandle() by factory.setErrorHandler()

 

5

If there is a build failure like below

then use this base image given below in your repo /build/maven folder, there is a Dockerfile. Just replace the content of second line of the file.

https://github.com/egovernments/core-services/blob/684876097483a9566ecfd675a7ba9c54cdb14535/build/maven/Dockerfile#L2