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

intellijRepo is consulted last when looking for IntelliJ artifacts #615

Closed
sewe opened this issue Mar 16, 2021 · 4 comments
Closed

intellijRepo is consulted last when looking for IntelliJ artifacts #615

sewe opened this issue Mar 16, 2021 · 4 comments
Assignees
Milestone

Comments

@sewe
Copy link

sewe commented Mar 16, 2021

I have set an intellij.intellijRepo pointing to a local proxy of the default (https://jetbrains.com/intellij-repository).

Unfortunaly, this proxy is consulted last, after all the other repository configured in the build’s repositories block:

2021-03-16T11:14:55.877+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve dependencies of :intellij:com.teamscale.ide.intellij.svn:idea' started
2021-03-16T11:14:55.878+0100 [INFO] [org.jetbrains.intellij.IntelliJPlugin] [gradle-intellij-plugin :com.teamscale.ide.intellij.svn] Configuring IDE dependency
2021-03-16T11:14:55.878+0100 [INFO] [org.jetbrains.intellij.IntelliJPlugin] [gradle-intellij-plugin :com.teamscale.ide.intellij.svn] Using IDE from remote repository
2021-03-16T11:14:55.878+0100 [DEBUG] [org.jetbrains.intellij.IntelliJPlugin] [gradle-intellij-plugin :com.teamscale.ide.intellij.svn] Adding IDE repository: https://example.org/repository/maven-intellij-repository/releases
2021-03-16T11:14:55.879+0100 [DEBUG] [org.jetbrains.intellij.IntelliJPlugin] [gradle-intellij-plugin :com.teamscale.ide.intellij.svn] Adding IDE dependency
2021-03-16T11:14:55.879+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve dependencies of :intellij:com.teamscale.ide.intellij.svn:detachedConfiguration1' started
2021-03-16T11:14:55.879+0100 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver] Resolving configuration ':intellij:com.teamscale.ide.intellij.svn:detachedConfiguration1'
2021-03-16T11:14:55.880+0100 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.ResolvedArtifactCaches] Reusing in-memory cache for repo 'MavenRepo' [a8be1fe3b3911d3d3425fe720cf42835].

This is unfortunate. Besides adding extra roundtrips this makes the build more fragile; if one of these repositories is unreachable (a 502 Bad Gateway, for example), the build terminates, even though the local proxy explicitly added via intellij.intellijRepo is reachable and has the artifacts in question:

> Could not resolve all files for configuration ':intellij:com.teamscale.ide.intellij.svn:detachedConfiguration1'.
   > Could not resolve com.jetbrains.intellij.idea:ideaIC:2019.1.
     Required by:
         project :intellij:com.teamscale.ide.intellij.svn
      > Could not resolve com.jetbrains.intellij.idea:ideaIC:2019.1.
         > Could not get resource 'https://plugins.gradle.org/m2/com/jetbrains/intellij/idea/ideaIC/2019.1/ideaIC-2019.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/jetbrains/intellij/idea/ideaIC/2019.1/ideaIC-2019.1.pom'. Received status code 502 from server: Bad Gateway

IMHO, intellijRepo (and jreRepo and pluginsRepo) should be consulted first (and probably exclusively; why fall back to other repos if there is a dedicated repository for these kinds of artifacts?).

@zcg
Copy link

zcg commented Mar 17, 2021

intellijRepo = "https://code.aliyun.com/intellij-repository/idea/raw/main"
//  2020.3.2 版本 jbr runtime 依赖库
jreRepo = "https://code.aliyun.com/intellij-repository/idea/raw/main/releases/com/jetbrains/intellij/jbre"

I use my own repo instead official repo in china ,and good for me

@sewe
Copy link
Author

sewe commented Mar 17, 2021

@zcg It's not that my own intellijRepo isn't picked up; that works.

It is just that other repositories configured in the build are searched for first. This adds extra roundtrips, as each is asked for the IntelliJ dependency that I know it won't have, and increases the likelihood that the build breaks when one of these repos is unreachable – even though it is not really needed to fetch the IntellIJ dependency.

@zolotov
Copy link
Member

zolotov commented Mar 17, 2021

@sewe the issue is clear, thanks for the details

@hsz hsz added this to the next milestone May 16, 2022
@hsz hsz self-assigned this May 16, 2022
hsz added a commit that referenced this issue May 16, 2022
@hsz hsz closed this as completed May 17, 2022
@hsz
Copy link
Member

hsz commented May 17, 2022

Thanks for raising this issue. Indeed, we use custom repositories only when we expect artifacts to be requested from them – so having such repositories at the bottom of the list isn't efficient.
After some refactorings that happened at the end of the last year, it was finally possible to quickly shuffle that list and put custom IJ-related ones on the top.
Fix will be available in the upcoming release.

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

No branches or pull requests

5 participants