1

I am getting an exception when generating the metamodel using the Hibernate JPA 2 Static-Metamodel Generator on playframework 2.4

[info] Compiling 6 Java sources to /mnt/data/dev/play/eclipse/workspace2/play-java-intro/target/scala-2.11/classes...
[info] Hibernate JPA 2 Static-Metamodel Generator 5.0.5.Final
[error] (compile:compileIncremental) javac returned nonzero exit code

In googling this there would appear to be a solution IF I WERE using maven directly. That would be, reverting the maven-compiler-plugin version to an older more stable version (i.e., 2.5.1).

javac 8 error while metamodel generation (hibernate-jpamodelgen)

IllegalStateException in Hibernate metamodel generation with maven

https://issues.apache.org/jira/browse/MCOMPILER-205

However, I am on playframework 2.4. Am I even using the maven-compiler-plugin? It is not listed anywhere in any file in the play project. This is not at all transparent. I can't find any documentation about it. And I read there exists an SBT replacement for the maven-compiler-plugin https://sbt-compiler-maven-plugin.github.io/sbt-compiler-maven-plugin/1.0.0-beta7/index.html I guess if that is what I have, I have deeper problems... although, I can't find any direct reference to THAT in any files either.

If play framework is using the maven-compiler-plugin (how can I see that, btw) how would I override play and specify my own version in the dependencies?

If it is working somehow differently? Any idea how this problem might be fixed? anyone else seen it?

Of course I did a quick hacky fix-attempt, adding the dependency in my build.sbt file,

"org.apache.maven.plugins" % "maven-compiler-plugin" % "2.5.1",

but that didn't seem to fix things.

As a work-around, it seems I can delete certain generated files (seems I can get away with deleting the generated Java file... .but i'm not 100% of that)

Community
  • 1
  • 1
svaens
  • 649
  • 7
  • 23
  • So if you can't find any reference, then what is it you're actually using? There must be some dependency and code if you / the compiler are attempting to run it? – gpgekko Dec 24 '15 at 13:33
  • Play documentation actually says it uses "Play 2.0 uses Apache Ivy (via sbt)" for dependency management. Though tbh, I am still very unfamiliar with maven and don't know what 'compiling' it has to do (and why maven has something to do with a compile error, as stated in the linked bug report), but it is only due to what I have read that I look in that direction (SBT/IVY/MAVEN). Again, if this were not a play project and I had explicitly used a particular version of Maven, i'd be able to swap it out as per linked suggestions for work-around. As that is not the case, I am currently stumped. – svaens Dec 24 '15 at 14:03
  • You could try `dependencyOverrides += "org.apache.maven.plugins" % "maven-compiler-plugin" % "2.5.1"` in the build.sbt – gpgekko Dec 24 '15 at 14:05
  • 1
    I mean, above link specify "its not because of jdk or hibernate.". Funny, as the error seems completely related to the generation of the metamodel files. I will try reverting to an older version of the hibernate metamodel generator to verify that. – svaens Dec 24 '15 at 14:07
  • OK. I'll give that a go, thanks for the suggestion! – svaens Dec 24 '15 at 14:08

0 Answers0