Skip to content

Expand properties found in maven settings #413

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

Merged
merged 1 commit into from
Apr 9, 2023

Conversation

nrinaudo
Copy link
Contributor

@nrinaudo nrinaudo commented Apr 9, 2023

Fixes sbt/sbt#7195

@@ -391,6 +391,17 @@ private[librarymanagement] abstract class ResolverFunctions {
def defaultRetrievePattern =
"[type]s/[organisation]/[module]/" + PluginPattern + "[artifact](-[revision])(-[classifier]).[ext]"
final val PluginPattern = "(scala_[scalaVersion]/)(sbt_[sbtVersion]/)"
private[librarymanagement] def expandMavenSettings(str: String): String = {
Copy link
Contributor Author

@nrinaudo nrinaudo Apr 9, 2023

Choose a reason for hiding this comment

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

Rather than scoping that to mavenLocalDir, I exposed it for testing purposes. Happy to backpedal on that, it doesn't seem to be the usual coding style of this project, but I felt tests would be useful for anything that involves regular expressions.

import scala.annotation.nowarn

@nowarn // Necessary because our test cases look like interpolated strings.
object ResolverExtraTest extends BasicTestSuite {
Copy link
Contributor Author

@nrinaudo nrinaudo Apr 9, 2023

Choose a reason for hiding this comment

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

One weirdness that I haven't had the courage to look into: this was initially a UnitSpec, like ResolverTest, but tests didn't get executed.

Not sure whether this is a bug or working as intended, so I didn't change it. Note that ResolverTest isn't getting executed, at least on my local setup.

It would probably be good to either document or fix this, depending on whether it's desired or a bug, as it's quite easy to write tests that fail but aren't executed, and think your tests pass. Happy to help with this once the situation is clarified.

Copy link
Member

Choose a reason for hiding this comment

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

Not sure what it could be. Maybe it's due the fact that some are ScalaTest that uses class and others are verify that uses object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Honestly not a clue. There's a verify runner explicitly registered in the build, which I initially thought might override existing ones, but I see that some ScalaTest tests are being executed so... very confused.

@nrinaudo
Copy link
Contributor Author

nrinaudo commented Apr 9, 2023

As a first time contributor, I was rather confused at first - semanticdb wouldn't resolve, and I had to pretend to be running my builds in a CI environment via the following in build.sbt:

Global / semanticdbEnabled := false

This seems either undesirable or in need of documentation, as it adds unnecessary friction to the experience.

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for the contribution!

@eed3si9n eed3si9n merged commit 48dc7b2 into sbt:develop Apr 9, 2023
@nrinaudo nrinaudo deleted the 7195-maven-settings branch April 9, 2023 17:28
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.

Non-compliant parsing of maven's settings.xml file
2 participants