From 002f9b02c7d636b20b3d83f531df0b343bfac77b Mon Sep 17 00:00:00 2001 From: anilgupta <ani2824@gmail.com> Date: Fri, 16 Feb 2024 17:32:33 +0530 Subject: [PATCH] Issue #LR-739 chore: Upgraded the scala major version from 2.11 to 2.12 --- Dockerfile.Build | 2 +- Jenkinsfile | 2 +- README.md | 2 +- controller/pom.xml | 28 ++---- core/actor-core/pom.xml | 13 +-- .../dependency-reduced-pom.xml | 96 ------------------- core/notification-utils/pom.xml | 4 +- core/platform-common/pom.xml | 13 +-- pom.xml | 2 +- service/pom.xml | 7 +- setup.md | 2 +- 11 files changed, 35 insertions(+), 136 deletions(-) delete mode 100644 core/notification-utils/dependency-reduced-pom.xml diff --git a/Dockerfile.Build b/Dockerfile.Build index 1bb3764d49..6697420cdf 100644 --- a/Dockerfile.Build +++ b/Dockerfile.Build @@ -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 -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.6 WORKDIR /opt/userorg/services/userorg-service CMD ["mvn", "play2:dist"] \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 08f7c76929..bfa54707b8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 -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.6" } stage('Package') { dir('controller') { diff --git a/README.md b/README.md index 3adf2aab7b..6c2f0215f5 100644 --- a/README.md +++ b/README.md @@ -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 -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.6 ``` 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. diff --git a/controller/pom.xml b/controller/pom.xml index 15542e2cad..7ddd342b37 100644 --- a/controller/pom.xml +++ b/controller/pom.xml @@ -36,9 +36,9 @@ <play2.version>2.7.2</play2.version> <play2.plugin.version>1.0.0-rc5</play2.plugin.version> <sbt-compiler.plugin.version>1.0.0</sbt-compiler.plugin.version> - <scala.major.version>2.11</scala.major.version> - <scala.version>2.11.12</scala.version> - <learner.akka.version>2.5.19</learner.akka.version> + <scala.major.version>2.12</scala.major.version> + <scala.version>2.12.11</scala.version> + <typesafe.akka.version>2.5.22</typesafe.akka.version> </properties> <dependencies> @@ -83,7 +83,7 @@ </dependency> <dependency> <groupId>com.typesafe.play</groupId> - <artifactId>play-logback_2.11</artifactId> + <artifactId>play-logback_${scala.major.version}</artifactId> <version>${play2.version}</version> <scope>runtime</scope> <exclusions> @@ -95,7 +95,7 @@ </dependency> <dependency> <groupId>com.typesafe.play</groupId> - <artifactId>play-netty-server_2.11</artifactId> + <artifactId>play-netty-server_${scala.major.version}</artifactId> <version>${play2.version}</version> <scope>runtime</scope> <exclusions> @@ -144,15 +144,7 @@ </exclusion> <exclusion> <groupId>com.typesafe.akka</groupId> - <artifactId>akka-protobuf_2.11</artifactId> - </exclusion> - <exclusion> - <groupId>com.typesafe.akka</groupId> - <artifactId>akka-stream_2.11</artifactId> - </exclusion> - <exclusion> - <groupId>com.typesafe.akka</groupId> - <artifactId>akka-actor_2.11</artifactId> + <artifactId>akka-actor_${scala.maj.version}</artifactId> </exclusion> </exclusions> </dependency> @@ -183,18 +175,18 @@ <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-slf4j_${scala.major.version}</artifactId> - <version>${learner.akka.version}</version> + <version>${typesafe.akka.version}</version> </dependency> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-testkit_${scala.major.version}</artifactId> - <version>${learner.akka.version}</version> + <version>${typesafe.akka.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> - <version>2.0.2</version> + <version>2.0.9</version> <scope>test</scope> <exclusions> <exclusion> @@ -206,7 +198,7 @@ <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mockito2</artifactId> - <version>2.0.2</version> + <version>2.0.9</version> <scope>test</scope> </dependency> <dependency> diff --git a/core/actor-core/pom.xml b/core/actor-core/pom.xml index c0aa98090a..1038dab0b2 100644 --- a/core/actor-core/pom.xml +++ b/core/actor-core/pom.xml @@ -15,6 +15,7 @@ <name>actor-core</name> <properties> + <scala.major.version>2.12</scala.major.version> <maven.compiler.release>11</maven.compiler.release> <maven.compiler.source>11</maven.compiler.source> <maven.compiler.target>11</maven.compiler.target> @@ -23,7 +24,7 @@ <scoverage.plugin.version>1.1.1</scoverage.plugin.version> <slf4j.version>1.6.1</slf4j.version> <logback.version>1.0.7</logback.version> - <learner.akka.version>2.5.19</learner.akka.version> + <typesafe.akka.version>2.5.22</typesafe.akka.version> </properties> <dependencies> <dependency> @@ -33,18 +34,18 @@ </dependency> <dependency> <groupId>com.typesafe.akka</groupId> - <artifactId>akka-actor_2.11</artifactId> - <version>${learner.akka.version}</version> + <artifactId>akka-actor_${scala.major.version}</artifactId> + <version>${typesafe.akka.version}</version> </dependency> <dependency> <groupId>com.typesafe.akka</groupId> - <artifactId>akka-slf4j_2.11</artifactId> - <version>${learner.akka.version}</version> + <artifactId>akka-slf4j_${scala.major.version}</artifactId> + <version>${typesafe.akka.version}</version> </dependency> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-remote_2.11</artifactId> - <version>${learner.akka.version}</version> + <version>${typesafe.akka.version}</version> </dependency> <dependency> <groupId>org.reflections</groupId> diff --git a/core/notification-utils/dependency-reduced-pom.xml b/core/notification-utils/dependency-reduced-pom.xml deleted file mode 100644 index be370caaaa..0000000000 --- a/core/notification-utils/dependency-reduced-pom.xml +++ /dev/null @@ -1,96 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <parent> - <artifactId>sunbird-util</artifactId> - <groupId>org.sunbird</groupId> - <version>1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - <groupId>org.sunbird</groupId> - <artifactId>sunbird-notification</artifactId> - <version>1.0-SNAPSHOT</version> - <build> - <plugins> - <plugin> - <artifactId>maven-shade-plugin</artifactId> - <version>3.0.0</version> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <artifactSet> - <excludes> - <exclude>classworlds:classworlds</exclude> - <exclude>junit:junit</exclude> - <exclude>jmock:*</exclude> - <exclude>*:xml-apis</exclude> - <exclude>org.apache.maven:lib:tests</exclude> - </excludes> - </artifactSet> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.13.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <artifactId>hamcrest-core</artifactId> - <groupId>org.hamcrest</groupId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-module-junit4</artifactId> - <version>2.0.2</version> - <scope>test</scope> - <exclusions> - <exclusion> - <artifactId>junit</artifactId> - <groupId>junit</groupId> - </exclusion> - <exclusion> - <artifactId>powermock-module-junit4-common</artifactId> - <groupId>org.powermock</groupId> - </exclusion> - <exclusion> - <artifactId>hamcrest-core</artifactId> - <groupId>org.hamcrest</groupId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-api-mockito2</artifactId> - <version>2.0.2</version> - <scope>test</scope> - <exclusions> - <exclusion> - <artifactId>powermock-api-support</artifactId> - <groupId>org.powermock</groupId> - </exclusion> - <exclusion> - <artifactId>mockito-core</artifactId> - <groupId>org.mockito</groupId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - <properties> - <maven.compiler.release>11</maven.compiler.release> - <maven.compiler.target>11</maven.compiler.target> - <maven.compiler.source>11</maven.compiler.source> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> -</project> - diff --git a/core/notification-utils/pom.xml b/core/notification-utils/pom.xml index daeacaac14..267e135864 100644 --- a/core/notification-utils/pom.xml +++ b/core/notification-utils/pom.xml @@ -35,7 +35,7 @@ <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> - <version>2.0.2</version> + <version>2.0.9</version> <scope>test</scope> <exclusions> <exclusion> @@ -47,7 +47,7 @@ <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mockito2</artifactId> - <version>2.0.2</version> + <version>2.0.9</version> <scope>test</scope> </dependency> <dependency> diff --git a/core/platform-common/pom.xml b/core/platform-common/pom.xml index d6cd701690..9f15ec77af 100644 --- a/core/platform-common/pom.xml +++ b/core/platform-common/pom.xml @@ -15,14 +15,15 @@ <name>platform-common</name> <properties> + <scala.major.version>2.12</scala.major.version> <maven.compiler.release>11</maven.compiler.release> <maven.compiler.source>11</maven.compiler.source> <maven.compiler.target>11</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <learner.akka.version>2.5.19</learner.akka.version> + <typesafe.akka.version>2.5.22</typesafe.akka.version> <play2.version>2.7.2</play2.version> <CLOUD_STORE_GROUP_ID>org.sunbird</CLOUD_STORE_GROUP_ID> - <CLOUD_STORE_ARTIFACT_ID>cloud-store-sdk</CLOUD_STORE_ARTIFACT_ID> + <CLOUD_STORE_ARTIFACT_ID>cloud-store-sdk_2.12</CLOUD_STORE_ARTIFACT_ID> <CLOUD_STORE_VERSION>1.4.6</CLOUD_STORE_VERSION> </properties> @@ -65,8 +66,8 @@ </dependency> <dependency> <groupId>com.typesafe.akka</groupId> - <artifactId>akka-slf4j_2.11</artifactId> - <version>${learner.akka.version}</version> + <artifactId>akka-slf4j_${scala.major.version}</artifactId> + <version>${typesafe.akka.version}</version> </dependency> <dependency> <groupId>net.logstash.logback</groupId> @@ -94,14 +95,14 @@ <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> - <version>2.0.2</version> + <version>2.0.9</version> <!--<scope>test</scope> --> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mockito2</artifactId> - <version>2.0.2</version> + <version>2.0.9</version> <!--<scope>test</scope> --> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime --> diff --git a/pom.xml b/pom.xml index b24af5a919..6d43661b3e 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> - <version>0.8.6</version> + <version>0.8.8</version> <configuration> <destFile>${basedir}/target/jacoco-unit.exec</destFile> <dataFile>${basedir}/target/jacoco-unit.exec</dataFile> diff --git a/service/pom.xml b/service/pom.xml index 21c278aef6..5cf5c42c6f 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -12,7 +12,8 @@ <artifactId>service</artifactId> <version>1.0-SNAPSHOT</version> <properties> - <learner.akka.version>2.5.19</learner.akka.version> + <scala.major.version>2.12</scala.major.version> + <typesafe.akka.version>2.5.22</typesafe.akka.version> <maven.compiler.release>11</maven.compiler.release> <maven.compiler.source>11</maven.compiler.source> <maven.compiler.target>11</maven.compiler.target> @@ -36,8 +37,8 @@ </dependency> <dependency> <groupId>com.typesafe.akka</groupId> - <artifactId>akka-testkit_2.11</artifactId> - <version>${learner.akka.version}</version> + <artifactId>akka-testkit_${scala.major.version}</artifactId> + <version>${typesafe.akka.version}</version> <scope>test</scope> </dependency> <dependency> diff --git a/setup.md b/setup.md index 341f2abe3c..76efcfab9d 100644 --- a/setup.md +++ b/setup.md @@ -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 -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.6" 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.