IntelliJ plugin for cucumber-scala - scala

I am running Cucumber scala project in IntelliJ
IntelliJ IDEA - 13.0.2
I couldn't find separate plugin called cucumber for scala
In my project I am getting cannot resolve message for cucumber as below
Could see below errors as well
Existing plugins installed
What could be the solution
Cheers

You are missing dependencies for cucumber-core and cucumber-scala, please have a look at the documentation and add them to your build.sbt file.
Update:
There is a newer version available for sbt-cucumber-plugin (0.8.0): https://github.com/skipoleschris/xsbt-cucumber-plugin. Maybe that solves your problems.
Did you try the gen-idea plugin to create the IntelliJ IDEA project files ?

Related

Intellij: Error while importing SBT project

I used Intellij for 4 months without any problems. Yesterday I installed it on another PC but I can't create a SBT Scala project.
Here the steps:
I create the project:
When started it says me that "SBT project need to be imported" so I click on "Enable Auto-Import" but then I get this error:
If I try to add Scala SDK from modules settings I get this error:
I downloaded Scala and SBT externally, I also tried all the suggested solutions from other similar threads but I can't resolve it.
How can I do?
Thank you in advance!
Add sbt.version to project/build.properties. You can check SBT version using sbt sbtVersion.

Import Twitter/chill to Scala code using Intellij IDE

I have to do some assignments with Scala and I'm a newbie for this language.
In the assignment, the prof requests me to implement serialization and deserialization, using twitter/chill.
https://github.com/twitter/chill/
However, I don't know how to import the libary into my IDE Intellij.
Each time I use val instantiator = new ScalaKryoInstantiator.
IDE notify me that: Cannot resolve symbol ScalaKryoInstantiator.
Could anyone can help me to resolve this issue?
Thanks and Best Regards,
Long.
One way to add a library in a Scala project, if you use sbt, is to add an sbt dependency. Most libraries and jars can be found and downloaded from the maven repositories: https://mvnrepository.com/artifact/com.twitter/chill_2.9.2/0.2.3
If you click the sbt tab on the page above, maven gives you a code snippet which can be directly pasted into your build.sbt. In order to compile and run your project using sbt, open the terminal in the directory where your build.sbt is located and use the "sbt run" command.
If you don't use sbt, download the jar from maven and follow the instructions in this answer: How to add external library in IntelliJ IDEA?

Play with Activator Issue on IntelliJ Idea 14

I have the following problem on IntelliJ IDEA 14:
I created a Play (Scala) project using the Activator (v1.2.10). Then, I converted it to an IDEA project using activator idea command. When, I opened the project with IDEA 14 (Community Edition) the SBT module is not enabled. Therefore, a new dependency in build.sbt file is not included in the classpath. Moreover, the project is not listed in IDEA's SBT view.
The following warning is shown by IDEA:
"This IDEA project is converted from an SBT project by gen-idea tool, which currently relies on a legacy Scala project model. Please consider using built-in SBT support via the Import project action."
Note that, the Scala and SBT plugins are already installed on IDEA.
I don't encounter with the same issue in IDEA 13.
Have you tried File | Import Project and select build.sbt file?
IDEA imports it as an SBT project, with all the dependencies properly resolved. It works fine for me on IDEA 14 and on 13.
Apparently, this is a bug in some versions of IntelliJ 14, that just got fixed (as of version 14.0.3). Updating IJ then updating the scala plugin seems to make things work.
In this case simply import manually the "build.sbt" from your project, so if the directory is ~/Documents/myPlayApp then choose to import ~/Documents/myPlayApp/build.sbt

`Cannot find symbol` in IntelliJ 14

I have use the IntelliJ Scala plugin before, in 13 and 13.1. I upgraded to 14, and it doesn't work anymore for my SBT project.
For all Scala standard lib stuff, I see errors like "Cannot find symbol scala.Option".
at scala project, compiler error - Cannot resolve symbol List? says I need to have the Scala facet for my module. I looked in facets, and Scala wasn't an option.
I've uninstalled IntelliJ and the Scala plugin and my settings and the projects files multiple times, but still happens.
How do I fix this?
the new scala plugin for intellij 14 removed the facet and replaced it with Scala SDK library, see blog
for sbt project, I guess the best bet is to re-create your project by:
File -> open -> select the build.sbt of your project in popup -> delete existing project and import
I had a similar issue when a Java module calls an Scala object. The issue was from the wrong setup in Source Folders; the Scala source was in src/main/scala/..., but in the Project Structure, the Source Folders were setup as src by default. When I changed it as src/main/scala, the Java module can find the Scala object correctly.
I fixed this by using the nightly builds of the Scala plugin.
The fixes have now been incorporated into the stable versions.
In my case i just had to reload the IDE...

How to Point Intellij at SBT Libraries for Scala Project

I'm trying to use this example: https://github.com/spray/spray-template for a Spray project, however I can't figure out how to point Intellij at the dependencies downloaded via SBT.
Any suggestions?
If you're using IntelliJ version 13, you need only the Scala plug-in (which has built-in SBT support); just open the project by selecting the build.sbt file.
Use this SBT plugin to generate Intellij IDEA project files: https://github.com/mpeltonen/sbt-idea
Add SBT plugin for creating IntelliJ IDEA projects in your ~/.sbt/0.xx/plugins/build.sbt or PROJECT_DIR/project/plugins.sbt. Use gen-idea command to create an IntelliJ project and open the project in IntelliJ. That should be it.