怎么构建maven工程


本篇内容介绍了“怎么构建maven工程”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!1,要求Maven 3.0.4以上版本Java 7.x以上版本2,构建maven工程mvn archetype:generate
-DarchetypeGroupId=org.apache.flink
-DarchetypeArtifactId=flink-quickstart-scala
-DarchetypeVersion=1.3.2允许你重新给你的工程命名,执行该命令后需要输入groupId, artifactId, and package名。3,检查导入项目可以在生成的目录下查看工程目录结构可以将该maven工程导入你的IDE编辑器。对于Eclipse,需要下面的几个插件,可以在线安装。1),Eclipse 4.xa)Scala IDE : http://download.scala-ide.org/sdk/lithium/e44/scala211/stable/siteb)m2eclipse-scala : http://alchim31.free.fr/m2e-scala/update-sitec)BuildHelper Maven Plugin :https://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-buildhelper/0.15.0/N/0.15.0.201207090124/2),Eclipse 3.8a)Scala IDE for Scala 2.11 :http://download.scala-ide.org/sdk/helium/e38/scala211/stable/siteScala IDE for Scala 2.10 :http://download.scala-ide.org/sdk/helium/e38/scala210/stable/siteb) m2eclipse-scala :http://alchim31.free.fr/m2e-scala/update-sitec)Build Helper Maven Pluginhttps://repository.sonatype.org/content/repositories/forge-sites/m2e-extras/0.14 香港云主机.0/N/0.14.0.201109282148/IntelliJ IDE直接导入maven工程,然后引入scala插件即可。4,运行测试浪尖习惯用idea作为,导入工程后,可以看到object WordCount {
def main(args: Array[String]) {
// set up the execution environment
val env = ExecutionEnvironment.getExecutionEnvironment
// get input data
val text = env.fromElements(“To be, or not to be,–that is the question:–“,
“Whether ’tis nobler in the mind to suffer”, “The slings and arrows of outrageous fortune”,
“Or to take arms against a sea of troubles,”)
val counts = text.flatMap { _.toLowerCase.split(“W+”) }
.map { (_, 1) }
.groupBy(0)
.sum(1)
// execute and print result
counts.print()

}
}直接可以在idea中运行,执行结果如下:“怎么构建maven工程”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注开发云网站,小编将为大家输出更多高质量的实用文章!

相关推荐: 如何使用springData来操作es

这篇文章主要介绍“如何使用springData来操作es”,在日常操作中,相信很多人在如何使用springData来操作es问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”如何使用springData来操作es”的疑惑有所帮助!接…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

(0)
打赏 微信扫一扫 微信扫一扫
上一篇 08/06 16:56
下一篇 08/06 16:56

相关推荐