Skip to content

Commit 97e4459

Browse files
srowenpwendell
authored andcommitted
SPARK-1254. Consolidate, order, and harmonize repository declarations in Maven/SBT builds
This suggestion addresses a few minor suboptimalities with how repositories are handled. 1) Use HTTPS consistently to access repos, instead of HTTP 2) Consolidate repository declarations in the parent POM file, in the case of the Maven build, so that their ordering can be controlled to put the fully optional Cloudera repo at the end, after required repos. (This was prompted by the untimely failure of the Cloudera repo this week, which made the Spark build fail. #2 would have prevented that.) 3) Update SBT build to match Maven build in this regard 4) Update SBT build to not refer to Sonatype snapshot repos. This wasn't in Maven, and a build generally would not refer to external snapshots, but I'm not 100% sure on this one. Author: Sean Owen <[email protected]> Closes #145 from srowen/SPARK-1254 and squashes the following commits: 42f9bfc [Sean Owen] Use HTTPS for repos; consolidate repos in parent in order to put optional Cloudera repo last; harmonize SBT build repos with Maven; remove snapshot repos from SBT build which weren't in Maven
1 parent e19044c commit 97e4459

File tree

5 files changed

+42
-56
lines changed

5 files changed

+42
-56
lines changed

examples/pom.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,6 @@
4545
</profile>
4646
</profiles>
4747

48-
<repositories>
49-
<repository>
50-
<id>apache-repo</id>
51-
<name>Apache Repository</name>
52-
<url>https://repository.apache.org/content/repositories/releases</url>
53-
<releases>
54-
<enabled>true</enabled>
55-
</releases>
56-
<snapshots>
57-
<enabled>false</enabled>
58-
</snapshots>
59-
</repository>
60-
</repositories>
61-
62-
6348
<dependencies>
6449
<dependency>
6550
<groupId>org.apache.spark</groupId>

external/mqtt/pom.xml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,6 @@
4545
</profile>
4646
</profiles>
4747

48-
<repositories>
49-
<repository>
50-
<id>mqtt-repo</id>
51-
<name>MQTT Repository</name>
52-
<url>https://repo.eclipse.org/content/repositories/paho-releases</url>
53-
<releases>
54-
<enabled>true</enabled>
55-
</releases>
56-
<snapshots>
57-
<enabled>false</enabled>
58-
</snapshots>
59-
</repository>
60-
</repositories>
61-
6248
<dependencies>
6349
<dependency>
6450
<groupId>org.apache.spark</groupId>

pom.xml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,18 @@
127127
<repository>
128128
<id>maven-repo</id> <!-- This should be at top, it makes maven try the central repo first and then others and hence faster dep resolution -->
129129
<name>Maven Repository</name>
130-
<url>http://repo.maven.apache.org/maven2</url>
130+
<url>https://repo.maven.apache.org/maven2</url>
131+
<releases>
132+
<enabled>true</enabled>
133+
</releases>
134+
<snapshots>
135+
<enabled>false</enabled>
136+
</snapshots>
137+
</repository>
138+
<repository>
139+
<id>apache-repo</id>
140+
<name>Apache Repository</name>
141+
<url>https://repository.apache.org/content/repositories/releases</url>
131142
<releases>
132143
<enabled>true</enabled>
133144
</releases>
@@ -138,7 +149,18 @@
138149
<repository>
139150
<id>jboss-repo</id>
140151
<name>JBoss Repository</name>
141-
<url>http://repository.jboss.org/nexus/content/repositories/releases</url>
152+
<url>https://repository.jboss.org/nexus/content/repositories/releases</url>
153+
<releases>
154+
<enabled>true</enabled>
155+
</releases>
156+
<snapshots>
157+
<enabled>false</enabled>
158+
</snapshots>
159+
</repository>
160+
<repository>
161+
<id>mqtt-repo</id>
162+
<name>MQTT Repository</name>
163+
<url>https://repo.eclipse.org/content/repositories/paho-releases</url>
142164
<releases>
143165
<enabled>true</enabled>
144166
</releases>
@@ -150,6 +172,12 @@
150172
<id>cloudera-repo</id>
151173
<name>Cloudera Repository</name>
152174
<url>https://repository.cloudera.com/artifactory/cloudera-repos</url>
175+
<releases>
176+
<enabled>true</enabled>
177+
</releases>
178+
<snapshots>
179+
<enabled>false</enabled>
180+
</snapshots>
153181
</repository>
154182
</repositories>
155183

project/SparkBuild.scala

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,18 @@ object SparkBuild extends Build {
174174
// Only allow one test at a time, even across projects, since they run in the same JVM
175175
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
176176

177-
// also check the local Maven repository ~/.m2
178-
resolvers ++= Seq(Resolver.file("Local Maven Repo", file(Path.userHome + "/.m2/repository"))),
179-
180-
// For Sonatype publishing
181-
resolvers ++= Seq("sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
182-
"sonatype-staging" at "https://oss.sonatype.org/service/local/staging/deploy/maven2/"),
177+
resolvers ++= Seq(
178+
"Maven Repository" at "https://repo.maven.apache.org/maven2",
179+
"Apache Repository" at "https://repository.apache.org/content/repositories/releases",
180+
"JBoss Repository" at "https://repository.jboss.org/nexus/content/repositories/releases/",
181+
"MQTT Repository" at "https://repo.eclipse.org/content/repositories/paho-releases/",
182+
"Cloudera Repository" at "https://repository.cloudera.com/artifactory/cloudera-repos/",
183+
// For Sonatype publishing
184+
//"sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
185+
//"sonatype-staging" at "https://oss.sonatype.org/service/local/staging/deploy/maven2/",
186+
// also check the local Maven repository ~/.m2
187+
Resolver.mavenLocal
188+
),
183189

184190
publishMavenStyle := true,
185191

@@ -272,10 +278,6 @@ object SparkBuild extends Build {
272278

273279
def coreSettings = sharedSettings ++ Seq(
274280
name := "spark-core",
275-
resolvers ++= Seq(
276-
"JBoss Repository" at "http://repository.jboss.org/nexus/content/repositories/releases/",
277-
"Cloudera Repository" at "https://repository.cloudera.com/artifactory/cloudera-repos/"
278-
),
279281

280282
libraryDependencies ++= Seq(
281283
"com.google.guava" % "guava" % "14.0.1",
@@ -470,7 +472,6 @@ object SparkBuild extends Build {
470472

471473
def mqttSettings() = streamingSettings ++ Seq(
472474
name := "spark-streaming-mqtt",
473-
resolvers ++= Seq("Eclipse Repo" at "https://repo.eclipse.org/content/repositories/paho-releases/"),
474475
libraryDependencies ++= Seq("org.eclipse.paho" % "mqtt-client" % "0.4.0")
475476
)
476477
}

streaming/pom.xml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,6 @@
4545
</profile>
4646
</profiles>
4747

48-
<repositories>
49-
<repository>
50-
<id>apache-repo</id>
51-
<name>Apache Repository</name>
52-
<url>https://repository.apache.org/content/repositories/releases</url>
53-
<releases>
54-
<enabled>true</enabled>
55-
</releases>
56-
<snapshots>
57-
<enabled>false</enabled>
58-
</snapshots>
59-
</repository>
60-
</repositories>
61-
6248
<dependencies>
6349
<dependency>
6450
<groupId>org.apache.spark</groupId>

0 commit comments

Comments
 (0)