DSM analysis fails with "No class files were found"
已回答
I have a project which is building fine and has a number of classes. I can perform all the different types of analysis but when I try to generate a DSM I get the "No class files were found". I see some references to this from 2007 but that was for Ant builds which doesn't apply here.
Any ideas?
This can be easily reproduced with, for example, this project: https://github.com/alibaba/fastjson
请先登录再写评论。
Can't reproduce in IntelliJ IDEA 2017.3.4:
Can you give the details of exactly what you did? I.e. what scope you used, whether you included test sources, etc, so I can try the exact same way? I've tried several ways so far and all failed.
I'm using the same version.
Scopes that fail: whole project, directory fastjson, custom scope "all places"
Used all the defaults:
Okay, but I assume you're experienced enough to know that "works on my machine" is not a solution.
Screen capture:
https://drive.google.com/file/d/1BghNHKFKdni8rtIfvNmMv1ftmbyo-pNC/view?usp=sharing
Does Build | Rebuild complete without errors? Any errors in idea.log: https://intellij-support.jetbrains.com/hc/articles/207241085?
What IntelliJ IDEA version is used?
Can you delete .idea directory, reimport the project from pom.xml and rebuild, then try again?
Version 2017.3.4
Rebuilding has no errors in the IDE:
Information:javac 7 was used to compile java sources
Information:2/12/18, 7:13 PM - Compilation completed successfully in 11s 623ms
The log shows:
2018-02-12 19:12:51,498 [2402321] INFO - ij.compiler.impl.CompileDriver - COMPILATION STARTED (BUILD PROCESS)
2018-02-12 19:12:52,621 [2403444] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: /Users/gwheeler/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/173.4548.28/IntelliJ IDEA.app/Contents/lib/jps-launcher.jar:/Users/gwheeler/Library/Preferences/IntelliJIdea2017.3/jdks/jbsdk8u152b1136.5_osx_x64/jdk/Contents/Home/lib/tools.jar:/Users/gwheeler/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/173.4548.28/IntelliJ IDEA.app/Contents/lib/optimizedFileManager.jar
2018-02-12 19:12:52,677 [2403500] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
2018-02-12 19:12:52,677 [2403500] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Defaulting to no-operation (NOP) logger implementation
2018-02-12 19:12:52,677 [2403500] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2018-02-12 19:13:03,091 [2413914] INFO - lij.compiler.impl.CompilerUtil - COMPILATION FINISHED (BUILD PROCESS); Errors: 0; warnings: 0 took 11623 ms: 0 min 11sec
I quit IntelliJ, deleted the .idea directory, restarted, rebuilt, and tried again, but get the same error.
If I change the Java version to 1.8 (in Project Structure - Project SDK) then it works.
For some reason no classes are compiled on your system. Notice that target/classes directory is empty. Also the messages says 0 warnings, while this project produces a plenty of compiler warnings.
Enable debug logging for build.log file and share the complete build.log file with debug info after performing rebuild: https://intellij-support.jetbrains.com/hc/articles/206869619.
See also https://intellij-support.jetbrains.com/hc/articles/207241085 for the info how to enable debug logging for build.log.
Thanks for the info, I've reported a bug at https://youtrack.jetbrains.com/v2/issue/IDEA-186575, please follow for updates. See https://intellij-support.jetbrains.com/hc/articles/207241135 if you are not familiar with YouTrack.
Did you manage to get a repro using Java 1.7? Or do you still need me to get build log files files?
Yes, I did reproduce it with 1.7.
Ok, thanks! I'm unblocked for now too.
Quick question, is this feature only available for java in that it's searching for java compiled *.class files?
I tried running on a kotlin project whole project directory scoped and got this message
It should work with kotlin classes as well. I could test it with a sample kotlin project. Do you see your compiled classes in the projects view? Do you see the same issue when trying with the whole project ?
It would help if you could share a reproducer project and a screencast of the issue. You can upload it to https://uploads.jetbrains.com/.