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

relax plugin version verification rules #10

Closed
m50d opened this issue Feb 28, 2018 · 7 comments
Closed

relax plugin version verification rules #10

m50d opened this issue Feb 28, 2018 · 7 comments
Labels

Comments

@m50d
Copy link

m50d commented Feb 28, 2018

Trying to use scalor-maven-plugin on a project that uses kind-projector I got:

[ERROR] C:\Users\md401\eclipse-workspace\tierney-aggregator\core\pom.xml [1:1]: Execution failure
java.lang.RuntimeException: Version mismatch: FileItem(C:\Users\md401\.m2\repository\org\scala-lang\scala-compiler\2.12.4\scala-compiler-2.12.4.jar,2.12.4) vs FileItem(C:\Users\md401\.m2\repository\org\spire-math\kind-projector_2.12\0.9.4\kind-projector_2.12-0.9.4.jar,2.12)
    at com.carrotgarden.maven.scalor.zinc.Version$.versionFailure (Version.scala:31)
    at com.carrotgarden.maven.scalor.zinc.Version$.assertVersionExact (Version.scala:24)
    at com.carrotgarden.maven.scalor.zinc.Version$.$anonfun$assertVersion$1 (Version.scala:116)
    at com.carrotgarden.maven.scalor.zinc.Version$.$anonfun$assertVersion$1$adapted (Version.scala:114)
    at scala.collection.mutable.ArrayBuffer.foreach (ArrayBuffer.scala:48)
    at com.carrotgarden.maven.scalor.zinc.Version$.assertVersion (Version.scala:114)
    at com.carrotgarden.maven.scalor.zinc.Compiler$Context.<init> (Compiler.scala:242)
    at com.carrotgarden.maven.scalor.zinc.Compiler.zincPerformCompile (Compiler.scala:283)
    at com.carrotgarden.maven.scalor.zinc.Compiler.zincPerformCompile$ (Compiler.scala:282)
    at com.carrotgarden.maven.scalor.CompileMainMojo.zincPerformCompile (CompileMojo.scala:112)
    at com.carrotgarden.maven.scalor.CompileAnyMojo.performCompile (CompileMojo.scala:37)
    at com.carrotgarden.maven.scalor.CompileAnyMojo.performCompile$ (CompileMojo.scala:36)
    at com.carrotgarden.maven.scalor.CompileMainMojo.performCompile (CompileMojo.scala:112)
    at com.carrotgarden.maven.scalor.CompileAnyMojo.perform (CompileMojo.scala:45)
    at com.carrotgarden.maven.scalor.CompileAnyMojo.perform$ (CompileMojo.scala:40)
    at com.carrotgarden.maven.scalor.CompileMainMojo.perform (CompileMojo.scala:112)
    at com.carrotgarden.maven.scalor.base.Mojo.execute (Mojo.scala:65)
    at com.carrotgarden.maven.scalor.base.Mojo.execute$ (Mojo.scala:50)
    at com.carrotgarden.maven.scalor.CompileMainMojo.execute (CompileMojo.scala:112)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR] [compile-main] Execution failure: Version mismatch: FileItem(C:\Users\md401\.m2\repository\org\scala-lang\scala-compiler\2.12.4\scala-compiler-2.12.4.jar,2.12.4) vs FileItem(C:\Users\md401\.m2\repository\org\spire-math\kind-projector_2.12\0.9.4\kind-projector_2.12-0.9.4.jar,2.12)

I assume this is trying to fail-fast when one uses a plugin compiled for an incorrect version of Scala, but kind-projector built for 2.12 should be fine with Scala compiler 2.12.4. Is there any way to specify which versions should be treated as compatible or something on those lines?

@Andrei-Pozolotin
Copy link
Contributor

try

<zincVerifyVersion>false</zincVerifyVersion>

https://random-maven.github.io/scalor-maven-plugin/2.12/compile-main-mojo.html#zincVerifyVersion

@Andrei-Pozolotin Andrei-Pozolotin changed the title 2.12.4 versus 2.12 is a plugin version mismatch but shouldn't be? relax plugin version verification rules Feb 28, 2018
@m50d
Copy link
Author

m50d commented Mar 1, 2018

Thanks, my project builds with that.

A couple of small related questions (I'm happy to file separate issues if you prefer): 1. is it possible to pass a JVM parameter to the compiler? I'd like to use -Dkp:genAsciiNames=true to configure kind-projector behaviour. 2. The eclipse scala compiler configuration doesn't seem to pick up the arguments from <zincCompileOptions>, should it? e.g. I have -language:higherKinds in the maven config but I had to manually add it to the "Additional command line parameters" box in the eclipse Scala Compiler page of the project settings, otherwise I get warnings in Eclipse.

@Andrei-Pozolotin
Copy link
Contributor

  1. is it possible to pass a JVM parameter to the compiler
  • will be supported in 1.4.0
  • please file a separate issue
  1. I have -language:higherKinds in the maven config
  • looks like a bug, should pick up from zincCompileOptions
  • try to re-order entires in zincCompileOptions, see if makes any difference
  • please file a separate issue
  • please attach content of ${project.basedir}/.settings/org.scala-ide.sdt.core.prefs

@m50d
Copy link
Author

m50d commented Mar 2, 2018

For 2. the project settings seem to not be changed by a re-run of the plugin? So I don't think I can test the reordering or reproduce the problem consistently enough to make a usable bug report, but by the same token it's not a significant problem for me (was assuming I'd have to manually change it after every regenerate but it looks like I don't).

@Andrei-Pozolotin
Copy link
Contributor

@m50d

  1. please verify fix in fresh 1.4.0:
    https://bintray.com/random-maven/maven/scalor-maven-plugin_2.12
  2. working project example for reference:
    https://github.com/random-maven/scalor-maven-plugin/blob/develop/demo/pom.xml#L240
    https://github.com/random-maven/scalor-maven-plugin/blob/develop/demo/pom.xml#L316
  3. a way to test is:
  • delete ${project.basedir}/.settings/...
  • issue from menu: ${project} -> Maven -> Update Project ...

@m50d
Copy link
Author

m50d commented Mar 2, 2018

Confirmed working in that 1.4.0 build, many thanks.

@Andrei-Pozolotin
Copy link
Contributor

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

No branches or pull requests

2 participants