RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
怎么构建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工程

可以将该maven工程导入你的IDE编辑器。对于Eclipse,需要下面的几个插件,可以在线安装。

1),Eclipse 4.x

a) Scala IDE : http://download.scala-ide.org/sdk/lithium/e44/scala211/stable/site

b) m2eclipse-scala :  http://alchim31.free.fr/m2e-scala/update-site

c) BuildHelper Maven Plugin :

https://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-buildhelper/0.15.0/N/0.15.0.201207090124/

2),Eclipse 3.8

a) Scala IDE for Scala 2.11 :

http://download.scala-ide.org/sdk/helium/e38/scala211/stable/site

Scala IDE for Scala 2.10 :

http://download.scala-ide.org/sdk/helium/e38/scala210/stable/site

b)  m2eclipse-scala :

http://alchim31.free.fr/m2e-scala/update-site

c)Build Helper Maven Plugin

https://repository.sonatype.org/content/repositories/forge-sites/m2e-extras/0.14.0/N/0.14.0.201109282148/

IntelliJ IDE直接导入maven工程,然后引入scala插件即可。

4,运行测试

浪尖习惯用idea作为,导入工程后,可以看到

objectWordCount {
  defmain(args: Array[String]) {
    // set up the execution environment
    valenv = ExecutionEnvironment.getExecutionEnvironment
    // get input data
    valtext = 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,")
    valcounts = text.flatMap { _.toLowerCase.split("\\W+") }
      .map { (_, 1) }
      .groupBy(0)
      .sum(1)
    // execute and print result
    counts.print()

  }
}

直接可以在idea中运行,执行结果如下:

怎么构建maven工程

“怎么构建maven工程”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注创新互联网站,小编将为大家输出更多高质量的实用文章!


分享标题:怎么构建maven工程
文章出自:http://sczitong.cn/article/jeedes.html