IntelliJ Cucumber-Jave step definition not recognised - intellij-idea

This looks like common issue. I have tried most of solutions on the web. Unfortunately non of them worked for me. I am using IntelliJ 2019.3 Ultimate edition
Cucumber-Java (bundle) and Gherkin (bundle) plugins already there.
Solutions tried:
Check SubType IntelliJ plugin
File types
Plugin
This is Maven project, I got following doubts
Should I add info.cukes to project POM despite of having plugin in the IDE. Even one of my Gradle project also facing the same issue.
Is this mandatory, if so why. Because I can't find cucumber.api.cli.main to set in the Main Class
Answer
You can set the glue location globally by opening "Edit Configurations
-> Defaults -> Cucumber Java -> Glue" and add the package names.
What does this mean
Answer
My project did not have the steps marked as test source root
Can anyone shed some light here please.

Related

Cannot add Maven archetype in IntelliJ

I'm trying to create a new Karate project in IntelliJ, and am attempting to add an archetype to the Maven list. However, when I enter all the required fields, the window just disappears and the list of archetypes is unchanged. I've found that this is the same for any value I enter into the fields, not just the ones for the specific archetype I am trying to create. How can I avoid this problem?
I have no idea, this is the first time I've heard of this problem. It will be great if you can contribute research or code to fix this, and I'll gladly take requests to update the documentation.
As a workaround, I suggest you create a project using the maven command-line as described here: https://github.com/karatelabs/karate#quickstart
I was able to add the karate archetype by using an older version of IntelliJ. The older version I have tried is IntelliJ Community Version 2021.1.3
you can find it and download it here based on your Operating System.
https://www.jetbrains.com/idea/download/other.html
After that, I just added the karate archetype into that version 2021.1.3 IntelliJ.
Then launch the latest IntelliJ.
If you were to make a new Project, with karate Archetype, on the latest version of IntelliJ that I have now IntelliJ Community Version 2021.2.4 It won't be shown there. Although the project is running on karate.

In Karate DSL Framework, IntelliJ IDE is unable to find visible feature files using Gradle

When using the following tools to create a sample Karate DSL Test; a "no features found at [classpath: packagename]" is thrown:
IntelliJ 2017.2.3
Gradle 2.9
project structure is shown in screenshot. Note that I have used the exact same project structure in Eclipse Mars 4.5.2 with Gradle and I was not able to replicate this issue. I also used Maven with Intellij and this issue did not occur.
The issue is isolated to Intellij using Gradle! any thoughts?
My best guess is IntelliJ Gradle does not honor the sourceSets tweak needed for the recommended Karate folder structure.
I just had an idea, try switching to the "traditional" Java project structure where *.feature files are in src/test/resources (not src/test/java) and that might just work.
Example project structure, from IDEA 2017.2.6 with Gradle.

Cannot add framework support in IntelliJ 14 Ultimate

I found a pretty old post with this question but unfortunately he didn't get any help. I hope someone can assist me.
I created a repo at GitHub. After cloning it to my computer I tried to add the following framework support: Maven, JSF, EJB, CDI, etc. I know I could add the files manually. But, I want to use what the IDE has to offer.
However, the only framework showing up is SQL, which is different from this post from stackoverflow and from their documentation.
Has anyone had this same problem and got it working?
Intellij reacts to changes in your Maven pom.xml file. Maven does not react to changes in your IntelliJ project module settings.
The steps that you should follow here are
Close IntelliJ
In a command shell, clone your Github repository.
Using an editor external to IntelliJ such as VI or Notepad, create a pom.xml in the root directory. Better yet, use a Maven Archetype to generate your pom.xml.
Now open IntelliJ. Choose File, New, Project From Existing Sources. Navigate to your pom.xml and follow the prompts.
I recommend checking Search for projects recursively and Import Maven projects automatically.
Finish the project creation.
Now, add dependencies to your pom.xml via the dependencies tag. See Maven Dependencies. Intellij will automatically react to dependencies that you add as long as it can see a Maven Repository on your local machine or on your network or on the Internet.
I know it is a little bit to late but I just post it because it is still an possible issue: You need to open YourProjectName.iml and make sure that the type (<module type="JAVA_MODULE" version="4">) is JAVA_MODULE and not something else!(In my case it was WEB_MODULE)

Why IntelliJ does not show errors in java code?

How to configure intelliJ to disply errors in java code like eclipse?
see the screenshot
It does show the errors you expect, if you don't have the JUnit jar files in the classpath.
I created the exact same file as you showed in my IntelliJ and it really shows the errors:
What you might have done is that you have probably accidentally added the jar to the classpath.
Check the External Libraries as you can see in the picture. If there is no JUnit there, then it really is missing.
Now I can easily add the JUnit jar from IntelliJ and you'll notice the difference in the External Libraries:
Here it has been added under External Libraries and the error goes away.
You almost certainly already included the junit library into your IntelliJ project configuration.
This is easy to do, since IntelliJ has a quick action (alt-enter) to Add junit to classpath.
Look in Settings -> Libraries / Global Libraries and you will see it there. :)
Or you can look directly in Settings on the relevant Module -> Dependencies
Either that, or the project you are working in is configured already (perhaps via maven?) to have a junit dependency.

Custom artifact generation on Intellij Idea 13 and Gradle

I'm using the Intellij Idea 13 Gradle plugin and I'd like to modify the default artifact creation.
The problem I face is that my war modules have dependencies on 3rd party libraries that I don't want to include in the war itself, however I would like to include them in the Intellij artifact so they are deployed to my local server for testing.
At the moment I'm getting errors of the type Artifact ... library required for module is missing from the artifact.
What would be the best way to tell Intellij to add those libraries?
Thanks
I haven't found the way to add those libraries, but I've found the way to set them as provided so they can be added to the server lib folder.
The solution is detailed here: Provided dependencies using Gradle (JetGradle) and Intellij Idea 13