julienrf / play-jsmessages

Library to compute localized messages of your Play application on client side

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dependency range on Play too wide

manuelbernhardt opened this issue · comments

The dependency declaration on the Play version seems to be too wide, given that it results in a project using play-jsmessages to now fetch the latest Play release / snapshot, which has a different module structure (for example, the WS library needs now to be fetched separately).

I would suggest that the plugin limits itself on a range in the same major Play version (2.2, 2.3, ...) because changes in API and module structure are less likely to happen.

A workaround now is:

"com.github.julienrf"         %% "play-jsmessages"          % "1.5.1"    exclude ("com.typesafe.play", "play_2.10")

Hi, thanks for reporting, I changed the build to restrict the revision number to 2.2.x.

I believe the change should be to use: [2.2,2.3[ instead of [2.2.0,2.3[

I am currently using Play 2.2.3 and it's also pulling down 2.2.0 play jars.

Hi, did you try with [2.2,2.3[?

A workaround consists in excluding the jsmessages transitive dependency on
play.

I'd recommend against the version range in general. Better to use conflict resolvers and lock down on the version you built against, so you force users to the latest version. I'm not 100% on whether there is forward + backwards compatibility in the play series.

Ok, thanks for your advice. What happens if I set that jsmessages depends on Play 2.3.0 and that one wants to use 2.3.1? Will he get two artifacts in his classpath? What happens in the opposite situation? (i.e. I set that jsmessages depends on 2.3.1 and one uses 2.3.0)

@julienrf That's how every other project works. Ivy has a default 'conflict resolver'. Naturally, Ivy will take the more recent version. You can override that. There's also 'strict' which would issue a warning.

The reality is that having a version range can slow down resolution as ivy tries to find ALL versions, rather than looking for a specific (default one). Version conflicts is a separate aspect of ivy.