pom.xml 9.0 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>
26
		<version>1.4-SNAPSHOT</version>
27 28 29
		<relativePath>..</relativePath>
	</parent>
	
30
	<artifactId>flink-mesos_${scala.binary.version}</artifactId>
31 32 33
	<name>flink-mesos</name>
	<packaging>jar</packaging>
	
34 35 36 37 38 39 40 41 42
	<properties>
		<mesos.version>1.0.1</mesos.version>
	</properties>

	<dependencies>

		<!--  set all Flink dependencies to provided, so they and their transitive  -->
		<!-- dependencies do not get promoted to direct dependencies during shading -->
		
43 44
		<dependency>
			<groupId>org.apache.flink</groupId>
45
			<artifactId>flink-runtime_${scala.binary.version}</artifactId>
46
			<version>${project.version}</version>
47
			<scope>provided</scope>
48 49 50 51
		</dependency>
		
		<dependency>
			<groupId>org.apache.flink</groupId>
52
			<artifactId>flink-clients_${scala.binary.version}</artifactId>
53
			<version>${project.version}</version>
54
			<scope>provided</scope>
55 56 57 58
		</dependency>

		<dependency>
			<groupId>org.apache.flink</groupId>
59
			<artifactId>flink-shaded-curator-recipes</artifactId>
60
			<version>${project.version}</version>
61
			<scope>provided</scope>
62 63 64
		</dependency>

		<dependency>
65 66
			<groupId>com.typesafe.akka</groupId>
			<artifactId>akka-actor_${scala.binary.version}</artifactId>
67
			<scope>provided</scope>
68 69 70
		</dependency>

		<dependency>
71 72
			<groupId>com.typesafe.akka</groupId>
			<artifactId>akka-remote_${scala.binary.version}</artifactId>
73
			<scope>provided</scope>
W
wrighe3 已提交
74
			<exclusions>
75
				<!-- exclude the lower/wrong version of Protobuf here -->
W
wrighe3 已提交
76 77 78 79 80
				<exclusion>
					<groupId>com.google.protobuf</groupId>
					<artifactId>protobuf-java</artifactId>
				</exclusion>
			</exclusions>
81 82 83
		</dependency>

		<dependency>
84 85
			<groupId>com.typesafe.akka</groupId>
			<artifactId>akka-slf4j_${scala.binary.version}</artifactId>
86
			<scope>provided</scope>
87 88
		</dependency>

89 90
		<!-- Mesos and Mesos Resource Manager dependencies -->

91 92 93 94 95 96 97 98 99 100
		<dependency>
			<groupId>org.apache.mesos</groupId>
			<artifactId>mesos</artifactId>
			<version>${mesos.version}</version>
		</dependency>

		<dependency>
			<groupId>com.netflix.fenzo</groupId>
			<artifactId>fenzo-core</artifactId>
			<version>0.9.3</version>
W
wrighe3 已提交
101 102 103 104 105 106 107
			<exclusions>
				<!-- exclude mesos here to override -->
				<exclusion>
					<groupId>org.apache.mesos</groupId>
					<artifactId>mesos</artifactId>
				</exclusion>
			</exclusions>
108 109 110
		</dependency>

		<dependency>
111 112
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-shaded-netty</artifactId>
113 114 115 116 117 118 119 120 121 122
		</dependency>

		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
		</dependency>

		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
123 124 125 126 127 128 129 130 131 132
		</dependency>

		<!-- test dependencies -->

		<dependency>
			<groupId>org.scalatest</groupId>
			<artifactId>scalatest_${scala.binary.version}</artifactId>
			<scope>test</scope>
		</dependency>

133 134 135 136 137 138 139 140
		<dependency>
			<groupId>org.apache.curator</groupId>
			<artifactId>curator-test</artifactId>
			<version>${curator.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
141 142
			<groupId>com.typesafe.akka</groupId>
			<artifactId>akka-testkit_${scala.binary.version}</artifactId>
143 144 145
			<scope>test</scope>
		</dependency>

146 147
		<dependency>
			<groupId>org.apache.flink</groupId>
148
			<artifactId>flink-runtime_${scala.binary.version}</artifactId>
149 150 151 152 153
			<version>${project.version}</version>
			<scope>test</scope>
			<type>test-jar</type>
		</dependency>

154 155
		<dependency>
			<groupId>org.apache.flink</groupId>
156
			<artifactId>flink-test-utils_${scala.binary.version}</artifactId>
157 158 159 160 161
			<version>${project.version}</version>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>

162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 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
	</dependencies>

	<build>
		<plugins>
			<!-- 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>

			<!-- Scala Code Style, most of the configuration done via plugin management -->
			<plugin>
				<groupId>org.scalastyle</groupId>
				<artifactId>scalastyle-maven-plugin</artifactId>
				<configuration>
					<configLocation>${project.basedir}/../tools/maven/scalastyle-config.xml</configLocation>
				</configuration>
			</plugin>

272 273 274
			<!-- Relocate Mesos Protobuf dependency. Mesos 1.0.1 requires Protobuf 2.6.1 whereas
			 Flakka pulls in Protobuf 2.5.0. It might be feasible to set Protobuf to version 2.6.1,
			 but we shade to be on the safe side. -->
275 276 277 278 279 280 281 282 283 284 285
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<executions>
					<execution>
						<id>shade-flink</id>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
W
wrighe3 已提交
286
							<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
287 288
							<artifactSet>
								<includes combine.children="append">
W
wrighe3 已提交
289
									<include>com.google.protobuf:*</include>
W
wrighe3 已提交
290
									<include>org.apache.mesos:*</include>
291 292
								</includes>
							</artifactSet>
293
							<relocations combine.children="append">
294
								<relocation>
295 296
									<pattern>com.google.protobuf</pattern>
									<shadedPattern>org.apache.flink.mesos.shaded.com.google.protobuf</shadedPattern>
297 298 299 300 301 302 303 304 305
								</relocation>
							</relocations>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>