Turn Kafka project into MAVEN project

Source: Internet
Author: User

Kafka the source code provided by default is built through SBT and is not very convenient when importing to eclipse, so you can convert it to a MAVEN project, and the Pom.xml configuration is as follows:

<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xsi: schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" ><modelversion >4.0.0</modelversion><groupid>com.sina.kafka</groupid><artifactid>core</ artifactid><version>0.8.0-beta1</version><inceptionyear>2008</inceptionyear>< properties><scala.version>2.8.0</scala.version></properties><repositories>< Repository><id>scala-tools.org</id><name>scala-tools Maven2 Repository</name><url >http://scala-tools.org/repo-releases</url></repository></repositories>< Pluginrepositories><pluginrepository><id>scala-tools.org</id><name>scala-tools Maven2 repository</name><url>http://scala-tools.org/repo-releases</url></pluginrepository ></pluginrepositories><dependencies><dependency><groupid>org.scala-lang</groupid><artifactid>scala-library</ Artifactid><version>${scala.version}</version></dependency><dependency><groupid >junit</groupid><artifactid>junit</artifactid><version>4.4</version><scope >test</scope></dependency><dependency><groupId>org.specs</groupId>< artifactid>specs</artifactid><version>1.2.5</version><scope>test</scope></ dependency><dependency><groupid>com.101tec</groupid><artifactid>zkclient</ Artifactid><version>0.3</version></dependency><dependency><groupid> org.xerial.snappy</groupid><artifactid>snappy-java</artifactid><version>1.0.4.1</ version></dependency><dependency><groupid>com.yammer.metrics</groupid>< artifactid>metrics-core</artifactid><version>2.2.0</version></dependency><dependency><groupid>com.yammer.metrics</ groupid><artifactid>metrics-annotation</artifactid><version>2.2.0</version></ dependency><dependency><groupid>org.easymock</groupid><artifactid>easymock</ artifactid><version>3.0</version><scope>test</scope></dependency>< Dependency><groupid>net.sf.jopt-simple</groupid><artifactid>jopt-simple</artifactid ><version>4.9</version></dependency></dependencies><build><sourcedirectory >src/main/scala</sourcedirectory><testsourcedirectory>src/test/scala</testsourcedirectory ><plugins><plugin><groupId>org.scala-tools</groupId><artifactId> maven-scala-plugin</artifactid><executions><execution><goals><goal>compile</ goal><goal>testcompile</goal>&Lt;/goals></execution></executions><configuration><scalaversion>${scala.version} </scalaVersion><args><arg>-target:jvm-1.5</arg></args></configuration>< /plugin><plugin><groupid>org.apache.maven.plugins</groupid><artifactid> Maven-eclipse-plugin</artifactid><configuration><downloadsources>true</downloadsources ><buildcommands><buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand></ buildcommands><additionalprojectnatures><projectnature>ch.epfl.lamp.sdt.core.scalanature</ Projectnature></additionalprojectnatures><classpathcontainers><classpathcontainer> Org.eclipse.jdt.launching.jre_container</classpathcontainer><classpathcontainer> ch.epfl.lamp.sdt.launching.scala_container</classpathcontainer></classpathcontainers></ Configuration></plugin></plugins></build><rePorting><plugins><plugin><groupid>org.scala-tools</groupid><artifactid> maven-scala-plugin</artifactid><configuration><scalaversion>${scala.version}</ Scalaversion></configuration></plugin></plugins></reporting></project>

Mainly relies on Maven-scala-plugin this plug-in to build the project, the Build command is: Clean scala:compile package-dskiptests

Turn Kafka project into MAVEN project

Related Article

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.