-
Notifications
You must be signed in to change notification settings - Fork 130
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
annotation processor does not run correctly before running the test. #1508
Comments
I tried copy to bin by gradle. settings.json:
tasks.json:
build.gradle:
|
The problem sounds like that the compiled output from language server and gradle command line are different. Is it possible to share a sample project? |
I am trying it out on this project. https://github.com/uk-taniyama/spring-doma Turning "preCheckTask" on and off can be controlled in the Makefile. |
We are actually working on the annotation processor support for the Gradle project: eclipse-jdtls/eclipse.jdt.ls#2319 And I can see the generated sources: But after I imported the project, I saw some other errors: Anything I missed? |
Can i use this one?
".sql" files are stored under resources.
It would simply solve the problem if the "gradle build" was executed. |
Is there any good way to make this place automatic? Would copying it with preLaunchTask solve the problem?
sorry. this is my problem. DaoTestBase.java jdbc url is "mem", but not setup db in test.
|
It should be only needed for once I think, because the incremental build should not remove them. But you may need to do it again if the content is changed. As you may have noticed that the extension compiles the class file into For the annotation processor, looks like the PR mentioned above is very promising. |
I don't really want to do it manually because I often forget...... | For the annotation processor, looks like the PR mentioned above is very promising. Looking forward to it. then i try adding classPaths and see if it works:
|
Maybe not. That setting is only used when launching the tests. But code generation from annotation processors happens during the complation phase. Looks like those .sql files are required the generate the source code. otherwise, the classes under What's the workflow when you running them in other IDEs? |
| What's the workflow when you running them in other IDEs? Just call gradle in Android Studio (IntelliJ IDEA).
|
I see. Because IDEA delegate the test execution to Gradle. And we are considering introducing that feature as well: #1045 |
Thank you for your response. |
Thank you SO much for this configuration fix! We are having a similar issue where our test/resources/application.yml sets up our H2 in-memory database instead of the mysql setup in our main/resources/application.yml. The vscode gradle plugin and running in our terminal uses the correct application.yml but the test plugin does not....until we added the below config.
If you're trying to set the active profile, we did that in the tests with |
The Gradle Test Delegation (both run and debug) has supported now. To use this feature, you need to install the latest Test Runner for Java and Gradle for Java extension. To delegate the tests to Gradle, you can set the default testing profile in Testing explorer: If you do not want to change the default testing profile, you can trigger an one-time execution via: |
NoSuchBeanDefinitionException is raised and the test fails to run.
To work around this, the results of the gradle run are added to classPaths.
Is there a better way to specify classPaths, as the control of classPaths becomes more complicated when we have subprojects.
settings.json:
tasks.json:
The text was updated successfully, but these errors were encountered: