1.使用Java项目搭建
2.新目录
3.添加项目支持
4.添加mavem与scala
5.修改pom
1 <?xml version="1.0" encoding="UTF-8"?> 2 <project xmlns="http://maven.apache.org/POM/4.0.0" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 5 <modelVersion>4.0.0</modelVersion> 6 7 <groupId>com.it.kafka</groupId> 8 <artifactId>kafka</artifactId> 9 <version>1.0-SNAPSHOT</version> 10 11 <properties> 12 <kafka.version>0.8.2.1</kafka.version> 13 </properties> 14 15 <dependencies> 16 <dependency> 17 <groupId>org.apache.kafka</groupId> 18 <artifactId>kafka_2.10</artifactId> 19 <version>${kafka.version}</version> 20 </dependency> 21 </dependencies> 22 23 <build> 24 <plugins> 25 <plugin> 26 <groupId>org.apache.maven.plugins</groupId> 27 <artifactId>maven-compiler-plugin</artifactId> 28 <configuration> 29 <source>1.6</source> 30 <target>1.6</target> 31 </configuration> 32 </plugin> 33 </plugins> 34 </build> 35 </project>