pom.xml 12.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<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>

	<parent>
		<groupId>org.apache.flink</groupId>
		<artifactId>flink-parent</artifactId>
G
Gary Yao 已提交
26
		<version>1.11-SNAPSHOT</version>
27 28 29 30
		<relativePath>..</relativePath>
	</parent>

	<!--
31
	There is a separate "flink-yarn-tests" package that expects the "flink-dist" package
32 33 34 35
	to be build before.
	We need the YARN fat jar build by flink-dist for the tests.
	-->
	
36
	<artifactId>flink-yarn-tests</artifactId>
37 38 39 40
	<name>flink-yarn-tests</name>
	<packaging>jar</packaging>

	<dependencies>
41 42
		
		<!-- test dependencies -->
43

44 45 46 47 48
		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-test-utils-junit</artifactId>
		</dependency>
		
49 50
		<dependency>
			<groupId>org.apache.flink</groupId>
51
			<artifactId>flink-test-utils_${scala.binary.version}</artifactId>
52
			<version>${project.version}</version>
53
			<scope>test</scope>
54 55
		</dependency>

56 57 58 59 60 61 62 63
		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-dist_${scala.binary.version}</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
			<type>pom</type>
		</dependency>

64 65
		<dependency>
			<groupId>org.apache.flink</groupId>
66
			<artifactId>flink-runtime_${scala.binary.version}</artifactId>
67 68 69 70 71
			<version>${project.version}</version>
			<scope>test</scope>
			<type>test-jar</type>
		</dependency>

72 73 74 75 76 77 78 79
		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-clients_${scala.binary.version}</artifactId>
			<version>${project.version}</version>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>

80 81 82
		<!-- Needed for the streaming wordcount example -->
		<dependency>
			<groupId>org.apache.flink</groupId>
83
			<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
84
			<version>${project.version}</version>
85
			<scope>test</scope>
86 87
		</dependency>

88 89
		<dependency>
			<groupId>org.apache.flink</groupId>
90
			<artifactId>flink-yarn_${scala.binary.version}</artifactId>
91
			<version>${project.version}</version>
92
			<scope>test</scope>
93
		</dependency>
94

95 96
		<dependency>
			<groupId>org.apache.flink</groupId>
97
			<artifactId>flink-yarn_${scala.binary.version}</artifactId>
98 99 100 101 102
			<version>${project.version}</version>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>

103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-examples-batch_${scala.binary.version}</artifactId>
			<version>${project.version}</version>
			<type>jar</type>
			<classifier>WordCount</classifier>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-examples-streaming_${scala.binary.version}</artifactId>
			<version>${project.version}</version>
			<type>jar</type>
			<classifier>WordCount</classifier>
			<scope>test</scope>
		</dependency>

121
		<dependency>
122 123 124
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-common</artifactId>
			<version>${hadoop.version}</version>
125
			<scope>test</scope>
126
			<exclusions>
127 128 129 130 131 132 133 134
				<exclusion>
					<groupId>log4j</groupId>
					<artifactId>log4j</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-log4j12</artifactId>
				</exclusion>
135 136 137 138 139 140
				<exclusion>
					<!-- This dependency is no longer shipped with the JDK since Java 9.-->
					<groupId>jdk.tools</groupId>
					<artifactId>jdk.tools</artifactId>
				</exclusion>
			</exclusions>
141 142
		</dependency>

143
		<dependency>
144 145 146
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-yarn-client</artifactId>
			<version>${hadoop.version}</version>
147
			<scope>test</scope>
148
			<exclusions>
149 150 151 152
				<exclusion>
					<groupId>log4j</groupId>
					<artifactId>log4j</artifactId>
				</exclusion>
153 154 155 156 157 158
				<exclusion>
					<!-- This dependency is no longer shipped with the JDK since Java 9.-->
					<groupId>jdk.tools</groupId>
					<artifactId>jdk.tools</artifactId>
				</exclusion>
			</exclusions>
159 160
		</dependency>

161
		<dependency>
162 163 164 165
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-yarn-api</artifactId>
			<version>${hadoop.version}</version>
			<scope>test</scope>
166 167 168 169 170 171 172
			<exclusions>
				<exclusion>
					<!-- This dependency is no longer shipped with the JDK since Java 9.-->
					<groupId>jdk.tools</groupId>
					<artifactId>jdk.tools</artifactId>
				</exclusion>
			</exclusions>
173 174 175 176 177 178 179
		</dependency>

		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-minicluster</artifactId>
			<version>${hadoop.version}</version>
			<scope>test</scope>
180 181 182 183 184 185 186 187 188 189
			<exclusions>
				<exclusion>
					<groupId>log4j</groupId>
					<artifactId>log4j</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-log4j12</artifactId>
				</exclusion>
			</exclusions>
190
		</dependency>
191 192 193 194 195

		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-minikdc</artifactId>
			<version>${minikdc.version}</version>
196
			<scope>test</scope>
197 198 199 200 201 202
			<exclusions>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-log4j12</artifactId>
				</exclusion>
			</exclusions>
203 204
		</dependency>

205 206 207 208
	</dependencies>

	<build>
		<plugins>
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<executions>
					<execution>
						<id>dependency-convergence</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<skip>true</skip>
						</configuration>
					</execution>
				</executions>
			</plugin>

225 226
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
227
				<artifactId>maven-surefire-plugin</artifactId>
228 229 230 231 232 233
				<executions>
					<execution>
						<id>integration-tests</id>
						<configuration>
							<!-- Enforce single threaded execution due to port conflicts with the mini yarn cluster -->
							<forkCount>1</forkCount>
234 235
							<!-- Some plugin has a nasty side-effect that sets the working directory to
							.../flink-yarn-tests/target during integration tests, which is rather unusual -->
236 237 238 239
							<workingDirectory>../</workingDirectory>
						</configuration>
					</execution>
				</executions>
240
			</plugin>
241

242 243 244 245 246 247 248 249 250
			<!-- Skip the deployment of this module since it only contains yarn tests -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>

251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
			<!-- Scala Compiler -->
			<plugin>
				<groupId>net.alchim31.maven</groupId>
				<artifactId>scala-maven-plugin</artifactId>
				<executions>
					<!-- Run scala compiler in the process-resources phase, so that dependencies on
						scala classes can be resolved later in the (Java) compile phase -->
					<execution>
						<id>scala-compile-first</id>
						<phase>process-resources</phase>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>

					<!-- Run scala compiler in the process-test-resources phase, so that dependencies on
						 scala classes can be resolved later in the (Java) test-compile phase -->
					<execution>
						<id>scala-test-compile</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>testCompile</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<jvmArgs>
						<jvmArg>-Xms128m</jvmArg>
						<jvmArg>-Xmx512m</jvmArg>
					</jvmArgs>
				</configuration>
			</plugin>

			<!-- Eclipse Integration -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-eclipse-plugin</artifactId>
				<version>2.8</version>
				<configuration>
					<downloadSources>true</downloadSources>
					<projectnatures>
						<projectnature>org.scala-ide.sdt.core.scalanature</projectnature>
						<projectnature>org.eclipse.jdt.core.javanature</projectnature>
					</projectnatures>
					<buildcommands>
						<buildcommand>org.scala-ide.sdt.core.scalabuilder</buildcommand>
					</buildcommands>
					<classpathContainers>
						<classpathContainer>org.scala-ide.sdt.launching.SCALA_CONTAINER</classpathContainer>
						<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
					</classpathContainers>
					<excludes>
						<exclude>org.scala-lang:scala-library</exclude>
						<exclude>org.scala-lang:scala-compiler</exclude>
					</excludes>
					<sourceIncludes>
						<sourceInclude>**/*.scala</sourceInclude>
						<sourceInclude>**/*.java</sourceInclude>
					</sourceIncludes>
				</configuration>
			</plugin>

			<!-- Adding scala source directories to build path -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<!-- Add src/main/scala to eclipse build path -->
					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/main/scala</source>
							</sources>
						</configuration>
					</execution>
					<!-- Add src/test/scala to eclipse build path -->
					<execution>
						<id>add-test-source</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/test/scala</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>

347
			<!-- Scala Code Style, most of the configuration done via plugin management -->
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366
			<plugin>
				<groupId>org.scalastyle</groupId>
				<artifactId>scalastyle-maven-plugin</artifactId>
				<configuration>
					<configLocation>${project.basedir}/../tools/maven/scalastyle-config.xml</configLocation>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>test-jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
367

368 369 370 371 372 373 374 375 376 377 378 379 380 381
			<!--
			Copy batch and streaming examples programs in to the flink-yarn-tests/target/programs
			directory to be run during YARN integration tests.
			-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>copy</goal>
						</goals>
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>org.apache.flink</groupId>
									<artifactId>flink-examples-batch_${scala.binary.version}</artifactId>
									<type>jar</type>
									<classifier>WordCount</classifier>
									<overWrite>true</overWrite>
									<destFileName>BatchWordCount.jar</destFileName>
								</artifactItem>
								<artifactItem>
									<groupId>org.apache.flink</groupId>
									<artifactId>flink-examples-streaming_${scala.binary.version}</artifactId>
									<type>jar</type>
									<classifier>WordCount</classifier>
									<overWrite>true</overWrite>
									<destFileName>StreamingWordCount.jar</destFileName>
								</artifactItem>
								<artifactItem>
									<groupId>org.apache.flink</groupId>
									<artifactId>flink-examples-streaming_${scala.binary.version}</artifactId>
									<type>jar</type>
									<classifier>WindowJoin</classifier>
									<overWrite>true</overWrite>
									<destFileName>WindowJoin.jar</destFileName>
								</artifactItem>
							</artifactItems>
							<outputDirectory>${project.build.directory}/programs</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteSnapshots>true</overWriteSnapshots>
						</configuration>
					</execution>
					<!-- Write classpath of flink-yarn to a file, so that the yarn tests can use it as their classpath
						for the YARN "containers".
					-->
					<execution>
						<id>store-classpath-in-target-for-tests</id>
						<phase>package</phase>
						<goals>
							<goal>build-classpath</goal>
						</goals>
						<configuration>
							<outputFile>${project.build.directory}/yarn.classpath</outputFile>
							<excludeGroupIds>org.apache.flink</excludeGroupIds>
						</configuration>
427 428 429
					</execution>
				</executions>
			</plugin>
430 431 432
		</plugins>
	</build>
</project>