pom.xml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License. See accompanying LICENSE file.
  12. -->
  13. <project xmlns="http://maven.apache.org/POM/4.0.0"
  14. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  15. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  16. <modelVersion>4.0.0</modelVersion>
  17. <parent>
  18. <groupId>com.tzld.commons</groupId>
  19. <artifactId>supom</artifactId>
  20. <version>1.0.9</version>
  21. </parent>
  22. <properties>
  23. <spark.version>2.3.0</spark.version>
  24. <cupid.sdk.version>3.3.8-public</cupid.sdk.version>
  25. <scala.version>2.11.12</scala.version>
  26. <scala.binary.version>2.11</scala.binary.version>
  27. <java.version>1.8</java.version>
  28. <maven.compiler.source>${java.version}</maven.compiler.source>
  29. <maven.compiler.target>${java.version}</maven.compiler.target>
  30. <emr.version>2.0.0</emr.version>
  31. <odps.version>0.28.4-public</odps.version>
  32. <!-- 新增:指定 Scala 插件版本(适配 2.11) -->
  33. <scala-maven-plugin.version>4.4.0</scala-maven-plugin.version>
  34. </properties>
  35. <groupId>com.aliyun.odps</groupId>
  36. <artifactId>spark-examples</artifactId>
  37. <version>1.0.0-SNAPSHOT</version>
  38. <packaging>jar</packaging>
  39. <dependencies>
  40. <dependency>
  41. <groupId>com.google.protobuf</groupId>
  42. <artifactId>protobuf-java</artifactId>
  43. <version>3.12.0</version>
  44. </dependency>
  45. <dependency>
  46. <groupId>com.hankcs</groupId>
  47. <artifactId>hanlp</artifactId>
  48. <version>portable-1.8.2</version>
  49. </dependency>
  50. <!-- <dependency>-->
  51. <!-- <groupId>com.medallia.word2vec</groupId>-->
  52. <!-- <artifactId>word2vec</artifactId>-->
  53. <!-- <version>0.1.42</version>-->
  54. <!-- </dependency>-->
  55. <dependency>
  56. <groupId>org.xm</groupId>
  57. <artifactId>similarity</artifactId>
  58. <version>1.1</version>
  59. </dependency>
  60. <dependency>
  61. <groupId>com.alibaba</groupId>
  62. <artifactId>fastjson</artifactId>
  63. <version>1.2.83</version>
  64. </dependency>
  65. <dependency>
  66. <groupId>com.tzld.piaoquan</groupId>
  67. <artifactId>recommend-server-client</artifactId>
  68. <version>1.0.1</version>
  69. </dependency>
  70. <dependency>
  71. <groupId>com.tzld.piaoquan</groupId>
  72. <artifactId>recommend-feature-client</artifactId>
  73. <version>1.0.3</version>
  74. </dependency>
  75. <dependency>
  76. <groupId>com.tzld.piaoquan</groupId>
  77. <artifactId>ad-engine-commons</artifactId>
  78. <version>1.0.0</version>
  79. </dependency>
  80. <dependency>
  81. <groupId>org.apache.spark</groupId>
  82. <artifactId>spark-core_${scala.binary.version}</artifactId>
  83. <version>${spark.version}</version>
  84. <scope>provided</scope>
  85. <exclusions>
  86. <exclusion>
  87. <groupId>org.scala-lang</groupId>
  88. <artifactId>scala-library</artifactId>
  89. </exclusion>
  90. <exclusion>
  91. <groupId>org.scala-lang</groupId>
  92. <artifactId>scalap</artifactId>
  93. </exclusion>
  94. </exclusions>
  95. </dependency>
  96. <dependency>
  97. <groupId>org.apache.spark</groupId>
  98. <artifactId>spark-sql_${scala.binary.version}</artifactId>
  99. <version>${spark.version}</version>
  100. <scope>provided</scope>
  101. </dependency>
  102. <dependency>
  103. <groupId>org.apache.spark</groupId>
  104. <artifactId>spark-mllib_${scala.binary.version}</artifactId>
  105. <version>${spark.version}</version>
  106. <scope>provided</scope>
  107. </dependency>
  108. <dependency>
  109. <groupId>org.apache.spark</groupId>
  110. <artifactId>spark-streaming_${scala.binary.version}</artifactId>
  111. <version>${spark.version}</version>
  112. <scope>provided</scope>
  113. </dependency>
  114. <dependency>
  115. <groupId>com.aliyun.odps</groupId>
  116. <artifactId>cupid-sdk</artifactId>
  117. <version>${cupid.sdk.version}</version>
  118. <scope>provided</scope>
  119. </dependency>
  120. <dependency>
  121. <groupId>com.aliyun.odps</groupId>
  122. <artifactId>hadoop-fs-oss</artifactId>
  123. <version>${cupid.sdk.version}</version>
  124. </dependency>
  125. <dependency>
  126. <groupId>com.aliyun.odps</groupId>
  127. <artifactId>odps-spark-datasource_${scala.binary.version}</artifactId>
  128. <version>${cupid.sdk.version}</version>
  129. </dependency>
  130. <dependency>
  131. <groupId>org.scala-lang</groupId>
  132. <artifactId>scala-library</artifactId>
  133. <version>${scala.version}</version>
  134. </dependency>
  135. <dependency>
  136. <groupId>org.scala-lang</groupId>
  137. <artifactId>scala-actors</artifactId>
  138. <version>${scala.version}</version>
  139. </dependency>
  140. <dependency>
  141. <groupId>com.aliyun.emr</groupId>
  142. <artifactId>emr-maxcompute_2.11</artifactId>
  143. <version>${emr.version}</version>
  144. </dependency>
  145. <dependency>
  146. <groupId>org.springframework.boot</groupId>
  147. <artifactId>spring-boot-starter-data-redis</artifactId>
  148. <version>2.4.2</version>
  149. </dependency>
  150. <dependency>
  151. <groupId>redis.clients</groupId>
  152. <artifactId>jedis</artifactId>
  153. <version>3.3.0</version>
  154. </dependency>
  155. <dependency>
  156. <groupId>org.projectlombok</groupId>
  157. <artifactId>lombok</artifactId>
  158. <version>1.18.24</version>
  159. </dependency>
  160. <dependency>
  161. <groupId>ml.dmlc</groupId>
  162. <artifactId>xgboost4j-spark_2.11</artifactId>
  163. <version>1.1.2</version>
  164. </dependency>
  165. <dependency>
  166. <groupId>com.tzld.piaoquan</groupId>
  167. <artifactId>recommend-similarity</artifactId>
  168. <version>1.0.0</version>
  169. </dependency>
  170. </dependencies>
  171. <build>
  172. <!-- 新增:指定源码目录(确保 scala 目录被识别) -->
  173. <sourceDirectory>src/main/scala</sourceDirectory>
  174. <testSourceDirectory>src/test/scala</testSourceDirectory>
  175. <plugins>
  176. <plugin>
  177. <groupId>org.apache.maven.plugins</groupId>
  178. <artifactId>maven-surefire-plugin</artifactId>
  179. <version>2.18.1</version>
  180. <configuration>
  181. <skipTests>true</skipTests>
  182. </configuration>
  183. </plugin>
  184. <plugin>
  185. <groupId>org.apache.maven.plugins</groupId>
  186. <artifactId>maven-compiler-plugin</artifactId>
  187. <configuration>
  188. <compilerVersion>${java.version}</compilerVersion>
  189. <source>1.8</source>
  190. <target>1.8</target>
  191. </configuration>
  192. </plugin>
  193. <!-- 关键修改:替换为新版 Scala 编译插件 -->
  194. <plugin>
  195. <groupId>net.alchim31.maven</groupId>
  196. <artifactId>scala-maven-plugin</artifactId>
  197. <version>${scala-maven-plugin.version}</version>
  198. <executions>
  199. <execution>
  200. <id>scala-compile-first</id>
  201. <phase>process-resources</phase>
  202. <goals>
  203. <goal>add-source</goal> <!-- 关键:添加源码目录 -->
  204. <goal>compile</goal>
  205. </goals>
  206. <configuration>
  207. <scalaVersion>${scala.version}</scalaVersion>
  208. <compileJavaWithJavac>true</compileJavaWithJavac> <!-- 编译 Java 文件 -->
  209. <includes>
  210. <include>**/*.scala</include>
  211. <include>**/*.java</include>
  212. </includes>
  213. </configuration>
  214. </execution>
  215. <execution>
  216. <id>scala-test-compile</id>
  217. <phase>process-test-resources</phase>
  218. <goals>
  219. <goal>testCompile</goal>
  220. </goals>
  221. <configuration>
  222. <scalaVersion>${scala.version}</scalaVersion>
  223. </configuration>
  224. </execution>
  225. </executions>
  226. </plugin>
  227. <plugin>
  228. <artifactId>maven-assembly-plugin</artifactId>
  229. <configuration>
  230. <descriptorRefs>
  231. <descriptorRef>jar-with-dependencies</descriptorRef>
  232. </descriptorRefs>
  233. </configuration>
  234. <executions>
  235. <execution>
  236. <id>make-assembly</id>
  237. <phase>package</phase>
  238. <goals>
  239. <goal>single</goal>
  240. </goals>
  241. </execution>
  242. </executions>
  243. </plugin>
  244. </plugins>
  245. </build>
  246. </project>