After IntelliJ update maven tries to download a dependency from Oracle
Hi,
i encounter a strange behaviour with one maven dependency in a project, which is tried to be downloaded from maven.oracle.com, which is completely wrong and i have nowhere configured that repository to be used. This is the error message i get:
Downloading: https://maven.oracle.com/org/javalite/javalite-common/2.1-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata org.javalite:javalite-common:2.1-SNAPSHOT/maven-metadata.xml from/to maven.oracle.com (https://maven.oracle.com): Not authorized , ReasonPhrase:Authorization Required.
[WARNING] Failure to transfer org.javalite:javalite-common:2.1-SNAPSHOT/maven-metadata.xml from https://maven.oracle.com was cached in the local repository, resolution will not be reattempted until the update interval of maven.oracle.com has elapsed or updates are forced. Original error: Could not transfer metadata org.javalite:javalite-common:2.1-SNAPSHOT/maven-metadata.xml from/to maven.oracle.com (https://maven.oracle.com): Not authorized , ReasonPhrase:Authorization Required.
Since i do not have an account at Oracle the error makes sense, but i wonder why maven suddenly tries to download that dependency from that repo. I have configured a separate respository and pluginRepository in my pom.xml for dependencies/plugins from that supplier.
IntelliJ IDEA 2018.1.1 (Ultimate Edition)
Build #IU-181.4445.78, built on April 9, 2018
JRE: 1.8.0_152-release-1136-b27 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.12.6
Please sign in to leave a comment.
Hi.
If you try to build a project using mvn command from command line, does it behaves differently?
The problem could be solved: The developer of the mentioned dependency had to explicitely add the maven oracle repository to the project's pom.xml.
same s**t here with Gradle, Intellij out of a sudden starts to look for artifacts in maven.oracle.com, which fails due to (most probably) corporate proxy settings
gradlew commands do not seem to have experience this issue, "gradlew dependencies" works OK at least, quite fast and displays necessary information
Using IntelliJ 2018.1.5 Ultimate with Gradle Wrapper for Gradle 4.10.2
Seems to start after adding mavenLocal() into repositories block of build.gradle
any suggestions?
Do you have any output for the process with error/warning? What remote repositories do you specify in gradle project script or in global gradle init script? If you do not see it from command line, make sure the same gradle is used in IDE.
Check also repository you have in Settings | Build, Execution, Deployment | Remote Jar Repositories and Settings | Build, Execution, Deployment | Build Tools | Maven | Repositories.
this is what is displayed as details for the failing "Metadata of..." items in "Build: Sync" view
org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not HEAD 'https://maven.oracle.com/org/springframework/boot/spring-boot-devtools/1.5.6.RELEASE/spring-boot-devtools-1.5.6.RELEASE.pom'. Received status code 401 from server: Authorization Required
at org.gradle.internal.resource.transport.http.HttpClientHelper.processResponse(HttpClientHelper.java:158)
at org.gradle.internal.resource.transport.http.HttpClientHelper.performHead(HttpClientHelper.java:76)
at org.gradle.internal.resource.transport.http.HttpResourceAccessor.getMetaData(HttpResourceAccessor.java:65)
at org.gradle.internal.resource.transfer.DefaultExternalResourceConnector.getMetaData(DefaultExternalResourceConnector.java:63)
at org.gradle.internal.resource.transfer.AccessorBackedExternalResource.getMetaData(AccessorBackedExternalResource.java:201)
at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator$1.call(BuildOperationFiringExternalResourceDecorator.java:61)
at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator$1.call(BuildOperationFiringExternalResourceDecorator.java:58)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:314)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:304)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:100)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
...
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:748)
In BED\Build Tools\Gradle, under Project-level settings, I have "Use default gradle wrapper" option checked
BED\Build Tools\Maven\Repositories, indeed, has this maven.oracle.com listed; I have no idea how to delete it from here
Check your build.gradle files including Gradle global configuration. You should delete this repository from there.
I've deleted .idea folder and imported from Gradle again, so far the issue is gone, but will see...