Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

defaultConfiguration and defaultConfigurationMappings settings are no-ops? #421

Closed
mtye opened this Issue · 1 comment

2 participants

@mtye

I'm using sbt 0.11.2 to build and publish a library that will be a dependency for projects built with with a legacy Ant/Ivy build framework. To play nicely with the downstream consumers of this library, it needs to be published with a few custom Ivy configurations (one of which should be the default for the module's publications) and a default configuration mapping.

I was able to add the custom configurations to the delivered ivy.xml by adding this to my build.sbt file:

ivyConfigurations ++= {
  val master = config("master") 
  val default = config("default") extend (Configurations.Runtime, master)
  Seq(master, default)
}

However, setting the default configuration and default configuration mapping had no effect:

defaultConfiguration in GlobalScope <<= ivyConfigurations{ _.find(_.name == "default") }

defaultConfigurationMapping in GlobalScope := "compile->default;runtime->default;test->default;provided->default"

I was able to verify via the sbt console that the settings had the desired values, but in the delivered ivy.xml, there was no defaultconf attribute on the publications element, and no defaultconfmapping attribute on the dependencies element.

I poked around in the 0.11.2 version of the source code, and it looks like the defaultConfiguration setting has no influence on how the module is delivered or published, and the defaultConfigurationMapping setting is not used at all. This seems misleading. So I'm proposing two things:

  • If the defaultConfiguration setting actually corresponds to the defaultconf attribute on either the Ivy conf or dependencies element rather than the publications element, this should be made explicit in the SettingKey 's description, and

  • If the defaultConfigurationMapping setting doesn't actually do anything, it should be removed from codebase entirely.

Of course, if you can make the setting actually do what I need them to do, that would be even better. ;)

@harrah
Owner

defaultConfiguration is only used for parsing ivyXML, the inline Ivy file XML, and it looks like you are right about defaultConfigurationMapping. A patch to improve the situation is welcome- it is unlikely I will get to this soon.

@harrah harrah closed this in 4795799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.