Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ private[spark] object MavenUtils extends Logging {
}

/* Set ivy settings for location of cache, if option is supplied */
private def processIvyPathArg(ivySettings: IvySettings, ivyPath: Option[String]): Unit = {
private[util] def processIvyPathArg(ivySettings: IvySettings, ivyPath: Option[String]): Unit = {
val alternateIvyDir = ivyPath.filterNot(_.trim.isEmpty).getOrElse {
// To protect old Ivy-based systems like old Spark from Apache Ivy 2.5.2's incompatibility.
System.getProperty("ivy.home",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ private[spark] object IvyTestUtils {
useIvyLayout: Boolean = false,
withPython: Boolean = false,
withR: Boolean = false,
ivySettings: IvySettings = new IvySettings)(f: String => Unit): Unit = {
ivySettings: IvySettings = defaultIvySettings())(f: String => Unit): Unit = {
val deps = dependencies.map(MavenUtils.extractMavenCoordinates)
purgeLocalIvyCache(artifact, deps, ivySettings)
val repo = createLocalRepositoryForTests(artifact, dependencies, rootDir, useIvyLayout,
Expand Down Expand Up @@ -401,4 +401,16 @@ private[spark] object IvyTestUtils {
}
}
}

/**
* Creates and initializes a new instance of IvySettings with default configurations.
* The method processes the Ivy path argument using MavenUtils to ensure proper setup.
*
* @return A newly created and configured instance of IvySettings.
*/
private def defaultIvySettings(): IvySettings = {
val settings = new IvySettings
MavenUtils.processIvyPathArg(ivySettings = settings, ivyPath = None)
settings
}
}