PomExtraDependencyAttributes

sbt.internal.librarymanagement.mavenint.PomExtraDependencyAttributes

This class contains all the logic for dealing with the extra attributes in pom files relating to extra attributes on dependency declarations.

Specifically, if we have a dependency on an sbt plugin, there are two properties that need to propogate:

  • sbtVersion
  • scalaVersion

These need to exist on the dependency declaration. Maven/Aether has no way to inject these into the section of pom files, so we use Ivy's Extra attribute hackery to inject a lookup table of extra attributes by dependency id into POM files and later we read these back.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def filterCustomExtra(item: ExtendableItem, include: Boolean): Map[String, String]
def getDependencyExtra(m: Map[String, String]): Map[ModuleRevisionId, Map[String, String]]

Reads the extra dependency information out of Ivy's notion of POM properties and returns the map of ID -> Extra Properties.

Reads the extra dependency information out of Ivy's notion of POM properties and returns the map of ID -> Extra Properties.

Attributes

def qualifiedExtra(item: ExtendableItem): Map[String, String]
def qualifiedIsExtra(k: String): Boolean
def readDependencyExtra(s: String): Seq[ModuleRevisionId]

parses the sequence of dependencies with extra attribute information, with one dependency per line

parses the sequence of dependencies with extra attribute information, with one dependency per line

Attributes

def readFromAether(props: Map[String, AnyRef]): Map[ModuleRevisionId, Map[String, String]]

Reads the extra dependency attributes out of a maven property.

Reads the extra dependency attributes out of a maven property.

Value parameters

props

The properties from an Aether resolution.

Attributes

Returns

A map of module id to extra dependency attributes associated with dependencies on that module.

def simplify(id: ModuleRevisionId): ModuleRevisionId
def transferDependencyExtraAttributes(from: Properties, to: Map[String, AnyRef]): Unit

Mutates the to collection with the extra depdendency attributes from the incoming pom properties list.

Mutates the to collection with the extra depdendency attributes from the incoming pom properties list.

Value parameters

from

The properties directly off a maven POM file

to

The aaether properties where we can write whatever we want. TODO - maybe we can just parse this directly here. Note the readFromAether method uses whatever we set here.

Attributes

def writeDependencyExtra(s: Seq[DependencyDescriptor]): Seq[String]

Creates the "extra" property values for DependencyDescriptors that can be written into a maven pom so we don't loose the information.

Creates the "extra" property values for DependencyDescriptors that can be written into a maven pom so we don't loose the information.

Attributes

Concrete fields

val ExtraAttributesKey: String
val SbtVersionKey: String
val ScalaVersionKey: String