Skip to content

Consider scala patch version for scalac-scoverage-plugin #95

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
Jan 22, 2022

Conversation

chetanmeh
Copy link
Contributor

@chetanmeh chetanmeh commented Aug 4, 2021

This PR implements the approach proposed in #94 . Post this it would be possible to use the maven plugin with Scala 2.12.13+

With this PR now plugin artifact lookup logic is done like below

1 First look for artifact having name like scalac-scoverage-plugin_2.12.14 i.e. use the full version of Scala lib used in project
2 If that artifact is not found look for scalac-scoverage-plugin_2.12

For this to work completely you still need to specify the scalacPluginVersion property. For example with Scala 2.12.14 we need version scalac-scoverage-plugin - 1.4.8

Fixes #94

result =
getResolvedArtifact( "org.scoverage", "scalac-scoverage-plugin_" + resolvedScalaVersion,
resolvedScalacPluginVersion );
} catch (ArtifactNotFoundException e)

Choose a reason for hiding this comment

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

If an exception were thrown from both the above try-block the below catch-block caught, then the error message will only report not finding the scalaMainVersion (rather than both the scalaMainVersion and resolvedScalaVersion).

(I could be wrong though. Even if my comment is correct I don't whether a slightly inaccurate error message would be considered a good reason to block the pull request.)

Copy link

@stewartHutchins stewartHutchins left a comment

Choose a reason for hiding this comment

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

Baring my comment (which may not be a blocking issue) these change seem reasonable.

However, I'm not really familiar with the codebase or the community, so I'm not sure I'd be comfortable pressing approve (I assume there's some additional permissions I'd need to get before pressing approve anyway - however can't say for sure, as I'm not familiar with PRs on github either).

@marcoy
Copy link

marcoy commented Nov 4, 2021

At work, we just encountered this issue. We have to downgrade Scala in our projects which isn't ideal. It'd be great to have support for specifying the patch version.

@jozic
Copy link
Collaborator

jozic commented Nov 16, 2021

@ckipp01
is this something you can review/merge?
pretty please )

@ckipp01
Copy link
Member

ckipp01 commented Nov 16, 2021

@ckipp01 is this something you can review/merge? pretty please )

Hey @jozic, for sure. Let me merge in the CI changes to github actions and I'll see if I can get this across the board. I'd like to get the CI updated and in place to actually ensure the tests are running correctly.

EDIT: I see the that new CI is failing. It will greatly speed all this up if someone is willing to get the CI figured out and ✅

@sumeetgajjar
Copy link
Contributor

Thanks @chetanmeh for creating the PR. We are facing a similar issue mentioned in #94. And this PR resolves the issue.

However, your branch looks old, could you please rebase your change on top of the latest master?
Your branch is still pointing to CircleCI which was replaced with GitHub actions in 463b309 commit.

@gslowikowski
Copy link
Member

Sorry for long delay. I will prepare new release soon.

gslowikowski added a commit that referenced this pull request Jan 22, 2022
Continuation of work done in #95
gslowikowski added a commit that referenced this pull request Jan 22, 2022
Continuation of work done in #95
@pgruetter
Copy link

Is there any workaround for this until the new release is out? Facing the same problem with scoverage-maven-plugin 1.4.1 throwing the error mentioned in post 1. If I'm correct, we would need to use a scalacPluginVersion 1.4.8. which we can't specify at the moment.

@gslowikowski
Copy link
Member

Added an information in the logs suggested by @stewartHutchins in the comment above. To check it, build this sample project. There will be:

[WARNING] Artifact "org.scoverage:scalac-scoverage-plugin_2.10.7:1.4.1" not found, falling back to "org.scoverage:scalac-scoverage-plugin_2.10:1.4.1"

message logged.

@gslowikowski
Copy link
Member

Version 1.4.11 released.

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.

Consider using Scala's patch version to determine the artifactId of the scalac-scoverage-plugin
8 participants