I have installed Natural 0.7.6 plug-in from eclipse marketplace and I have Windows 10.
Eclipse version: Eclipse IDE for Java Developers
Version: 2020-03 (4.15.0)
Build id: 20200313-1211
Maven dependencies related to Cucumber:
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>5.7.0</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>
</dependencies>
.feature file
step definition file
[1]: [https://i.stack.imgur.com/e22x3.png][1]
[2]: https://i.stack.imgur.com/cAfLY.png
The .feature file complains about "No definition found for ".
CTRL+CLICK on .feature file step is not navigating to stepDefinition file (screenshots attached).
Am I missing any plugin? Is there any compatibility issues with Eclipse IDE version and the Cucumber plug-in I am using? I appreciate your help guys.
Steps to make it work.
Clear out all the cucumber related plugins(e.g. Natural 0.9, cucumber eclipse plugin 1.0.0.xxxxx). Please do follow the suggestion of restarting your eclipse.
Go to Help --> Eclipse Market place --> Install 'cucumber-eclipse' plugin. Please do follow the suggestion of restarting your eclipse.
Right click on your project --> Configure --> Convert to Cucumber project.
Now try to navigate to your step definition by 'Ctrl+click' on test step in feature file
Edit: I also changed JRE system library to 1.8( I am not sure it has any influence to make cucumber work )
I had same problem that CTRL+Click was not working in feature files when I installed Natural plugin in Eclipse IDE.
Later, I uninstalled Natural plugin, and installed "Cucumber Eclipse" plugin, and now I can perform ctrl+click on step name of feature file to navigate to the step definition file.
You can follow below stpes:
Un-install Natural plugin
Install Cucumber Eclipse plugin
Note: Below are my Eclipse version details. "Cucumber Eclipse" plugin may not be available for latest Eclipse version
Version: 2019-06 (4.12.0)
Build id: 20190614-1200
With the Cucumber Eclipse plugin, cleaning the Cucumber project (Project > Clean...) made the Gherkin steps Ctrl+click-able again.
You need a cucumber runner file first and inside that you need to glue the step definition file with the cucumber feature. The thing is that in cucumber if you place the feature file, step definition file and runner file in the same package then automatically, it will be able to map the steps from the step definition file with the feature file. But as per the screenshots, I can see that feature and step definition is present in the different packages. Please create a runner file as shown below
>
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
#RunWith(Cucumber.class)
#CucumberOptions(
features = "<Directory path containing features>"
,glue={"<Step definition package name>"}
) // example: Features: src/test/resources/features, Glue: com.package.name.stepdefs
public class TestRunner {
}
TestRunner.java
If you are not able to get to the relevant step definition method from Feature file by either F3 or CTRL+ Left Mouse Click, change the default editor of Feature file as below
image to select correct Cucumber Editor
I am new to maven and am experiencing difficulties while trying to mavenise a Java project.
Setting:
IDE: Eclipse Oxygen.2 Release (4.7.2)
Java: 8
m2e: 1.8.2
What I did:
- copy-pasted the entire original java project and renamed it
- right-click in eclipse: Configure > Convert to Maven project
- in java build path, deletion of libraries import from original local lib repo. The build path shows the Maven Dependencies folder, with the only junit library.
- maven install => downloaded things in the user/.m2/repository/, but not all.
What does not work:
When I try to add a dependency right from a file:
,
nothing pops up in the artifact selection windows, even though there is a commons-logging/ folder in m2/repository
When I try to add the dependency manually in the pom.xml:
<dependency>
<groupId>org.kie.modules</groupId>
<artifactId>org-apache-commons-configuration-main</artifactId>
<version>6.5.0.Final</version>
<type>pom</type>
</dependency>
but the package resolution error still appears in the java file, and I get this warning after Maven install
`[WARNING] The POM for org.kie.modules:org-apache-commons-configuration-main:pom:6.5.0.Final is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details`
I did Maven Update project, eclipse project clean, nothing changes.
My goal for now is just that eclipse understands (at least for one library), that it has to take it from maven repository. I still have many other dependencies to solve (intra-project), but that will be the next step.
Thanks for your help.
The cause of the issue is stated in the warning message :
[WARNING] The POM for
org.kie.modules:org-apache-commons-configuration-main:pom:6.5.0.Final
is invalid, transitive dependencies (if any) will not be available,
enable debug logging for more details
It means that the pom.xml downloaded in your local maven repository exists but is not valid.
Delete the folder of the dependency downloaded in your local maven repository and try again.
If you still have the same problem, check that your central repository that provides the dependency provides also correctly the pom.xml for that.
You can do it by browsing the directory of the dependency from a web browser.
For example we can see that the maven central repository provides a valid pom :
http://central.maven.org/maven2/org/kie/modules/org-apache-commons-collections-main/6.5.0.Final/org-apache-commons-collections-main-6.5.0.Final.pom
I'm just starting to learn Scala.
I have installed the Scala plugin for IntelliJ, and created a new Scala project. But when I right-click on the src folder to make a new Scala class, there is no option to do so. Am I missing something?
Right click on your project, "Add Framework support" and choose Scala framework, then by right click on the packages you can create Scala Class.
After this, right click on src > Mark directory as > Sources Root.
Doing both of these should fix your problem!
I figured it out, right click on src > Mark directory as > Sources Root.
Now try again.
I just had this issue, also. It turned out that IntelliJ hadn't marked my src/main/scala folder as a "source" folder.
To do this: Project Structure -> Modules -> right click folder and Mark as "Source" (blue)
Similarly the src/main/test folder wasn't marked as a test folder. I was able to add scala classes after those folders were appropriately marked.
I had the same problem when I created my first Scala project and I was able to solve it in a simpler way.
Click on the "Search everywhere" button and type "sbt", or click directly on the "sbt" button located on the right near the edge of the screen.
Now just click on the "Reload all sbt project" button.
This worked for me, I hope it will help someone.
Right Click on the SrcScala folder :)
I had this problem everytime I created a new project with spaces in the name. eg "Hell Wev". Using "HellWev" or similar as a project name seems to work fine
In IDEA 2016.2.5
From a new SBT or Scala project.
Open Project Structure
On the Project tab add your JDK (should also be visible in SDKs tab)
Under Global Libraries add Scala SDK.
Sadly just adding this to your build.SBT does not impact the IDE behavior.
On IntelliJ IDE 2019.1 Ultimate, enable FRAMEWORK Scala like this screens:
I had the same problem and what I did is Right Clicked on the Project ---> Then Choose Add Framework Support--> In the Left hand corner there was a list mentioned of Groovy, Kotlin, Maven and Scala.---> From the List I choose Scala but still had issue because the librabry was not specified--->Clicked on Create and it asked me to choose the version as I had Installed 2.11.12, i choose it and it started downloading it. Once it was downloaded I selected Scala and the issue was fixed.
Go to Src folder and choose Mark as Directory then choose the option called source root, that would fix your problem.
add
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.50" in target -> built.sbt file
this works for IntelliJ IDEA 2017
Created new gradle project (java)
Add new module "scala" into /src/main/ and "Make Directory" as source ...
added dependencies into build.gradle:
group 'example-scala'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'scala'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile 'org.scala-lang:scala-library:2.12.6'
testCompile 'org.scalatest:scalatest_2.11:3.0.5'
testRuntime 'org.scala-lang.modules:scala-xml_2.11:1.0.6'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
In my case after selecting Sources Root it not shown me any Scala Class option then I choose Generated Sources Root, right click on src > Mark directory as > Generated Sources Root.
This worked for me
Intellij by default doesn't pick up the dependencies at times. You'll need to create a seperate sbt or maven project and then import it to Intellij.
If you want to create a Java Scala Mixin project you can follow this blog post. And then import it in Intellij.
Or if your just trying to learn Scala.
You can download this maven based Scala Starter Template and import it in intellij and then continuing working on it.
Note : You might have to specify the sources for the module in the
Project Structure -> Modules Tab
You can add the scala maven plugin reference in the pom.xml as below
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaCompatVersion>2.11</scalaCompatVersion>
<scalaVersion>2.11.8</scalaVersion>
</configuration>
</plugin>
</plugins>
</build>
Once you do this and build you will be able to see the option of the scala class.
I also faced same issue, the scala file options were not not visible in intellij Idea editor because Scala SDK was not installed. So you get rid of this issue after installing SDK for Scala.
Following the below steps resolved for me:
Add scala plugin to your Intellij IDE.(Plugins can be added by navigating to File -> settings -> plugins)
Enable scala plugin
Restart IDE
You just need to select the 'Package' instead of 'Project' option from the drop-down menu just above your project name.
I experienced this behavior when the folder was not correctly marked as a source folder (blue folder symbol). If that is the case, simply right-click on the whole project and choose Open Module Settings where you can then mark the respective folder as source:
Module settings where you may select src as Source folder
I had a similar problem and what I did to resolve is just create a package by right clicking on src/main/scala. Once package is created, right click on package and you should be able to find scala class option.
In case someone else is having the same problem and the above didn't work, what worked for me was to:
Close IntelliJ
Delete the .idea folder
Open the project
It's all about the jdk when creating a project. Click "download" in the corresponding Java selection column and it will select the version for you
I’m using Eclipse Kepler (Java 8). with my Maven (v 3.2.3) project. I’m using JUnit 4.11, as declared in my pom.xml file …
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
I’m trying to run some JUnit tests and I have this at the top of my tests
#FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class MyTest
{
However, when I run the test in Eclipse (by right clicking the name of the file and selecting “Run As”, “JUnit Test”), Eclipse is not running the tests in ascending order by name, but instead running the tests one by one as they are listed in the file.
My question is, how can I get Eclipse to respect the “FixMethodOrder” directive in my file? Note that I’m not interested in lectures about why it shouldn’t matter what order you run JUnit tests in.
Open your project build path (right-click on project > Build Path > Configure Build Path...) and go to the Libraries tab. Do you have "JUnit 4" on your Eclipse classpath or just "Maven Dependencies":
Remove it by selecting "JUnit 4" and hitting the remove button to the right. Maven specifies all your dependencies so you don't need Eclipse adding to that.
In my experience Eclipse seems to prefer its own JUnit library at runtime over the JUnit library provided by "Maven Dependencies": I get different results in test execution order between Eclipse and direct Maven when using #FixMethodOrder if the Eclipse "JUnit 4" library is on the classpath, but if I remove that library then Eclipse and Maven are in agreement.
I can run the Java version of my project fine by simply importing Guava libraries like so:
import com.google.gwt.thirdparty.guava.common.collect.ImmutableList;
Following the advice here, I've added this line to html/pom.xml:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-gwt</artifactId>
<version>10.0.1</version>
</dependency>
And this line to html/project.gwt.xml file:
<inherits name="com.google.common.collect.Collect"/>
But when I try to GWT-Compile my HTML version in Eclipse, I get errors like the following:
[ERROR] Line 61: No source code is available for type com.google.gwt.thirdparty.guava.common.collect.ImmutableList<E>; did you forget to inherit a required module?
I think you may be importing the wrong class. Try replacing the com.google.gwt.thirdparty.guava.common.collect.ImmutableList import with com.google.common.collect.ImmutableList.
Here is a similar question about the Lists class: Trouble with GWT and Guava
I selected #eneveu's answer as it got me headed in the right direction. Here are more explicit instructions for enabling Guava in the HTML version of your PlayN project.
1. Add dependency to YourGame-core/pom.xml
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-gwt</artifactId>
<version>11.0.2</version>
</dependency>
2. Right-click YourGame-core directory in Package Explorer window, then: Maven > Update Dependencies
3. For HTML5, add this line to YourGame-html/YourGame.gwt.xml:
<inherits name="com.google.common.collect.Collect"/>
4. When importing, use the correct library path:
import com.google.common.collect.Foo;
/* NOT: import com.google.gwt.thirdparty.guava.common.collect.Foo; */
I compiled the code at the link below and tested in Chrome to verify that Guava gets imported successfully:
PlaynDev.java