What scala-library dependenecy version can be used with Gradle 7.2 for Gatling performance testing - scala

I am trying to do performance testing for my API using Gatling and Scala.
Below are the plugins/libraries I am using
gradle version : 7.2
gradle.plugin.com.github.lkishalmi.gatling:gradle-gatling-plugin:3.3.0
dependency : gatling 'org.scala-lang:scala-library:2.13.10'
I get the below error when I try to resolve dependencies
A problem occurred evaluating project ':performance-test'.
> Could not find method compile() for arguments [org.scala-lang:scala-library:2.13.10] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
My guess is that the scala version 2.13.10 is not compatible with the gradle version 7.2. I tried changing the scala version to latest and many others, but nothing seems to work.
I have also seen another project using gradle 6.6 and scala version 2.12.2 which works. In my case I can't downgrade the gradle version, unfortunately.
Does anyone know what scala version is compatible with gradle 7.2?

The com.github.lkishalmi.gatling:gradle-gatling-plugin plugin has been deprecated for a long time. Please use the official plugin: https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/

Related

Error downloading org.scalameta:semanticdb-scalac_2.13.6:4.4.10

I recently upgraded to Scala 2.13.6 and I am seeing:
Error downloading org.scalameta:semanticdb-scalac_2.13.6:4.4.10
when I try to build.
I had a similar error when I upgraded to 2.13.5, but was able to add semanticdbVersion := "4.4.11" to build.sbt to get it to work.
This is not working this time.
You can check on the central Maven repository which versions of the project is available for which version of Scala:
https://mvnrepository.com/artifact/org.scalameta/semanticdb-scalac
The only version built for Scala 2.13.6 is 4.4.18 as of today.
This info is probably also available on their GitHub release note oages
I assume you are using the sbt-scalafix plugin in your build. This kind of error can happen if you update the scala version before you update the scalafix plugin to the latest version because the semanticdb version is usually set via this setting in your build.sbt (At least this is the official recommendation):
semanticdbVersion := scalafixSemanticdb.revision
In case of scala v2.13.6 I needed to bump the version of sbt-scalafix to v0.9.28 to fix the error you described.

Cross-compiled with an incompatible version

I am using eclipse with m2eclipse-scala plugin. Currently, I get the following error message:
exampleA_2.10-2.0.1.jar of module build path is cross-compiled with an incompatible version of Scala (2.10.0). In case this report is mistaken, this check can be disabled in the compiler preference page
It looks like the versions of extracted Scala and Scala IDE match. I just wanted to make sure that this is a "false-negative" as described here and can be safely turned off.
As #The Archetypal Paul suggested, it was because I was using wrong Scala library.
If you are using Scala 2.11 (check at About Scala IDE -> installation details), you can downgrade by following instruction here. It's a lot easier than uninstalling and re-installing Scala IDE as other Stackoverflow posts recommend.
I also faced the same issue->
I am trying to use casbah jar in scala to integrate with mongodb.
After analyzing the problem i found that ->
i am trying to use casbah 2.9.1 version and my scala version is 2.11.8
Root-Cause of such error is : your jar is compiled in 2.9.0 version and you are using scala 2.11.8 version
So, to resolve that i use the jar that is compiled into 2.11 scala version-
<groupId>org.mongodb</groupId>
<artifactId>casbah-core_2.11</artifactId>
<version>3.1.1</version>
I was facing similar issue in Eclipse IDE where I had built a Spark scala project in Maven. The scala version was set to 2.11.
Later, I upgraded Scala-Ide plugin in Eclipse after which my project marked below errors,
exampleA_2.10-2.0.1.jar of module build path is cross-compiled with an incompatible version of Scala (2.10.0). In case this report is mistaken, this check can be disabled in the compiler preference page
Right click project folder > scala > set scala version. Here my scala version was displayed as 2.10. I selected 2.11 and removed all the error messages.

Play Framework InjectedRoutesGenerator Error

I have created new Play + Scala project using latest typesafe activator and when trying to import in IntelliJ IDE I was getting below error,
info] Loading project definition from E:\Personal\Scala Workspace\DeployZip\project
E:\Personal\Scala Workspace\DeployZip\build.sbt:18: error: not found: value routesGenerator
routesGenerator := InjectedRoutesGenerator
^
[error] Type error in expression
Consult IDE log for more details (Help | Show Log)
What are the possible reasons for this error?
I have installed jdk 1.8 and now I am able to create project successfully without any error.
But when I tried to run play application using
activator run
I was getting below error now,
java.lang.UnsupportedClassVersionError: org/webjars/WebJarExtractor$Cache : Unsupported major.minor version 51.0
According to this article, I think Unsupported major.minor version 51.0 means that your play application were compiled with Java 1.7 (version 51), but you have Java 1.8 (version 52) installed instead, so you got this error. I'd suggest that you refer to this article for how you could switch between different Java versions.
I was having the error that said Unsupported major.minor version 52.0, and after I installed the latest one (Java 1.8) it was solved.
Hope this helps.
Here is what I've done to solve the issue. Even if you install the java 1.8 it is not sufficient. You have to update the 'path' and 'JAVA_HOME'.
After you install, try to set the jdk1.8 path in the PATH of the environment variables. Also make sure that if you have other versions of the java in the PATH then put the jdk 1.8 path prior to the previous version of java. Or just in case put it in the very beginning of the paths.
I had this same issue. Everything worked after I upgraded Intellij to the latest version (maybe my outdated version used JDK1.7, while activator used 1.8?).

Scala Compiler doesn't compile in ScalaIDE

I'm trying to develop on the Scala compiler project with the help of ScalaIDE. I followed this guide to set up the development environment. When I now try to build the mentioned projects, the reflect project won't get built. Instead, I get the following error via the console output:
uncaught exception during compilation: scala.reflect.internal.MissingRequirementError reflect Unknown Scala Problem
Having tried the provided ANT script of the project via the console, everything seems to work fine.
Does anyone know if I'm missing a hidden compiler flag, dependency or something like this?
Thanks!
With the IDE for Scala 2.10 you can only build the 2.10.x branch of the Scala compiler. If you want to work on master, you need to install a 2.11-based version of the IDE. We don't publicise IDE for 2.11 nightlies yet, but they are available at:
http://download.scala-ide.org/nightly/scala-ide-master-2.11.0-SNAPSHOT/

Sbt plugin binary incompatibility

I am using the sbtantlr plugin and adapting it to use antlr v3.5. It used to work fine with scala 2.9.2.
Today I upgraded my scala to 2.10.0.
And I compiled the plugin in 2.10.0 and put the plugin 'sbtantlr.jar' in the 'lib' directory of my main scala project.
SBT stopped working with this error message:
Binary incompatibility in plugins detected.
I revert the compiler version to 2.9.2 and it works fine.
Is it because SBT (the official binary release) was built with 2.9? Where can I find the information?
Yes, sbt 0.12.x are built with 2.9x and all plugins need to match the binary Scala version.
To add more information to what Yann said, Scala only guarantees compatibility between minor versions. That is, code compiled with any 2.8.x version is compatible with code compiled with any other 2.8.x version, but no code compiled with 2.8.x is compatible with code compiled by a 2.9.x version.
Now, SBT is a Scala application, and both the plugins and build configuration are libraries to it. SBT 0.12.x was compiled with Scala 2.9.x, so all plugins and project build configuration must also be compiled with Scala 2.9.x.
The project itself can be compiled with any version, as SBT does not need to interact with it.