Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to find libraries with '.' in the group. #168

Closed
shawjef3 opened this issue Feb 21, 2017 · 8 comments · Fixed by #323
Closed

unable to find libraries with '.' in the group. #168

shawjef3 opened this issue Feb 21, 2017 · 8 comments · Fixed by #323
Assignees
Labels
Milestone

Comments

@shawjef3
Copy link

shawjef3 commented Feb 21, 2017

mimaPreviousArtifacts := Set("me.jeffshaw.harmony" %% "harmony_cats0.9.0_scalaz7.2" % "1.0")

gives

[warn] 	module not found: me.jeffshaw.harmony#harmony_cats0.9.0_scalaz7.2_2.12;1.0
[warn] ==== local: tried
[warn]   /Users/jshaw/.ivy2/local/me.jeffshaw.harmony/harmony_cats0.9.0_scalaz7.2_2.12/1.0/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/me/jeffshaw/harmony/harmony_cats0.9.0_scalaz7.2_2.12/1.0/harmony_cats0.9.0_scalaz7.2_2.12-1.0.pom
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	::          UNRESOLVED DEPENDENCIES         ::
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	:: me.jeffshaw.harmony#harmony_cats0.9.0_scalaz7.2_2.12;1.0: not found
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::

Changing it to the following fixes it. It appears to be maven name mangling.

mimaPreviousArtifacts := Set("me.jeffshaw.harmony" %% "harmony_cats0-9-0_scalaz7-2" % "1.0")
@xuwei-k
Copy link
Contributor

xuwei-k commented Feb 21, 2017

@shawjef3
Copy link
Author

The fact that I have to manually normalize the name makes this a bug somewhere. It's not expected that I do the same for libraryDependencies or other ModuleIDs.

@dwijnand
Copy link
Collaborator

You mean '.' in the artifactId (or "name" as Ivy calls it).

I agree it's a bug. Ideally one that would be fixed in sbt. But we could potentially workaround it in mima.

@dwijnand dwijnand added the bug label Feb 23, 2017
@shawjef3
Copy link
Author

shawjef3 commented Feb 23, 2017 via email

@alexarchambault
Copy link
Contributor

That breaks libraries that actually have a . in their name (like this one, published like this, or this one, published like this), and tweak moduleName to enforce it.

A way to circumvent that would be to disable cross-versioning, then manually add the right suffix in moduleName,

crossVersion := CrossVersion.disabled
moduleName := {
  val name0 = name.value
  CrossVersion(platformDepsCrossVersion.value, scalaVersion.value, scalaBinaryVersion.value).fold(name0)(_(name0))
}

but with 0.7.0, this gives

$ sbt
…
sbt:scalacheck-shapeless> mimaReportBinaryIssues
[info] downloading https://repo1.maven.org/maven2/com/github/alexarchambault/scalacheck-shapeless_1.14_2.12/1.2.5/scalacheck-shapeless_1.14_2.12-1.2.5.jar ...
[info] 	[SUCCESSFUL ] com.github.alexarchambault#scalacheck-shapeless_1.14_2.12;1.2.5!scalacheck-shapeless_1.14_2.12.jar (109ms)
[info] downloading https://repo1.maven.org/maven2/com/github/alexarchambault/scalacheck-shapeless_1.14_2.12/1.2.5/scalacheck-shapeless_1.14_2.12-1.2.5.pom ...
[info] 	[SUCCESSFUL ] com.github.alexarchambault#scalacheck-shapeless_1.14_2.12;1.2.5!scalacheck-shapeless_1.14_2.12.pom (18ms)
not a directory or jar file: /Users/alexandre/.ivy2/cache/com.github.alexarchambault/scalacheck-shapeless_1.14_sjs1_2.12/poms/scalacheck-shapeless_1.14_sjs1_2.12-1.2.5.pom
2020-05-28 10:21:55,845 shutdown-hooks-run-all ERROR No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2
$

(sbt abruptly exits, seems this calls System.exit!)

@alexarchambault
Copy link
Contributor

alexarchambault commented May 28, 2020

The workaround works with #508 though, I guess it should be the same with #509 when setting up coursier.

@alexarchambault
Copy link
Contributor

alexarchambault commented May 28, 2020

About the original issue here, things like this don't work:

scalaVersion := "2.12.11"
libraryDependencies += "me.jeffshaw.harmony" %% "harmony_cats0.9.0_scalaz7.2" % "1.0"

One has to do

scalaVersion := "2.12.11"
libraryDependencies += "me.jeffshaw.harmony" %% "harmony_cats0-9-0_scalaz7-2" % "1.0"

So I'm not sure there's a point in making

mimaPreviousArtifacts := Set("me.jeffshaw.harmony" %% "harmony_cats0.9.0_scalaz7.2" % "1.0")

work.

#323 should be reverted I think.

@alexarchambault
Copy link
Contributor

Same problem here.

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

Successfully merging a pull request may close this issue.

4 participants