[2.3.8][Java] activator compile tasks works but activator start task fails with a compilation error

89 views
Skip to first unread message

Joël Vimenet

unread,
Feb 26, 2015, 10:35:52 AM2/26/15
to play-fr...@googlegroups.com
Hello,

we encounter a strange error. We have got an application that was previously using play 2.0, and we ported it in play 2.3.8. We followed the guidelines and it works fine when we run it through "activator run".
When we try to package it for release with "dist" or to run it with "start", it fails with a compilation error. The error is relied to a class of Lucene 3.6.1 : ReusableAnalyzerBase and TokenStreamComponents, the second is a nested static class of the first one.



import java.io.Reader;

import org.apache.lucene.analysis.ReusableAnalyzerBase;

public class MyAnalyzer extends ReusableAnalyzerBase {


 
public MyAnalyzer() {
   

 
}

 
@Override
 
protected TokenStreamComponents createComponents(String fieldName, Reader aReader) {
   
// This part was changed, but the content of the method is not involved in the problem
   
return null;
 
}

}

When it fails we get the following compile error : 

[info] Wrote /tmp/test/target/scala-2.11/test_2.11-1.0-SNAPSHOT.pom
[error] /tmp/test/app/MyAnalyzer.java:19: not found: type TokenStreamComponents
[error] protected TokenStreamComponents createComponents(String fieldName, Reader aReader) {
[error] ^
model contains
20 documentable templates
[error] one error found
[error] (compile:doc) Scaladoc generation failed

Cannot start with errors.

importing org.apache.lucene.analysis.ReusableAnalyzerBase.TokenStreamComponents fixes the problem, but this behavior is really strange and I would like to understand. I tested a similar case with gradle and there is no problem. With eclipse there is no problem, and it tells me that the added import is useless.
I tried to google something like "sbt start and compile tasks difference", but I didn't find anything.

Does activator use another java compiler than the JDK or specific javac options? I tried to get the javaOption key in activator console, but it does not display any other option than the ones I set.
We use activator 1.2.12.

Thanks in advance for your help.

Peter Vlugter

unread,
Feb 26, 2015, 7:18:53 PM2/26/15
to play-framework
Hi Joël,

Note that the error is coming from scaladoc compilation. You could check the scala issue tracker for any more information about this limitation.

Peter
> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Joël Vimenet

unread,
Feb 27, 2015, 4:28:43 AM2/27/15
to play-fr...@googlegroups.com
Thank you!

As my project is a mixed java/scala project, the doc tasks runs scaladoc (http://stackoverflow.com/questions/25469521/how-to-force-sbt-to-use-javadoc-instead-of-scaladoc), and it seems it doesn't like java sources.

We deactivated the doc task using this : 
sources in (Compile,doc) := Seq.empty
publishArtifact in (Compile, packageDoc) := false
that we found here : http://stackoverflow.com/questions/21461798/how-to-disable-scaladoc-generation-in-dist-task-in-play-2-2-x-using-project-bui

It now works fine.

Thank you very much for your help!
Best regards

> To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.

> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "play-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/play-framework/WM5wqMZoyC0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to play-framework+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages