I am using maven with the scala-maven-plugin for building a project that is a mixture of Java 1.8 and Scala 2.12.7 code. When I build from the command line with:
mvn clean install -DskipTests
I get messages like:
"[WARNING] Could not determine source for class com.mycompany.MyClass_".
com.mycompany.MyClass
is an annotated Java class that exists in my project. Note that the warning message has an underscore after "MyClass". There is no Java source code for a class named com.mycompany.MyClass_
in my project, but there is a class file at target/classes/com/mycompany/MyClass_.class
.
What can I do to determine the cause of these warnings and remove them? (I can get rid of them by commenting out the scala-maven-plugin
section of my pom file, but that seems a little extreme.)
Additional diagnostic data:
Following @Joachim Sauer's advice, I used javap
to look at the class file. The output included:
Compiled from "MyClass_.java"
I did a search for "MyClass_.java" from the root of the project. It was found in
target/scoverage-classes/com/mycompany/MyClass_.java
When I look at that class in the editor, it includes:
@Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor")
@StaticMetamodel(FileMetadata.class)
So it looks like the file generated by SCoverage and/or JPAMetaModelEntityProcessor
is not locatable by some other tool. I'll dig some more...