Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

"AttributeKey ID collisions" when referencing multiple projects #457

Closed
harrah opened this Issue · 1 comment

1 participant

@harrah
Owner

I'm working on converting a multi-module Ant project to sbt. The project consists of multiple infrastructure modules and several independent subprojects - specifically, four distinct web applications requiring separate artifacts. To maintain the ability to build the projects separately I've opted to give each of them its own Build.scala file, and add dependencies via ProjectRefs, for example:

    lazy val common = ProjectRef( file( "../common" ), "common" )
    lazy val worfklow = Project(
        "workflow",
        file( "." ),
        settings = buildSettings ++ Seq( libraryDependencies ++= dependencies )
    ) dependsOn( common )

The web projects requiring artifacts all depend on xsbt-web-plugin by adding webSettings and having a project/plugins.sbt:

libraryDependencies <+= sbtVersion(v => "com.github.siasia" %% "xsbt-web-plugin" % (v+"-0.2.11"))

To make them all available in a single project for the build server, I generated a master project and referenced the various modules:

    lazy val common           = ProjectRef( id = "common",            base = file( "common"            ) )
    lazy val workflow         = ProjectRef( id = "workflow",          base = file( "workflow"          ) )
    // ...
    lazy val root = Project( id = "myProject", base = file( "." ), settings = Defaults.defaultSettings ) aggregate( common, worfklow /* ... */ )

Whenever I load the master project, I end up with an error similar to:

[error] AttributeKey ID collisions detected for: 'deployment' (sbt.Task[com.github.siasia.Deployment], sbt.Task[com.github.siasia.Deployment], sbt.Task[com.github.siasia.Deployment], sbt.Task[com.github.siasia.Deployment]), 'apps' (sbt.Task[scala.collection.Seq[scala.Tuple2[java.lang.String, com.github.siasia.Deployment]]], sbt.Task[scala.collection.Seq[scala.Tuple2[java.lang.String, com.github.siasia.Deployment]]], sbt.Task[scala.collection.Seq[scala.Tuple2[java.lang.String, com.github.siasia.Deployment]]], sbt.Task[scala.collection.Seq[scala.Tuple2[java.lang.String, com.github.siasia.Deployment]]])

I first noticed it with 0.11.3 but I downgraded and tested on 0.11.2 with the same results. This leads me to believe this isn't a duplicate of #329, nor is it necessarily related to #448 as I initially suspected. I'm rather at a loss as to what's going on here...

@harrah
Owner

IMPORTANT This project has moved to https://github.com/sbt/sbt. This issue still exists to avoid dead links, but GitHub limitations prevent the original issue from being correctly preserved here. Please see sbt/sbt#457 for the full issue and to comment.

@harrah harrah closed this
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.