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

Issue #LR-739 chore: Upgraded the scala major version from 2.11 to 2.12 #1243

Merged
merged 5 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Dockerfile.Build
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ ENV M2_HOME /opt/apache-maven-3.3.9
ENV PATH ${M2_HOME}/bin:${PATH}
COPY userorg /opt/userorg/
WORKDIR /opt/userorg/services
RUN mvn clean install -DskipTests -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.6
RUN mvn clean install -DskipTests -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.7
WORKDIR /opt/userorg/services/userorg-service
CMD ["mvn", "play2:dist"]
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ node('build-slave') {
}

stage('Unit Tests') {
sh "mvn clean install '-Dtest=!%regex[io.opensaber.registry.client.*]' -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.6"
sh "mvn clean install '-Dtest=!%regex[io.opensaber.registry.client.*]' -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.7"
}
stage('Package') {
dir('controller') {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ git clone https://github.com/Sunbird-Lern/sunbird-lms-service.git

3. Build the application using the following maven command in the path `<project-base-path>/sunbird-lms-service`:
```shell
mvn clean install -DskipTests -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.6
mvn clean install -DskipTests -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.7
```
Make sure the build is successful before proceeding to the next step. If the build is not successful,
fix any configuration issues and rebuild the application.
Expand Down
1 change: 1 addition & 0 deletions controller/conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
akka {
stdout-loglevel = "OFF"
loglevel = "OFF"
jvm-exit-on-fatal-error = off
log-config-on-start = off
actor {
provider = "akka.actor.LocalActorRefProvider"
Expand Down
20 changes: 18 additions & 2 deletions controller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<scala.major.version>2.12</scala.major.version>
<scala.version>2.12.11</scala.version>
<typesafe.akka.version>2.5.22</typesafe.akka.version>
<jackson.version>2.13.5</jackson.version>
</properties>

<dependencies>
Expand All @@ -46,7 +47,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.5.1</version>
<version>${jackson.version}</version>
</dependency>
<!-- Add actor here itself to avoid netty jar conflict. -->
<dependency>
Expand Down Expand Up @@ -240,8 +241,23 @@
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>6.3</version>
<version>6.6</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.3</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>slf4j-api</artifactId>-->
<!-- <version>2.0.10</version>-->
<!-- </dependency>-->
</dependencies>
<build>
<finalName>userorg-service-${version}</finalName>
Expand Down
5 changes: 3 additions & 2 deletions core/actor-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<slf4j.version>1.6.1</slf4j.version>
<logback.version>1.0.7</logback.version>
<typesafe.akka.version>2.5.22</typesafe.akka.version>
<jackson.version>2.13.5</jackson.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -55,12 +56,12 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.5</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.5.1</version>
<version>${jackson.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
Expand Down
3 changes: 2 additions & 1 deletion core/cassandra-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<scoverage.plugin.version>1.1.1</scoverage.plugin.version>
<cassandra.driver.version>3.7.0</cassandra.driver.version>
<jackson.version>2.13.5</jackson.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -54,7 +55,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.5.1</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.sunbird</groupId>
Expand Down
3 changes: 2 additions & 1 deletion core/notification-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jackson.version>2.13.5</jackson.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -53,7 +54,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.5.1</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.sunbird</groupId>
Expand Down
37 changes: 19 additions & 18 deletions core/platform-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<typesafe.akka.version>2.5.22</typesafe.akka.version>
<play2.version>2.7.2</play2.version>
<jackson.version>2.13.5</jackson.version>
<CLOUD_STORE_GROUP_ID>org.sunbird</CLOUD_STORE_GROUP_ID>
<CLOUD_STORE_ARTIFACT_ID>cloud-store-sdk_2.12</CLOUD_STORE_ARTIFACT_ID>
<CLOUD_STORE_VERSION>1.4.6</CLOUD_STORE_VERSION>
<CLOUD_STORE_VERSION>1.4.7</CLOUD_STORE_VERSION>
</properties>

<dependencies>
Expand All @@ -37,7 +38,7 @@
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>3.1.3.Final</version>
<version>3.14.0.Final</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
Expand All @@ -52,17 +53,17 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.5</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.5.1</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.5</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
Expand All @@ -72,7 +73,7 @@
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>6.3</version>
<version>6.6</version>
</dependency>
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
Expand Down Expand Up @@ -129,38 +130,38 @@
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-scala_${scala.major.version}</artifactId>
</exclusion>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>0.10.2.2</version>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>jaxrs-api</artifactId>
<version>3.0.11.Final</version>
<version>3.0.12.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.1.0.Final</version>
<version>3.14.0.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.mail/javax.mail-api -->
<dependency>
Expand Down Expand Up @@ -195,7 +196,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20200518</version>
<version>20231013</version>
</dependency>
<dependency>
<groupId>com.typesafe.play</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@ userProfileConfigMap={\"type\":\"profileconfig\",\"subtype\":\"28\",\"action\":\
sunbird_userorg_keyspace=sunbird

user-deletion-roles=public
user-deletion-broadcast-topic={{env_name}}.delete.user
5 changes: 5 additions & 0 deletions service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@
<artifactId>org.everit.json.schema</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
Expand Down
5 changes: 4 additions & 1 deletion service/src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# This is the configuration file for the service folder.
AuthenticationEnabled=true
AuthenticationEnabled=true
akka {
jvm-exit-on-fatal-error = off
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
package org.sunbird.actor.user;

import static akka.testkit.JavaTestKit.duration;
import static org.junit.Assert.assertTrue;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.when;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.testkit.javadsl.TestKit;
import com.typesafe.config.Config;
import java.util.HashMap;
import java.util.Map;
import org.apache.kafka.clients.producer.Producer;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -42,6 +35,14 @@
import org.sunbird.util.DataCacheHandler;
import org.sunbird.util.user.KafkaConfigConstants;

import java.time.Duration;
import java.util.HashMap;
import java.util.Map;

import static org.junit.Assert.assertTrue;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.when;

@RunWith(PowerMockRunner.class)
@PrepareForTest({
SSOServiceFactory.class,
Expand All @@ -61,7 +62,11 @@
"javax.net.ssl.*",
"javax.security.*",
"jdk.internal.reflect.*",
"javax.crypto.*"
"javax.crypto.*",
"javax.script.*",
"javax.xml.*",
"com.sun.org.apache.xerces.*",
"org.xml.*"
})
@SuppressStaticInitializationFor("org.sunbird.kafka.KafkaClient")
public class UserMergeActorTest {
Expand Down Expand Up @@ -184,11 +189,11 @@ public boolean testScenario(Request reqObj, ResponseCode errorCode) {
subject.tell(reqObj, probe.getRef());

if (errorCode == null) {
Response res = probe.expectMsgClass(duration("10 second"), Response.class);
Response res = probe.expectMsgClass(Duration.ofSeconds(10), Response.class);
return null != res && res.getResponseCode() == ResponseCode.OK;
} else {
ProjectCommonException res =
probe.expectMsgClass(duration("10 second"), ProjectCommonException.class);
probe.expectMsgClass(Duration.ofSeconds(10), ProjectCommonException.class);
return res.getResponseCode().name().equals(errorCode.name())
|| res.getErrorResponseCode() == errorCode.getResponseCode();
}
Expand Down
3 changes: 2 additions & 1 deletion service/src/test/resources/externalresource.properties
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@ sunbird_password_reset_login_page_url=/resources
isFormValidationRequired=true
userProfileConfigMap={\"type\":\"profileconfig\",\"subtype\":\"28\",\"action\":\"get\",\"component\":\"*\",\"framework\":\"*\",\"data\":{\"templateName\":\"profileConfig_v2\",\"action\":\"get\",\"fields\":[{\"code\":\"persona\",\"children\":{\"administrator\":[{\"code\":\"district\"},{\"code\":\"state\"},{\"code\":\"subPersona\",\"type\":\"select\",\"default\":null,\"templateOptions\":{\"options\":[{\"label\":\"Headmaster\",\"value\":\"hm\"},{\"label\":\"Cluster Resource Person\",\"value\":\"crp\"}]}},{\"code\":\"block\"},{\"code\":\"cluster\"},{\"code\":\"school\"}],\"teacher\":[{\"code\":\"state\"},{\"code\":\"district\"},{\"code\":\"block\"},{\"code\":\"cluster\"},{\"code\":\"school\"}],\"student\":[{\"code\":\"state\"},{\"code\":\"district\"},{\"code\":\"block\"},{\"code\":\"cluster\"},{\"code\":\"school\"}],\"parent\":[{\"code\":\"state\"},{\"code\":\"district\"},{\"code\":\"block\"},{\"code\":\"cluster\"},{\"code\":\"school\"}],\"other\":[{\"code\":\"state\"},{\"code\":\"district\"},{\"code\":\"subPersona\",\"templateOptions\":{\"options\":[{\"value\":\"Doctor (Allopathy)\",\"label\":\"Doctor (Allopathy)\"},{\"value\":\"AYUSH Professional\",\"label\":\"AYUSH Professional\"}]}},{\"code\":\"block\"},{\"code\":\"cluster\"},{\"code\":\"school\"}]}}]},\"created_on\":\"2022-02-10T14:16:51.852Z\",\"last_modified_on\":\"2022-11-14T05:45:02.685Z\",\"rootOrgId\":\"*\"}
sunbird_userorg_keyspace=sunbird
sunbird_cloud_service_provider=azure
sunbird_cloud_service_provider=azure
user-deletion-broadcast-topic=local.delete.user
2 changes: 1 addition & 1 deletion setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

## Build
1. Run "git submodule foreach git pull origin master" to pull the latest sunbird-common submodule.
2. Run "mvn clean install -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.6" to build the services.
2. Run "mvn clean install -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.7" to build the services.
2. Go to "controller" and run the command "mvn play2:dist" to generate the dist file for controller.
3. The build file "controller-1.0-SNAPSHOT-dist.zip" is generated in "userorg-service/controller/target" folder.

Expand Down