Как разрешить ошибку Uber jar Неизвестное свойствоJAVA

Программисты JAVA общаются здесь
Anonymous
Как разрешить ошибку Uber jar Неизвестное свойство

Сообщение Anonymous »

Уважайся, я получаю ошибку для ошибки неизвестной задачи свойства, Intelij просит использовать task.register для создания jar < /p>
task.register ('fatjar', jar) {
manifest {
attributes'main-Class': "com.app.app.BackendAppKt"
}
archiveBaseName.set =rootProjectName + "all"
archiveVersion.set = deloymentVersion
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
zip64 = true
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }}
}
with jar // i also used this from (tasks.named('jar', jar) and many more
}
< /code>
error : could not get unknown property from task of type org.gradle.api.DefualtTask
< /code>
I tried and checked all the configurations and settings

apply plugin: 'java'

repositories {
maven {
url = uri(https://artifactory.yoursecretorg.com/a ... rg-plugins")
credentials {
username = System.getenv("ARTIFACTORY_USR")
password = System.getenv("ARTIFACTORY_PSWD")
}

dependencies {
implementation 'org.apache.kafka:kafka-clients:some.version.0'
implementation 'org.slf4j:slf4j-api:some.version.0'
runtimeOnly 'org.slf4j:slf4j-simple:some.version.0'
}

tasks.register('jar', Jar) {
archiveBaseName.set = rootProject.name} + "try"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
zip64.set(true)
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}

tasks.register('fatJar', Jar) {
manifest {
attributes('Main-Class': 'com.example.hell')
}
archiveBaseName.set = rootProject.name} + "all"
archiveVersion.set = deploymentVersion // This should work now
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
zip64.set(true)
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
with(tasks.named('jar').get())
}


Подробнее здесь: https://stackoverflow.com/questions/796 ... n-property

Вернуться в «JAVA»