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!