Compiling scalastyle fails

瀏覽次數:133 次
跳到第一則未讀訊息

Leo GL

未讀,
2014年2月6日 上午10:23:592014/2/6
收件者:scalasty...@googlegroups.com
I would like to compile the scalastyle so I download the scalastyle zip from githut and import it into eclipse as a maven project. Calling mvn scala:compile produces following output:
...
[INFO] Compiling 48 Scala sources to J:\source\scalastyle-master\target\classes...
[ERROR] J:\source\scalastyle-master\src\main\scala\org\scalastyle\Main.scala:34: scopt.OptionParser does not take type parameters
[ERROR]     val parser = new scopt.OptionParser[MainConfig]("scalastyle") {
[ERROR]                            ^
[ERROR] J:\source\scalastyle-master\src\main\scala\org\scalastyle\Main.scala:34: too many arguments for constructor Object: ()Object
[ERROR]     val parser = new scopt.OptionParser[MainConfig]("scalastyle") {
[ERROR]                      ^
[ERROR] J:\source\scalastyle-master\src\main\scala\org\scalastyle\Main.scala:35: not found: value head
[ERROR]         head("scalastyle", properties.getProperty("scalastyle.version"))
[ERROR]         ^
[ERROR] J:\source\scalastyle-master\src\main\scala\org\scalastyle\Main.scala:36: not found: value opt
[ERROR]         opt[String]('c', "config") action { (v: String, c: MainConfig) => c.copy(config = Some(v)) } text("configuration file (required)")
[ERROR]         ^
[ERROR] J:\source\scalastyle-master\src\main\scala\org\scalastyle\Main.scala:37: not found: value opt
[ERROR]         opt[Boolean]('v', "verbose") action { (v: Boolean, c: MainConfig) => c.copy(verbose = v) } text("verbose")
[ERROR]         ^
[ERROR] J:\source\scalastyle-master\src\main\scala\org\scalastyle\Main.scala:38: not found: value opt
[ERROR]         opt[Boolean]('q', "quiet") action { (v: Boolean, c: MainConfig) => c.copy(quiet = v) } text("quiet")
[ERROR]         ^
[ERROR] J:\source\scalastyle-master\src\main\scala\org\scalastyle\Main.scala:39: not found: value opt
[ERROR]         opt[String]("xmlOutput") action { (v: String, c: MainConfig) => c.copy(xmlFile = Some(v)) } text("XML output (optional)")
[ERROR]         ^
[ERROR] J:\source\scalastyle-master\src\main\scala\org\scalastyle\Main.scala:40: not found: value opt
[ERROR]         opt[String]("xmlEncoding") action { (v: String, c: MainConfig) => c.copy(xmlEncoding = Some(v)) } text("XML output encoding (optional)")
[ERROR]         ^
[ERROR] J:\source\scalastyle-master\src\main\scala\org\scalastyle\Main.scala:41: not found: value opt
[ERROR]         opt[String]("inputEncoding") action { (v: String, c: MainConfig) => c.copy(inputEncoding = Some(v)) } text("Source file encoding (input) (optional)")
[ERROR]         ^
[ERROR] J:\source\scalastyle-master\src\main\scala\org\scalastyle\Main.scala:42: not found: value opt
[ERROR]         opt[Boolean]('w', "warnings") action { (v: Boolean, c: MainConfig) => c.copy(warningsaserrors = v) } text("fail if there are warnings")
[ERROR]         ^
[ERROR] J:\source\scalastyle-master\src\main\scala\org\scalastyle\Main.scala:43: not found: value arg
[ERROR]         arg[String]("<directory>") action { (v: String, c: MainConfig) => c.copy(directories = v :: c.directories) } text("directories / files")
[ERROR]         ^
[ERROR] J:\source\scalastyle-master\src\main\scala\org\scalastyle\Main.scala:47: value parse is not a member of AnyRef
[ERROR]     val exitVal = parser.parse(args, MainConfig(None, List())) map { config =>
[ERROR]                          ^
[ERROR] 12 errors found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.697s
[INFO] Finished at: Thu Feb 06 16:19:21 CET 2014
[INFO] Final Memory: 74M/406M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.1.0:compile (default-cli) on project scalastyle_2.10: Execution default-cli of goal net.alchim31.maven:scala-maven-plugin:3.1.0:compile failed. CompileFailed -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:

Could anyone explain me how to solve the problem? Thanks.

Matthew Farwell

未讀,
2014年2月9日 上午9:19:282014/2/9
收件者:scalasty...@googlegroups.com
I don't understand why it doesn't work for you.

You shouldn't need to do scala:compile - mvn compile should just work.

Are you sure that the version that you've cloned is correct? What is the result of the following command?

$ git rev-parse HEAD

Thanks.

Matthew Farwell
回覆所有人
回覆作者
轉寄
0 則新訊息