pom.xml 11.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>
A
Aljoscha Krettek 已提交
26
		<version>1.5-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_${scala.binary.version}</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-shaded-jackson</artifactId>
			<scope>test</scope>
		</dependency>
49
		
50 51
		<dependency>
			<groupId>org.apache.flink</groupId>
52
			<artifactId>flink-test-utils_${scala.binary.version}</artifactId>
53
			<version>${project.version}</version>
54
			<scope>test</scope>
55 56
		</dependency>

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

65 66 67
		<!-- Needed for the streaming wordcount example -->
		<dependency>
			<groupId>org.apache.flink</groupId>
68
			<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
69
			<version>${project.version}</version>
70
			<scope>test</scope>
71 72
		</dependency>

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

80 81
		<dependency>
			<groupId>org.apache.flink</groupId>
82
			<artifactId>flink-yarn_${scala.binary.version}</artifactId>
83 84 85 86 87
			<version>${project.version}</version>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>

88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
		<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>

106
		<dependency>
107
			<groupId>org.apache.flink</groupId>
108
			<artifactId>flink-shaded-hadoop2</artifactId>
109
			<version>${project.version}</version>
110
			<scope>test</scope>
111 112 113
		</dependency>

		<dependency>
114
			<groupId>org.apache.flink</groupId>
115
			<artifactId>flink-shaded-yarn-tests</artifactId>
116 117 118 119 120 121 122
			<version>${project.version}</version>
			<exclusions>
				<exclusion>
					<groupId>asm</groupId>
					<artifactId>asm</artifactId>
				</exclusion>
			</exclusions>
123
		</dependency>
124
		
125
		<dependency>
126 127
			<groupId>com.typesafe.akka</groupId>
			<artifactId>akka-testkit_${scala.binary.version}</artifactId>
128
			<scope>test</scope>
129
		</dependency>
130 131 132 133 134 135 136

		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-minikdc</artifactId>
			<version>${minikdc.version}</version>
		</dependency>

137 138 139 140 141 142 143 144 145
	</dependencies>

	<build>
		<plugins>
			<!-- Set the root directory for all tests to the project root.
			We need this to be able to locate the final build (in flink-dist)
			-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
146
				<artifactId>maven-surefire-plugin</artifactId>
147 148 149 150 151 152 153 154 155 156
				<executions>
					<execution>
						<id>integration-tests</id>
						<configuration>
							<!-- Enforce single threaded execution due to port conflicts with the mini yarn cluster -->
							<forkCount>1</forkCount>
							<workingDirectory>../</workingDirectory>
						</configuration>
					</execution>
				</executions>
157
			</plugin>
158

159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<executions>
					<execution>
						<id>shade-hadoop</id>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<shadedArtifactAttached>false</shadedArtifactAttached>
							<createDependencyReducedPom>true</createDependencyReducedPom>
							<dependencyReducedPomLocation>${project.basedir}/target/dependency-reduced-pom.xml</dependencyReducedPomLocation>
							<filters>
								<filter>
									<artifact>org.slf4j:*</artifact>
									<excludes>
										<exclude>org/slf4j/impl/StaticLoggerBinder*</exclude>
									</excludes>
								</filter>
							</filters>
							<transformers>
								<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
183
								<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"/>
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
							</transformers>
							<relocations>
								<relocation>
									<pattern>com.google</pattern>
									<shadedPattern>org.apache.flink.hadoop.shaded.com.google</shadedPattern>
									<excludes>
										<exclude>com.google.inject.**</exclude>
									</excludes>
								</relocation>
								<relocation>
									<pattern>org.objectweb.asm</pattern>
									<shadedPattern>org.apache.flink.hadoop.shaded.org.objectweb.asm</shadedPattern>
								</relocation>
								<relocation>
									<pattern>org.jboss.netty</pattern>
									<shadedPattern>org.apache.flink.hadoop.shaded.org.jboss.netty</shadedPattern>
								</relocation>
							</relocations>
						</configuration>
					</execution>
				</executions>
			</plugin>

207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 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
			<!-- 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>
				<version>1.7</version>
				<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>

304
			<!-- Scala Code Style, most of the configuration done via plugin management -->
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
			<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>
324 325 326 327 328 329 330
			<plugin>
				<groupId>com.github.siom79.japicmp</groupId>
				<artifactId>japicmp-maven-plugin</artifactId>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>
331 332 333 334 335 336 337 338 339 340 341 342

			<!--
            https://issues.apache.org/jira/browse/DIRSHARED-134
            Required to pull the Mini-KDC transitive dependency
            -->
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>3.0.1</version>
				<inherited>true</inherited>
				<extensions>true</extensions>
			</plugin>
343

344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384
			<!--
			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>
				<version>3.0.1</version>
				<executions>
					<execution>
						<id>copy</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>copy</goal>
						</goals>
					</execution>
				</executions>
				<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>
					</artifactItems>
					<outputDirectory>${project.build.directory}/programs</outputDirectory>
					<overWriteReleases>false</overWriteReleases>
					<overWriteSnapshots>true</overWriteSnapshots>
				</configuration>
			</plugin>
385 386 387
		</plugins>
	</build>
</project>