tbroyer / gradle-errorprone-plugin

Gradle plugin to use the error-prone compiler for Java
Apache License 2.0
366 stars 32 forks source link

faied to download 'https://repo1.maven.org/maven2/com....' #47

Closed albanyqq closed 3 years ago

albanyqq commented 4 years ago

when i run with javac with error-prone,errors is faied to download 'https://repo1.maven.org/maven2/com....' How to modify warehouse address?

tbroyer commented 4 years ago

The plugin doesn't download anything by itself, download is done by Gradle like for any other dependency, relying one your repositories {} configuration. And because Gradle (contrary to, say, Maven) doesn't have any configured repository by default, this means you have an explicit repositories { mavenCentral() } in your build (or possibly implicit, added by another plugin).

albanyqq commented 4 years ago

The plugin doesn't download anything by itself, download is done by Gradle like for any other dependency, relying one your repositories {} configuration. And because Gradle (contrary to, say, Maven) doesn't have any configured repository by default, this means you have an explicit repositories { mavenCentral() } in your build (or possibly implicit, added by another plugin).

My project uses maven, not gradle。I noticed the "repo1.maven.org" is configured in error-prone-core's file. How can I modify the configuration of the central warehouse in my project?

albanyqq commented 4 years ago

Can I start the error-prone-plugin using jar in my local directory?

tbroyer commented 4 years ago

I'm confused: if you're not using Gradle, why are you opening an issue on the gradle-errorprone-plugin project :interrobang:

That being said, I indeed see a <repository> configured in error_prone_core's POM (https://search.maven.org/artifact/com.google.errorprone/error_prone_core/2.4.0/jar), which shouldn't be the case (not a best practice).

The workaround would be to configure a <mirror> in your settings.xml with <mirrorOf>alt-repo1</mirrorOf> to match the one from the ErrorProne POM, and the <url> pointing to any Maven repository you have access to (e.g. https://repo.maven.apache.org/maven2 which is the default repository in Maven's Super POM).

For further assistance with your Maven setup, I'd recommend the Maven User List mailing list

albanyqq commented 4 years ago

thanks

I will try it