Skip to content

Support additional Gradle configurations #1809

Open

Description

@NiklasRosenstein

Our projects often times have integration tests and we use a Gradle configuration called integrationTest. The source for these tests is usually located in a src/integrationTest/java directory. Example:

my-subproject/
  build.gradle
  src/
    integrationTest/
      java/
        com/ ...
    main/
      java/
        com/ ...
build.gradle
settings.gradle

In my-subproject/build.gradle the dependencies are defined akin to

dependencies {
    implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
    integrationTestImplementation 'org.junit.jupiter:junit-jupiter'
}

Right now, this means that IntelliSense will not be able to find symbols from the junit-jupiter dependency while editing code in the integrationTest directory. It appears to treat these source files as part of the default configuration.

Activity

  1. testforstephen commented on Feb 22, 2021

    @testforstephen
    Collaborator

    Since you're using custom configurations/dependencies in your build.gradle, and the gradle tooling buildship used by vscode java extension doesn't recognize it by default. You have to add a line like eclipse.classpath.plusConfigurations << configurations.integrationTestImplementation to your build.gradle. Learn more from FAQ at buildship and eclipse-buildship/buildship#371.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions