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

Missing dependencies between IDE modules #1854

Open
ekudel opened this issue Dec 29, 2024 · 4 comments
Open

Missing dependencies between IDE modules #1854

ekudel opened this issue Dec 29, 2024 · 4 comments
Labels

Comments

@ekudel
Copy link

ekudel commented Dec 29, 2024

What happened?

After I updated the plugin to 2.2.0 and performed "Reimport" in IDEA, "Provided" dependencies between IDE modules were replaced with dependencies on related compiled JARs (see the screenshot):

image

So, navigation in the IDE stopped working correctly, because references are only resolved to .class files in that JARs. Also that JARs may not exist or be outdated, so sometimes references are not resolved at all (until I perform Gradle build).

After downgrading to 2.1.0 dependencies look like this, which works good for me (I'm not sure why both Runtime and Provided dependencies are needed though):

image

Relevant log output or stack trace

No response

Steps to reproduce

See the description

Gradle IntelliJ Plugin version

2.2.0

Gradle version

8.8

Operating System

macOS

Link to build, i.e. failing GitHub Action job

No response

@ekudel ekudel added the bug label Dec 29, 2024
@AlexanderBartash
Copy link
Contributor

Hi. @ekudel How do you define that dependency in your build.gradle file?

@ekudel
Copy link
Author

ekudel commented Jan 9, 2025

@AlexanderBartash like this:

dependencies {
  implementation(project(":framework:domain"))
  implementation(project(":framework:util"))
}

@AlexanderBartash
Copy link
Contributor

@ekudel Try the below. It is somewhat verbose, but may do what you want.

    compileOnlyApi(project(":framework:domain")) {
        attributes {
            attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR))
        }
    }
    runtimeOnly(project(":framework:domain")) {
        attributes {
            attribute(
                LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE,
                objects.named(Constants.Configurations.Attributes.COMPOSED_JAR_NAME)
            )
        }
    }

@ekudel
Copy link
Author

ekudel commented Jan 20, 2025

@hsz any reaction?

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

2 participants