-
Notifications
You must be signed in to change notification settings - Fork 27
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
Binary incompatibilities in maven-library used by sbt-native-packager and sbt-pom-reader #20
Comments
I tried adding the following to my libraryDependencies += "org.apache.maven" % "maven-aether-provider" % "3.2.5" |
I should have provided the full backtrace, as there's a wrapped exception ( java.lang.NoClassDefFoundError: org/apache/maven/repository/internal/MavenServiceLocator
at com.typesafe.sbt.pom.package$.newRepositorySystemImpl(package.scala:23)
at com.typesafe.sbt.pom.MvnPomResolver$.<init>(MavenPomResolver.scala:20)
at com.typesafe.sbt.pom.MvnPomResolver$.<clinit>(MavenPomResolver.scala)
at com.typesafe.sbt.pom.package$.loadEffectivePom(package.scala:41)
at com.typesafe.sbt.pom.MavenProjectHelper$.makeProjectTree(MavenProjectHelper.scala:119)
at com.typesafe.sbt.pom.MavenProjectHelper$.makeReactorProject(MavenProjectHelper.scala:47)
at com.typesafe.sbt.pom.PomBuild$class.projectDefinitions(PomBuild.scala:18)
at MavenBuild$.projectDefinitions(build.scala:2)
...
Caused by: java.lang.ClassNotFoundException: org.apache.maven.repository.internal.MavenServiceLocator
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.typesafe.sbt.pom.package$.newRepositorySystemImpl(package.scala:23)
at com.typesafe.sbt.pom.MvnPomResolver$.<init>(MavenPomResolver.scala:20)
at com.typesafe.sbt.pom.MvnPomResolver$.<clinit>(MavenPomResolver.scala)
at com.typesafe.sbt.pom.package$.loadEffectivePom(package.scala:41)
at com.typesafe.sbt.pom.MavenProjectHelper$.makeProjectTree(MavenProjectHelper.scala:119)
... |
I'm seeing the same problem. No great thoughts beyond your own idea for adding the dependency. If doing that doesn't work, perhaps there's some classpath hierarchy follies in the gears. |
sbt-native-packager pulls in an incompatible version of maven (because it was a jdeb dependency). I think this should be fixed if you can get one of the newer version (like the 1.0.0-RCs). Not positive. If you're not using JDeb, I think you may be able to exclude the dependency, let me look into that. |
NoClassDefFoundError
when using plugin in multi-project build.
Thanks @jsuereth. Back when I had the problem I just ended up converting the sub-project to first-class SBT and forgot about it. Good call with |
Things seem to be working OK with the 1.0.0 release of |
I found a little time and tried updating to sbt 0.13.8, sbt-pom-reader 2.0.0, with addMavenResolverPlugin . I'm still getting the missing class def for the stack trace. I'm not using sbt-native-packager. The complexity is all in maven. I'm hoping that doesn't matter much. What kind of thing should I be looking for? Thanks, Dave
|
@dwalend Any chance you could dump the output of sbt-dependency-graph of the, um. project-project (?) so we can see what else might be causing the version clash? Now that I think about that, I'm not sure how you do that for the plugins. @jsuereth any tips on dumping the dependency list of the loaded plugins? |
Thanks for picking this up. SHRINE is open source, so you could potentially see everything. It's a sprawling project with some old tech and more than it's share of ugly. I'm trying to use sbt in one subproject before trying everywhere. Try https://open.med.harvard.edu/vvc/viewvc.cgi/shrine/trunk/code/steward/ as starting point if that will help. |
@dwalend The I can give the build a try, but have forgotten how to use svn. Can you provide the checkout command? |
I got sbt-dependency-graph to show me a tree. (I gave up on the ascii graph after about two minutes.) it's got 1456 lines. What's a sane way to share it? |
Create a gist? Yeh, don't want the ASCII tree, however. creating a "Dot" version would be helpful. |
Dot is an amazing relic. It's from 1985? Or 1859? |
@jsuereth Does this look suspicious to you?: |
I'm glad to see it's that small. Someone made SHRINE's svn trunk in early 2008, and that was r611. But all of this looks like sbt's needs, not SHRINE's. We're looking for out-of-date maven-aether-providers ? (and I just spotted your update.) |
Those M2 versions are coming in from Maven's aether provider. That's pulled in by sbt-maven-resolver, maven-embedder, and sbt-pom-reader. M2 seems kinda sketchy to see. Have I got the wrong maven aether provider somehow? There's a 3.3.3 version available. However, it seems out-of-model to try to mess with that space. I didn't ask for either version. What's the right fix? (I do have addMavenResolverPlugin in the plugins.sbt.) |
To be honest, at this point, I don't know. Might be worth just trying a different version to see. |
Could this issue be addressed by upgrading |
@JoshRosen What version would you recommend we try? |
@JoshRosen @dwalend I have a draft version of the plugin with the Maven/Wagon/Aether dependencies updated. It passes all of its https://github.com/sbt/sbt-pom-reader/tree/release/2.1.0-RC1 |
FYI, RC2 is available (had to back off Maven library version to 3.2.2) https://github.com/sbt/sbt-pom-reader/tree/release/2.1.0-RC2 |
Got a chance to try RC2 today. (Sorry about taking so long.) Looks like you've fixed this bug, at least for SHRINE (https://open.med.harvard.edu/stash/projects/SHRINE/repos/shrine/browse?at=refs%2Fheads%2Fdevelop It's currently finding 1887 errors, looks like sbt-pom-reader is missing test dependencies and that's already been reported.) Thanks, Dave |
For an updated version of this, see scalacenter@f13c853 and its commit message. |
This is a recent error, triggered by some combination of SBT version or other plugins. I've been using this plugin as a part of a larger project for a long time, and only had the error triggered when trying to use sbt-native-packager.
It doesn't seem to happen when building the project that uses the plugin independently, but when it serves as a sub-project in a larger muti-project build.
I note that the referenced class is part of
maven-aether-provider
.Interested in knowing what additional info I can provide to help identify the issue further.
Backtrace
SBT Info
The text was updated successfully, but these errors were encountered: