Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mosip-34016 Merge java 21 changes to develop #1514

Merged
merged 26 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2d1654c
MOSIP-34016 Migrate to java 21
kameshsr Jun 25, 2024
0e774d6
Migrate to java 21
kameshsr Jun 25, 2024
4eae169
Fixed startup issue
kameshsr Jun 25, 2024
6b0645e
Upgrade to openapi
kameshsr Jun 25, 2024
8192cdb
Merge pull request #1495 from kameshsr/MOSIP-34016
Sohandey Jun 26, 2024
3d450ef
MOSIP-34016 Fixed build failure
kameshsr Jun 26, 2024
da24b9d
Merge pull request #1497 from kameshsr/MOSIP-34016-1
Sohandey Jun 26, 2024
4650f3f
MOSIP-34016 Fixed build issue
kameshsr Jun 26, 2024
14f44d3
Fixed docker build issue
kameshsr Jun 26, 2024
dcc22ab
Merge pull request #1499 from kameshsr/MOSIP-34016-1
ckm007 Jun 26, 2024
7fa6deb
updated
Prafulrakhade Jun 27, 2024
3581260
updated
Prafulrakhade Jun 27, 2024
aa70647
updated
Prafulrakhade Jun 27, 2024
050e1ab
updated
Prafulrakhade Jun 27, 2024
bf7a7a2
updated
Prafulrakhade Jun 27, 2024
bf46182
updated
Prafulrakhade Jun 27, 2024
f5d57cb
Update Dockerfile
Prafulrakhade Jun 27, 2024
df56552
Update Dockerfile
Prafulrakhade Jun 27, 2024
2ac78e5
Merge pull request #1505 from Prafulrakhade/develop-java21
ckm007 Jun 28, 2024
0b9d0f0
MOSIP-34016 Corrected git commit id plugin
kameshsr Jul 2, 2024
34e7b34
Merge pull request #1512 from kameshsr/MOSIP-34016-1
ckm007 Jul 2, 2024
bdf1c06
[DSD-5636] Updated Dockerfile.
Mohanraj209 Jul 3, 2024
773faaa
[DSD-5636] Updated authdemo-push-trigger.yml
Mohanraj209 Jul 3, 2024
4676c63
Merge pull request #1513 from Mohanraj209/develop-java21
ckm007 Jul 3, 2024
f06268c
Merge branch 'develop-java21' of https://github.com/mosip/mosip-funct…
kameshsr Jul 4, 2024
9f5130b
Corrected pom version
kameshsr Jul 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/authdemo-push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:

jobs:
build-maven-authentication-demo-service:
uses: mosip/kattu/.github/workflows/maven-build.yml@master
uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21
with:
SERVICE_LOCATION: ./authentication-demo-service
BUILD_ARTIFACT: authentication-demo-service
Expand All @@ -45,7 +45,7 @@ jobs:
BUILD_ARTIFACT: 'authentication-demo-service'
fail-fast: false
name: ${{ matrix.SERVICE_NAME }}
uses: mosip/kattu/.github/workflows/docker-build.yml@master
uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21
with:
SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }}
SERVICE_NAME: ${{ matrix.SERVICE_NAME }}
Expand All @@ -59,7 +59,7 @@ jobs:
publish_to_nexus:
if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' && github.event_name != 'release' && github.event_name != 'prerelease' && github.event_name != 'publish' }}"
needs: build-maven-authentication-demo-service
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21
with:
SERVICE_LOCATION: ./authentication-demo-service
secrets:
Expand All @@ -72,9 +72,9 @@ jobs:


sonar_analysis:
if: "${{ github.event_name != 'pull_request' }}"
needs: build-maven-authentication-demo-service
if: "${{ github.event_name != 'pull_request' }}"
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21
with:
SERVICE_LOCATION: ./authentication-demo-service
secrets:
Expand Down
29 changes: 13 additions & 16 deletions authentication-demo-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:11
FROM eclipse-temurin:21-jre-alpine

ARG SOURCE
ARG COMMIT_HASH
Expand Down Expand Up @@ -46,38 +46,35 @@ ARG container_user=mosip
ARG container_user_group=mosip

# can be passed during Docker build as build time environment for github branch to pickup configuration from.
ARG container_user_uid=1001
ARG container_user_uid=1002

# can be passed during Docker build as build time environment for github branch to pickup configuration from.
ARG container_user_gid=1001

# install packages and create user
RUN apt-get -y update \
&& apt-get install -y unzip \
&& groupadd -g ${container_user_gid} ${container_user_group} \
&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user}

# set working directory for the user
WORKDIR /home/${container_user}

ENV work_dir=/home/${container_user}

ARG loader_path=${work_dir}/additional_jars/

RUN mkdir -p ${loader_path}

ENV loader_path_env=${loader_path}

COPY ./target/authentication-demo-service-*.jar authentication-demo-service.jar

ADD entrypoint.sh $work_dir/entrypoint.sh

RUN chmod +x $work_dir/entrypoint.sh

# change permissions of file inside working dir
RUN chown -R ${container_user}:${container_user} /home/${container_user} /usr/local/openjdk-11/lib/security/cacerts

RUN chmod 644 /usr/local/openjdk-11/lib/security/cacerts
# install packages and create user
RUN apk -q update \
&& apk add -q unzip wget bash \
&& addgroup -g ${container_user_gid} ${container_user_group} \
&& adduser -s /bin/sh -u ${container_user_uid} -G ${container_user_group} -h /home/${container_user} --disabled-password ${container_user} \
&& mkdir -p ${loader_path} \
&& chmod +x $work_dir/entrypoint.sh \
&& mkdir -p /usr/local/openjdk-21/lib/security && touch /usr/local/openjdk-21/lib/security/cacerts \
&& chown ${container_user}:${container_user} /usr/local/openjdk-21/lib/security/cacerts \
&& chmod 644 /usr/local/openjdk-21/lib/security/cacerts \
&& chown -R ${container_user}:${container_user} /home/${container_user}

# select container user for all tasks
USER ${container_user_uid}:${container_user_gid}
Expand Down
82 changes: 49 additions & 33 deletions authentication-demo-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


<groupId>io.mosip.testrig.authentication.demo</groupId>
<version>1.2.0.1-SNAPSHOT</version>
<version>1.2.1-SNAPSHOT</version>
<artifactId>authentication-demo-service</artifactId>
<name>authentication-demo-service</name>
<description>Parent project of MOSIP functional tests</description>
Expand Down Expand Up @@ -62,18 +62,18 @@

<properties>
<!-- Maven Plugins -->
<spring.boot.version>2.0.2.RELEASE</spring.boot.version>
<spring.boot.version>3.2.3</spring.boot.version>
<spring-cloud-config.version>2.0.0.RELEASE</spring-cloud-config.version>

<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.version>3.8.0</maven.compiler.version>
<maven.javadoc.version>3.0.1</maven.javadoc.version>
<maven.swagger.version>2.9.2</maven.swagger.version>
<maven.jacoco.version>0.8.2</maven.jacoco.version>
<sonar.skip>true</sonar.skip>

<kernel-websubclient-api.version>1.2.0.1-SNAPSHOT</kernel-websubclient-api.version>
<kernel-websubclient-api.version>1.2.1-SNAPSHOT</kernel-websubclient-api.version>

</properties>

Expand All @@ -82,27 +82,14 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
Expand All @@ -112,13 +99,12 @@
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>2.22.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.mosip.authentication</groupId>
<artifactId>authentication-core</artifactId>
<version>1.2.0.1-B3</version>
<version>1.2.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
Expand All @@ -129,19 +115,17 @@
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.23.4</version>
</dependency>

<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-core</artifactId>
<version>1.2.0.1-SNAPSHOT</version>
<version>1.2.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
Expand All @@ -164,13 +148,11 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.0.2.RELEASE</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.7</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
Expand All @@ -193,7 +175,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>org.tensorflow</groupId>
Expand Down Expand Up @@ -221,22 +202,19 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.11</version>
</dependency>
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-templatemanager-velocity</artifactId>
<version>1.2.0.1-SNAPSHOT</version>
<version>1.2.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
<version>${spring-cloud-config.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.1</version>
</dependency>
<dependency>
<groupId>com.github.jai-imageio</groupId>
Expand All @@ -251,7 +229,7 @@
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-keymanager-service</artifactId>
<version>1.2.0.1-SNAPSHOT</version>
<version>1.2.1-SNAPSHOT</version>
<classifier>lib</classifier>
<exclusions>
<exclusion>
Expand All @@ -267,7 +245,27 @@
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.5.0</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-bom</artifactId>
<version>1.2.1-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -327,8 +325,27 @@
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/service-git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<!-- <format>json</format> -->
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -341,7 +358,6 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${maven.jacoco.version}</version>
<configuration>
<excludes>
<exclude>**/constant/**</exclude>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package io.mosip.testrig.authentication.demo.service;

import io.mosip.kernel.templatemanager.velocity.builder.TemplateManagerBuilderImpl;
import io.mosip.kernel.websub.api.client.PublisherClientImpl;
import io.mosip.kernel.websub.api.client.SubscriberClientImpl;
import io.mosip.kernel.websub.api.config.publisher.RestTemplateHelper;
import org.apache.velocity.app.VelocityEngine;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand All @@ -15,7 +19,8 @@
* @author Dinesh Karuppiah
*/
@SpringBootApplication
@Import(value = { TemplateManagerImpl.class, VelocityEngine.class, SwaggerConfig.class, CryptoCore.class})
@Import(value = { TemplateManagerImpl.class, VelocityEngine.class, SwaggerConfig.class, CryptoCore.class, TemplateManagerBuilderImpl.class,
PublisherClientImpl.class, RestTemplateHelper.class, SubscriberClientImpl.class})
public class PartnerDemoApplication {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.mosip.testrig.authentication.demo.service.config;

import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package io.mosip.testrig.authentication.demo.service.config;

import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import lombok.Data;

/**
* @author Kamesh Shekhar prasad
*/

@Configuration
@ConfigurationProperties(prefix = "openapi")
@Data
public class OpenApiProperties {
private InfoProperty info;
private AuthDemoServiceServer authDemoServiceServer;
}

@Data
class InfoProperty {
private String title;
private String description;
private String version;
private LicenseProperty license;
}

@Data
class LicenseProperty {
private String name;
private String url;
}

@Data
class AuthDemoServiceServer {
private List<Server> servers;
}

@Data
class Server {
private String description;
private String url;
}
Loading
Loading