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

Support multiple scala versions #207

Closed
hayssams opened this issue Jun 23, 2021 · 2 comments
Closed

Support multiple scala versions #207

hayssams opened this issue Jun 23, 2021 · 2 comments
Labels
api: pubsublite Issues related to the googleapis/java-pubsublite-spark API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@hayssams
Copy link

In the pom.xml file,
the dependency to scala-java8-compat is explicitly set to scala-java8-compat_2.11 which makes this library dependent on scala 2.11 even if Spark is set as provided in that same file.

I see 3 options:

Option 1: Do not use scala-java8-compat

What's the alternative then ?

Option 2: set scala version in the dependency name

Replace <artifactId>scala-java8-compat_2.11</artifactId> by <artifactId>scala-java8-compat_${scala.version.short}</artifactId> and set it as provided, requiring the user to add the dependency to the right (scala) version of scala-java8-compat

I currently recompile your code locally with the pom.xml updated as follows:

<dependency>
      <groupId>org.scala-lang.modules</groupId>
      <artifactId>scala-java8-compat_${scala.version.short}</artifactId>
      <version>1.0.0</version>
      <scope>provided</scope>
</dependency>

Option 3: cross compile this library to multiple scala versions

This would require to upgrade upgrade the build section to something similar to https://davidb.github.io/scala-maven-plugin/example_java.html

My preference goes to Option 2. Let me know if you would accept such a PR.

@product-auto-label product-auto-label bot added the api: pubsublite Issues related to the googleapis/java-pubsublite-spark API. label Jun 23, 2021
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Jun 24, 2021
@jiangmichaellll
Copy link
Contributor

Hi Hayssam,

Thanks for bringing this up! Option 2 makes sense to me, I created #209 for this.

Thanks,
Michael

@jiangmichaellll
Copy link
Contributor

#209 is checked in and will be in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsublite Issues related to the googleapis/java-pubsublite-spark API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants