-
Notifications
You must be signed in to change notification settings - Fork 503
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
Deprecate MavenDependencyResolver. #468
Deprecate MavenDependencyResolver. #468
Conversation
@jaredsburrows FYI, when I tried to build standalone ktlint via Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Predicate
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:315)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:316)
at com.pinterest.ktlint.internal.MavenDependencyResolver.resolve(MavenDependencyResolver.kt:75)
at com.pinterest.ktlint.Main.loadJARs(Main.kt:769)
at com.pinterest.ktlint.Main.loadReporter(Main.kt:506)
at com.pinterest.ktlint.Main.main(Main.kt:355)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Predicate
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 13 more |
@Tapchicoma Thanks. We should not need to shadow anything, see #465. You should be able to do |
@Tapchicoma I just merged #465 - can you rebase and verify it works? |
Running |
- print warning message with link to the issue, when resolver is used - hide related command-line options - remove mentioning from project readme Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
9bb8bc7
to
9ae3725
Compare
@jaredsburrows #465 does not solve the problem: $ ./gradlew :ktlint:run
$ ./ktlint/build/install/ktlint-shadow/bin/ktlint --debug --reporter=html,artifact=me.cassiano:ktlint-html-reporter:0.2.3,output=ktlint.html ktlint/src/**/*.kt
[DEBUG] Discovered ruleset "standard"
[DEBUG] Resolving me.cassiano:ktlint-html-reporter:0.2.3
Deprecation message!
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Predicate
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:315)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:316)
at com.pinterest.ktlint.internal.MavenDependencyResolver.resolve(MavenDependencyResolver.kt:75)
at com.pinterest.ktlint.Main.loadJARs(Main.kt:769)
at com.pinterest.ktlint.Main.loadReporter(Main.kt:506)
at com.pinterest.ktlint.Main.main(Main.kt:355)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Predicate
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 13 more Building with maven produces @shashachu PR itself does not related to this exception, it should be the same on |
@Tapchicoma I think there is some confusion. #465 was just to allow it to run correctly with the correct |
@jaredsburrows but when I build |
If you build with both Maven and Gradle, then both project setups are missing a dependency. If it only is showing up in the Gradle project, then I am guessing the Gradle project still needs work. |
Pom file has Guava dependency: Line 116 in b099455
|
Cool. So can you add guava to the gradle project? |
Added in #472 |
@Tapchicoma just merged #472. |
@@ -367,7 +362,7 @@ In short, all you need to do is to implement a | |||
a custom [ReporterProvider](ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/ReporterProvider.kt) using | |||
`META-INF/services/com.pinterest.ktlint.core.ReporterProvider`. Pack all of that into a JAR and you're done. | |||
|
|||
To load a custom (3rd party) reporter use `ktlint --reporter=name,artifact=groupId:artifactId:version` / `ktlint --reporter=name,artifact=/path/to/custom-ktlint-reporter.jar` | |||
To load a custom (3rd party) reporter use `ktlint --reporter=name,artifact=/path/to/custom-ktlint-reporter.jar` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a note here about the old groupId:artifactId:version
being scheduled for deprecation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, see b583aaf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
* Deprecate MavenDependencyResolver. - print warning message with link to the issue, when resolver is used - hide related command-line options - remove mentioning from project readme Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com> * Mention in README that maven dependency resolver is deprecated. Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
* Deprecate MavenDependencyResolver. - print warning message with link to the issue, when resolver is used - hide related command-line options - remove mentioning from project readme Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com> * Mention in README that maven dependency resolver is deprecated. Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
* Deprecate MavenDependencyResolver. - print warning message with link to the issue, when resolver is used - hide related command-line options - remove mentioning from project readme Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com> * Mention in README that maven dependency resolver is deprecated. Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
* Deprecate MavenDependencyResolver. - print warning message with link to the issue, when resolver is used - hide related command-line options - remove mentioning from project readme Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com> * Mention in README that maven dependency resolver is deprecated. Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
To see warning message run:
On using direct jar file, message should not be visible: