Spark's Java and Scala hybrid engineering build record!

Source: Internet
Author: User

Spark's Java and Scala hybrid engineering build record!

Today with this catch up, various ways, all kinds of baidu.


one, Maven Build manually


1, dos command, Enter the directory, the construction of a Scala template project


MVN archetype:generate-darchetypegroupid=org.scala-tools.archetypes-darchetypeartifactid=scala-archetype-simple -dremoterepositories=http://scala-tools.org/repo-releases-dgroupid=com.dyq-dartifactid=kafkasparkredis- Dversion=1.0-snapshot


2. Transform into Eclipse project:

MVN Eclipse:eclipse

I succeeded with the above 2 Times.

You can also use:

MVN Org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse


3. New directory for Java



The results are as follows, and none of them add ├── pom.xml├── src│        ├── main│            │     ├── java│               │      │     └── com.jhh│                  │     │              │ ── Main.java              │     └── scala│               │            └── com│                   │                  │ ── jhh                 │                            │── App.scala        └── test│                  ├── java│                  └── scala


4. Add plugins to manage Java

Modify Pom.xml Add a Pluginbuild-helper plugin to manage Java source, add location/project/build/plugins<plugin><groupid> Org.codehaus.mojo</groupid><artifactid>build-helper-maven-plugin</artifactid><executions ><execution><phase>generate-sources</phase><goals><goal>add-source</goal ></goals><configuration><sources><source>src/main/java</source></sources ></configuration></execution></executions></plugin>



Spark's Java and Scala hybrid engineering build record!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.