K
K
Katya Smirnova2021-11-27 23:59:59
Java
Katya Smirnova, 2021-11-27 23:59:59

New package in Gradle?

Good day! Haven't had time to deal with gradle yet, so there is a blunt. I generate proto files in folder /src/main/kotlin/tutorialand IntelliJ seems to see new classes, but gradle swears

61a29bbc0287f513813944.png

Error:

61a29bf134ba0319003044.png

Gradle file:

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    id("org.springframework.boot") version "2.5.7"
    id("io.spring.dependency-management") version "1.0.11.RELEASE"
    kotlin("jvm") version "1.5.31"
    kotlin("plugin.spring") version "1.5.31"
}

sourceSets {

}

group = "com.lightswitch"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_11

repositories {
    mavenCentral()
}

dependencies {

    implementation("org.springframework.boot:spring-boot-starter") {
        exclude("org.springframework.boot", "spring-boot-starter-logging")
    }
    implementation("org.springframework.boot:spring-boot-starter-log4j2")
    implementation("org.jetbrains.kotlin:kotlin-reflect")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    testImplementation("org.apache.hadoop:hadoop-hdfs:3.3.1")
    implementation("org.apache.hadoop:hadoop-common:3.3.1")
    implementation("org.apache.hadoop:hadoop-mapreduce-client-core:3.3.1")
    implementation("org.apache.hadoop:hadoop-client:3.3.1")

    implementation("org.apache.solr:solr-solrj:8.11.0")
    implementation("org.apache.solr:solr-core:8.11.0")
    implementation("org.apache.solr:solr-common:1.3.0")

    implementation("org.apache.tika:tika-core:2.1.0")
    implementation("org.apache.tika:tika-parsers:2.1.0")

    implementation("com.google.protobuf:protobuf-java:3.19.1")
    implementation("com.google.protobuf:protobuf-kotlin:3.19.1")

    implementation("org.jsoup:jsoup:1.14.3")

    testImplementation("org.apache.hadoop:hadoop-hdfs:3.3.1")
    testImplementation("org.springframework.boot:spring-boot-starter-test")
}

sourceSets {
    main {
        java {
            setSrcDirs(listOf("src/kotlin"))
        }
        resources {
            setSrcDirs(listOf("src/resources"))
        }
    }
}

tasks.withType<KotlinCompile> {
    kotlinOptions {
        freeCompilerArgs = listOf("-Xjsr305=strict")
        jvmTarget = "11"
    }
}

tasks.withType<Test> {
    useJUnitPlatform()
}


As I understand it, gradle simply does not see the tutorial package. Question - how to inform him about this folder?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question