Skip to content

Maven compatibility changes (intransitive warnings and "configuration not public")#2345

Merged
eed3si9n merged 5 commits intosbt:0.13from
eed3si9n:wip/testtest
Jan 1, 2016
Merged

Maven compatibility changes (intransitive warnings and "configuration not public")#2345
eed3si9n merged 5 commits intosbt:0.13from
eed3si9n:wip/testtest

Conversation

@eed3si9n
Copy link
Member

intransitive warning

Made a minor improvement on @jsuereth's #2127, and split the handling to its own object called CompatibilityWarning. This is now invoked during update rather waiting till makePom, which might be too late.

"configuration not public": Adds withInterProjectFirst()

Fixes #1827.

withInterProjectFirst() option when set to true will prioritize inter-project resolver over all other resolvers and the Ivy cache. This is aimed to workaround the fact that on Maven, Test configuration is considered private, and thus project dependency with test->test configuration may not under some condition: The condition is when someone resolves x:y:1.0 and you have a subproject named and versioned exactly that, and some other subproject tries to depend on it. (182374c)
This does happen when a project publishes to Maven and then someone grabs the code from Github, which is the case for twitter-util. I've run into this myself during sbt modularization, and apparently it happens with spark development too.

/review @dwijnand, @Duhemm, @jsuereth

withInterProjectFirst when set to true will prioritize inter-project
resolver over all other resolver and Ivy cache.
This aimed to workaround the fact that on Maven Test configuration is
considered private, and thus project dependency with `test->test`
configuration may not under some condition. The condition is when
someone resolves `x:y:1.0` and you have a subproject named and
versioned exactly that, and some other subproject tries to depend on
it. This happens when the project does not change the version number on
the Github.
@eed3si9n eed3si9n added this to the 0.13.10 milestone Dec 31, 2015
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we try and make a reference to the fact that this is dependant on publishMavenStyle (as it is in the notes)?

I'm just not sure if "but Maven repositories" is sufficient to understand that this is because publishMavenStyle is set to true.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can fix that.

@dwijnand
Copy link
Member

A wombo combo double bugfix PR, nice!

Can I exploit this PR to ask, how come we have some settings that aren't that - settings, but rather withInterProjectFirst or withLatestSnapshots?

1 minor logging comment, other than that LGTM!

@eed3si9n
Copy link
Member Author

eed3si9n commented Jan 1, 2016

Can I exploit this PR to ask, how come we have some settings that aren't that - settings, but rather withInterProjectFirst or withLatestSnapshots?

That's a good question. I first saw these flags for name hashing https://github.com/sbt/sbt/blob/0.13/compile/inc/src/main/scala/sbt/inc/IncOptions.scala#L138-L141 withNameHashing() and I think these are sort of meant as implementation detail of sbt itself rather than describing the build, and perhaps eventually turned on/off by default (and/or go away). For example, name hashing will be the only mechanism to do incremental compilation soon.

@huitseeker
Copy link

Kudos: tested on an sbt build of spark, which exhibits this problem through sbt-pomreader. This fixes it ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants