-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running examples in Intellij/Idea requires src/test/generated-assertions to be marked as a test source folder #36
Comments
have you run |
Yes. Sample compilation errors: assertj-examples/assertions-examples/src/test/generated-assertions/org/assertj/examples/data/bug27/AbstractMyModelClassMyBeanAssert.java |
is that the result of |
In IDE. mvn clean install worked fine. |
Then you haven't imported the project correctly in your IDE, from what I see assertj-core dependency is missing is your IDE project. |
I imported the project by loading the pom.xml file as a project into the intellij IDE. Is there a better/correct way to import the project? |
I have reproduced the problem, it seems that Intellij Idea is not importing the project correctly, it sets |
Thanks. That's what I discovered too. See the issue description. |
I will update the documentation but it is an Intellij Idea problem. Thanks for reporting this. |
I understand. Thanks! |
I have just updated the README.md, can you tell me if this is clear enough ? |
Yes, it is clear. Thanks! |
I am having almost the same problem with Eclipse. I am getting Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project com.transunion.qa.datahub.ui.java.bdd.serenity: Compilation failure: Compilation failure: [ERROR] /Users/pnutala/eclipse-photon-workspace/com.transunion.datahub.ui.qc.java.bdd.serenity/src/main/java/com/transunion/qc/steplibrary/datahub/DeCoherentUser.java:[7,35] package org.assertj.core.api does not exist [ERROR] /Users/pnutala/eclipse-photon-workspace/com.transunion.datahub.ui.qc.java.bdd.serenity/src/main/java/com/transunion/qc/steplibrary/datahub/DeCoherentUser.java:[7,1] static import only from classes and interfaces |
Try a maven refresh project from eclipse. |
@PrasadNutalapati can you show the pom.xml ? |
I overcome this problem by removing the test for the dependency assertJ. This made the code compile and run, but the tests are not running, because the classes which invoke the assertions are in src/main/java folder. |
compile is I believe but you can check that on the maven doc https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope |
Have you +1 Basil's answer ? |
I tried the following version:
commit 518ca73 (HEAD -> master, origin/master, origin/HEAD)
Author: Joel Costigliola [email protected]
Date: Sun May 21 15:50:31 2017 +1200
in Intellij 2017.2.
Running
org.assertj.examples.ArrayAssertionsExamples
for example in the IDE
caused compilation errors.
After I marked src/test/generated-assertions as a test source folder, it started to work.
The README says:
"In your IDE, add src/test/generated-assertions to the project java sources if you IDE shows errors/missing classes. This folder is where custom assertions classes are generated, it shows what you have with the maven assertions generator plugin."
Is this instruction correct?
The text was updated successfully, but these errors were encountered: