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

Could not find com.jetbrains.intellij.idea:ideaIC:2021.3.3 #1113

Closed
aSemy opened this issue Sep 26, 2022 · 3 comments
Closed

Could not find com.jetbrains.intellij.idea:ideaIC:2021.3.3 #1113

aSemy opened this issue Sep 26, 2022 · 3 comments
Labels
Milestone

Comments

@aSemy
Copy link
Contributor

aSemy commented Sep 26, 2022

Describe the bug

I have tried to set up a fresh project, but I get an error.

I suspect this is either a problem with buildSrc, or the plugin not using the Gradle Providers API correctly (related to #1110), or centralised repository declarations

./gradlew assemble
Starting a Gradle Daemon, 1 incompatible and 4 stopped Daemons could not be reused, use --status for details
Configuration cache is an incubating feature.
Calculating task graph as no configuration cache is available for tasks: assemble
Type-safe project accessors is an incubating feature.
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by unknown code
Build was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by unknown code
[gradle-intellij-plugin :modules:intellij-pluginintellij-plugin] Error when resolving dependency: DefaultExternalModuleDependency{group='com.jetbrains.intellij.idea', name='ideaIC', version='2021.3.3', configuration='default'}
org.gradle.api.internal.artifacts.configurations.ResolveExceptionWithHints: Could not resolve all dependencies for configuration ':modules:intellij-plugin:detachedConfiguration3'.
The project declares repositories, effectively ignoring the repositories you have declared in the settings.
You can figure out how project repositories are declared by configuring your build to fail on project repositories.
See https://docs.gradle.org/7.5.1/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.failuresWithHint(DefaultConfiguration.java:764)
...

Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.jetbrains.intellij.idea:ideaIC:2021.3.3.
Searched in the following locations:
  - https://repo.maven.apache.org/maven2/com/jetbrains/intellij/idea/ideaIC/2021.3.3/ideaIC-2021.3.3.pom
  - https://plugins.gradle.org/m2/com/jetbrains/intellij/idea/ideaIC/2021.3.3/ideaIC-2021.3.3.pom
Required by:
    project :modules:intellij-plugin
...

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':modules:intellij-plugin:compileJava'.
> Could not resolve all dependencies for configuration ':modules:intellij-plugin:compileClasspath'.
   > Failed to calculate the value of task ':modules:intellij-plugin:setupDependencies' property 'idea'.
      > Could not resolve all dependencies for configuration ':modules:intellij-plugin:detachedConfiguration3'.
        The project declares repositories, effectively ignoring the repositories you have declared in the settings.
        You can figure out how project repositories are declared by configuring your build to fail on project repositories.
        See https://docs.gradle.org/7.5.1/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
         > Could not find com.jetbrains.intellij.idea:ideaIC:2021.3.3.
           Searched in the following locations:
             - https://repo.maven.apache.org/maven2/com/jetbrains/intellij/idea/ideaIC/2021.3.3/ideaIC-2021.3.3.pom
             - https://plugins.gradle.org/m2/com/jetbrains/intellij/idea/ideaIC/2021.3.3/ideaIC-2021.3.3.pom
           Required by:
               project :modules:intellij-plugin

To Reproduce

ij-gradle-plugin-error.zip

Expected behaviour

I am able to load the plugin without errors.

Environment:

  • OS: macOS
  • Gradle IntelliJ Plugin Version: 1.80 and 1.9.0
  • Gradle Version: 7.5.1
@YannCebron
Copy link
Member

#776 seems related

@aSemy
Copy link
Contributor Author

aSemy commented Sep 28, 2022

I think it would be best to consistently the repositories {} block in build.gradle.kts or settings.gradle.kts, rather than adding the repos in the plugin code, ad-hoc. That way it will be more clear to users about what repos are available, and can be specifically configured if necessary.

What do you think about the following options?

  1. Create a plugin option for "automatically add repository for X/Y/Z" that will disable automatically adding the repositories
  2. Document the repositories, so users can add them manually

    Add the following to build.gradle(.kts)

      repositories {
        maven("...") { ... }
        ivy("...") { ... }
      }

    or settings.gradle(.kts)

    dependencyResolutionManagement {
      repositories {
        maven("...") { ... }
        ivy("...") { ... }
      }
    }
  3. Add some extension functions to the Gradle plugin for handy short cuts for the repositories above ⬆
  4. Create a Settings plugin IntelijGradleSettingsPlugin : Plugin<Settings> for making the same repository helpers in settings.gradle.kts

@hsz
Copy link
Member

hsz commented Mar 14, 2024

Implemented in 2.0.
It is possible to apply the org.jetbrains.intellij.platform.settings plugin in settings.gradle.kts, which also provides a set for repository helpers to let you add all necessary repositories to the project.

See: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html#configuration.dependencyResolutionManagement

@hsz hsz closed this as completed Mar 14, 2024
@hsz hsz modified the milestones: 2.x, 2.0 Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants