Skip to content

Commit

Permalink
Issue #LR-739 chore: Upgraded the scala major version from 2.11 to 2.…
Browse files Browse the repository at this point in the history
…12 (#1242)
  • Loading branch information
AmiableAnil authored Feb 27, 2024
1 parent 0d513be commit 9b1fbb9
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 173 deletions.
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 -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"]
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 -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') {
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 -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.
Expand Down
41 changes: 14 additions & 27 deletions controller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@
<properties>
<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>
Expand Down Expand Up @@ -83,7 +82,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>
Expand All @@ -95,7 +94,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>
Expand Down Expand Up @@ -144,15 +143,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>
Expand All @@ -166,6 +157,10 @@
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand All @@ -183,18 +178,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>
Expand All @@ -206,7 +201,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>
Expand Down Expand Up @@ -264,14 +259,6 @@
<version>${play2.plugin.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>com.google.code.sbt-compiler-maven-plugin</groupId>
<artifactId>sbt-compiler-maven-plugin</artifactId>
<version>${sbt-compiler.plugin.version}</version>
<configuration>
<scalacOptions>-feature -deprecation -Xfatal-warnings</scalacOptions>
</configuration>
</plugin>
</plugins>
</build>
</project>
Expand Down
20 changes: 10 additions & 10 deletions controller/test/controllers/BaseApplicationTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
package controllers;

import static org.powermock.api.mockito.PowerMockito.mockStatic;

import akka.actor.ActorSelection;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import modules.OnRequestHandler;
import modules.StartModule;
import org.apache.commons.lang3.StringUtils;
Expand All @@ -25,7 +18,6 @@
import org.sunbird.response.ResponseParams;
import org.sunbird.telemetry.util.TelemetryWriter;
import play.Application;
import play.Mode;
import play.inject.Bindings;
import play.inject.guice.GuiceApplicationBuilder;
import play.libs.Json;
Expand All @@ -35,6 +27,14 @@
import util.ACTORS;
import util.RequestInterceptor;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static org.powermock.api.mockito.PowerMockito.mockStatic;

@RunWith(PowerMockRunner.class)
@PowerMockIgnore({
"javax.management.*",
Expand All @@ -59,7 +59,7 @@ public <T> void setup(ACTORS actor, Class<T> actorClass) {
application =
new GuiceApplicationBuilder()
.in(new File("path/to/app"))
.in(Mode.TEST)
// .in(Mode.TEST)
.disable(StartModule.class)
.overrides(Bindings.bind(actor.getActorClass()).to(actorClass))
.build();
Expand All @@ -81,7 +81,7 @@ public <T> void setup(List<ACTORS> actors, Class<T> actorClass) {
GuiceApplicationBuilder applicationBuilder =
new GuiceApplicationBuilder()
.in(new File("path/to/app"))
.in(Mode.TEST)
// .in(Mode.TEST)
.disable(StartModule.class);
for (ACTORS actor : actors) {
applicationBuilder =
Expand Down
12 changes: 6 additions & 6 deletions controller/test/util/CaptchaHelperTest.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
package util;

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

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.HashMap;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -16,9 +11,14 @@
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.sunbird.http.HttpClientUtil;
import org.sunbird.request.RequestContext;
import org.sunbird.util.ProjectUtil;

import java.util.HashMap;
import java.util.Map;

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

@RunWith(PowerMockRunner.class)
@PrepareForTest({HttpClientUtil.class, ProjectUtil.class})
@PowerMockIgnore({
Expand Down
17 changes: 9 additions & 8 deletions core/actor-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
<artifactId>akka-remote_${scala.major.version}</artifactId>
<version>${typesafe.akka.version}</version>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
Expand Down Expand Up @@ -74,7 +75,7 @@
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.24.1-GA</version>
<version>3.30.2-GA</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
Expand Down
96 changes: 0 additions & 96 deletions core/notification-utils/dependency-reduced-pom.xml

This file was deleted.

4 changes: 2 additions & 2 deletions core/notification-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
Loading

0 comments on commit 9b1fbb9

Please sign in to comment.