-
Notifications
You must be signed in to change notification settings - Fork 55
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
After repository merge IntelliJ is showing some classes missing #1144
Comments
This is my theory as of right now:
|
Thank you for looking into this issue.
Ideally, I want IntelliJ to pull the sources from the project, not from .m2 local repository (which requires "mvn install" every time we make changes to the sources).
If steps are simple, just adding how-to explanation in DEVELOPMENT.md suffices. (Maybe I'm not familiar with IntelliJ setting file, I worry that we might end up adding irrelevant settings, such as font color, to the file. ) |
I see. Agreed, I think that makes sense and that running
I'll do some digging and see how easy it is to add. Otherwise updating |
Actually, this seems to cause another issue. It's able to resolve the class not found from Intellij, but I can't click the I'll need to take another look... |
Would you focus on investigating/writing down why this happens? (Rather than solutions yet) I think the key is, I observe, "mvn verify" succeeds while "mvn test" fails. (The former does additional steps including packaging; ensure you remove |
I agree. Running |
I'll have to revisit this in the future, but I'll try to add more details so anyone reading this thread can try and pick up where I left off: Some classes not found can be resolved in #1144 (comment) via I wasn't aware that Interestingly, when you run What I would expect to pass (but currently does not):
I would think this would include put gax's testlib in the local ~/.m2 repository and the testlib be used by gapic-generator-java. This only seems to work when I force gapic-generator-java to pull in gax GAV coordinates that are different from what is in the gax module. Temp workaroundsNote: This may or may not work and this may cause more issues
|
Thank you for troubleshooting.
When I mark "gax-java/gax-grpc/src/test/java" as Source Root, it resolves the classes. However, when I reload Maven project, the directory becomes "Test Source Root" again.
This works nicely. But of course we want to have it reference to the same GAX as in the repository. I tried using it via a profile. But IntelliJ didn't recognize it when running a test. |
@suztomo It's great to see you and @JoeWang1127 are working on improving the debugging experience of gapac-generator-java, is it possible to pick this up as well if you have some bandwidth? This has been a big pain to us that we can not run unit tests through intelliJ. |
Doesn’t Lawrence’s workaround “ Set the current Test Sources directory
(src/test/java) as a Sources directory in IntelliJ” work for you?
On Thu, Mar 9, 2023 at 14:58 Blake Li ***@***.***> wrote:
@suztomo <https://github.com/suztomo> It's great you and @JoeWang1127
<https://github.com/JoeWang1127> are working on improving the debugging
experience of gapac-generator-java, is it possible to pick this up as well
if you have some bandwidth? This has been a big pain to us that we can not
run unit tests through intelliJ.
—
Reply to this email directly, view it on GitHub
<#1144 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAG7PE6PRQAMO4Z7YQRAITW3IY47ANCNFSM6AAAAAATBQSYJA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Regards,
Tomo
|
@JoeWang1127 Did you confirm your IntelliJ reproduces the problem? |
Joe confirmed the problem. |
I think the problem is we didn't include the test code when we package the Although in the post, the preferable way to fix the issue is to move the test classes to a dedicated module. |
After repository merge IntelliJ is showing some classes missing but Maven build succeeds. Investigate why.
The text was updated successfully, but these errors were encountered: