Anonymous
Пакет Gradle не существует
Сообщение
Anonymous » 21 ноя 2025, 15:02
Я пытаюсь собрать Gradle, используя
./gradlew build , но во время компиляции не найден следующий пакет ошибок. В eclipse я могу запустить обновление gradle, но в командной строке возникает следующая проблема:
Код: Выделить всё
> Task :compileJava FAILED
/Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:3: error: package io.restassured does not exist
import static io.restassured.RestAssured.given;
^
/Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:3: error: static import only from classes and interfaces
import static io.restassured.RestAssured.given;
^
/Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:21: error: package org.apache.commons.lang3 does not exist
import org.apache.commons.lang3.StringUtils;
^
/Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:34: error: package io.restassured.response does not exist
import io.restassured.response.ExtractableResponse;
^
/Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:35: error: package io.restassured.response does not exist
import io.restassured.response.Response;
^
/Users/Documents/em-cedm-integ-test/src/main/java/com/CedmTest.java:3: error: package org.junit.runner does not exist
import org.junit.runner.JUnitCore;
^
^
Файл Build.gradle, который я использую
Код: Выделить всё
// Apply the java-library plugin to add support for Java Library
apply plugin: 'java'
allprojects {
repositories {
// You can declare any Maven/Ivy/file repository here.
maven {
url "http://repo.hortonworks.com/content/repositories/releases"
}
maven {
url "${artifactory_contextUrl}"
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
maven {
url "${artifactory_contextUrl}/ip-fci-maven-virtual"
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
}
configurations.all {
transitive = false
}
}
version = '1.0'
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File Example',
'Implementation-Version': version,
'Main-Class': 'com.ibm.cedm.CedmTest'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
defaultTasks 'downloadFile'
dependencies {
compile group: 'com.google.guava', name: 'guava', version: '12.0.1'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.7'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.7'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.9.7'
compile group: 'org.apache.kafka', name: 'kafka-clients', version: '0.11.0.3'
compile group: 'org.apache.hbase', name: 'hbase-client', version: '1.1.2.2.6.4.0-91'
compile group: 'org.apache.hbase', name: 'hbase-common', version: '1.1.2.2.6.4.0-91'
compile group: 'org.apache.hbase', name: 'hbase-client', version: '1.1.2.2.6.4.0-91'
compile group: 'org.apache.hadoop', name: 'hadoop-common', version: '2.7.3.2.6.4.0-91'
compile group: 'com.tdunning', name: 'json', version: '1.8'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.6'
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.10'
compile group: 'org.apache.oozie', name: 'oozie-client', version: '4.2.0'
compileOnly group: 'io.swagger', name: 'swagger-annotations', version: '1.5.12'
compileOnly group: 'javax', name: 'javaee-api', version: '7.0'
compile group: 'ip-fci-generic-local.fcco-core', name: 'fci-core-utils', version: 'master'
compile(group: 'ip-fci-generic-local.media', name: 'db2jcc4', version: '11.1.3')
testImplementation 'junit:junit:4.12'
testCompile group: 'commons-codec', name: 'commons-codec', version: '1.9'
testCompile group: 'com.tdunning', name: 'json', version: '1.8'
testCompile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.6'
testCompile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.6'
testCompile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.10'
testCompile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2'
testCompile group: 'commons-logging', name: 'commons-logging', version: '1.2'
testCompile group: 'io.rest-assured', name: 'rest-assured', version: '3.0.2'
testCompile group: 'io.rest-assured', name: 'rest-assured-common', version: '3.0.2'
testCompile group: 'io.rest-assured', name: 'json-path', version: '3.0.2'
testCompile group: 'io.rest-assured', name: 'xml-path', version: '3.0.2'
testCompile group: 'net.javacrumbs.json-unit', name: 'json-unit', version: '1.5.2'
testCompile group: 'net.javacrumbs.json-unit', name: 'json-unit-core', version: '1.5.2'
testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3'
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
testCompile group: 'org.codehaus.groovy', name: 'groovy', version: '2.4.4'
testCompile group: 'org.codehaus.groovy', name: 'groovy-json', version: '2.4.4'
testCompile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
testCompile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.25'
}
/*
test {
filter {
//include specific method in any of the tests
includeTestsMatching "*createBasicIndividualParty"
}
}
*/
Может кто-нибудь сказать мне, почему это так? и какие изменения мне следует внести, чтобы это работало?
Подробнее здесь:
https://stackoverflow.com/questions/583 ... -not-exist
1763726555
Anonymous
Я пытаюсь собрать Gradle, используя [b]./gradlew build[/b], но во время компиляции не найден следующий пакет ошибок. В eclipse я могу запустить обновление gradle, но в командной строке возникает следующая проблема: [code] > Task :compileJava FAILED /Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:3: error: package io.restassured does not exist import static io.restassured.RestAssured.given; ^ /Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:3: error: static import only from classes and interfaces import static io.restassured.RestAssured.given; ^ /Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:21: error: package org.apache.commons.lang3 does not exist import org.apache.commons.lang3.StringUtils; ^ /Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:34: error: package io.restassured.response does not exist import io.restassured.response.ExtractableResponse; ^ /Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:35: error: package io.restassured.response does not exist import io.restassured.response.Response; ^ /Users/Documents/em-cedm-integ-test/src/main/java/com/CedmTest.java:3: error: package org.junit.runner does not exist import org.junit.runner.JUnitCore; ^ ^ [/code] Файл Build.gradle, который я использую [code]// Apply the java-library plugin to add support for Java Library apply plugin: 'java' allprojects { repositories { // You can declare any Maven/Ivy/file repository here. maven { url "http://repo.hortonworks.com/content/repositories/releases" } maven { url "${artifactory_contextUrl}" credentials { username = "${artifactory_user}" password = "${artifactory_password}" } } maven { url "${artifactory_contextUrl}/ip-fci-maven-virtual" credentials { username = "${artifactory_user}" password = "${artifactory_password}" } } } configurations.all { transitive = false } } version = '1.0' task fatJar(type: Jar) { manifest { attributes 'Implementation-Title': 'Gradle Jar File Example', 'Implementation-Version': version, 'Main-Class': 'com.ibm.cedm.CedmTest' } baseName = project.name + '-all' from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } with jar } defaultTasks 'downloadFile' dependencies { compile group: 'com.google.guava', name: 'guava', version: '12.0.1' compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.7' compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.7' compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.9.7' compile group: 'org.apache.kafka', name: 'kafka-clients', version: '0.11.0.3' compile group: 'org.apache.hbase', name: 'hbase-client', version: '1.1.2.2.6.4.0-91' compile group: 'org.apache.hbase', name: 'hbase-common', version: '1.1.2.2.6.4.0-91' compile group: 'org.apache.hbase', name: 'hbase-client', version: '1.1.2.2.6.4.0-91' compile group: 'org.apache.hadoop', name: 'hadoop-common', version: '2.7.3.2.6.4.0-91' compile group: 'com.tdunning', name: 'json', version: '1.8' compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.6' compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.10' compile group: 'org.apache.oozie', name: 'oozie-client', version: '4.2.0' compileOnly group: 'io.swagger', name: 'swagger-annotations', version: '1.5.12' compileOnly group: 'javax', name: 'javaee-api', version: '7.0' compile group: 'ip-fci-generic-local.fcco-core', name: 'fci-core-utils', version: 'master' compile(group: 'ip-fci-generic-local.media', name: 'db2jcc4', version: '11.1.3') testImplementation 'junit:junit:4.12' testCompile group: 'commons-codec', name: 'commons-codec', version: '1.9' testCompile group: 'com.tdunning', name: 'json', version: '1.8' testCompile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.6' testCompile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.6' testCompile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.10' testCompile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2' testCompile group: 'commons-logging', name: 'commons-logging', version: '1.2' testCompile group: 'io.rest-assured', name: 'rest-assured', version: '3.0.2' testCompile group: 'io.rest-assured', name: 'rest-assured-common', version: '3.0.2' testCompile group: 'io.rest-assured', name: 'json-path', version: '3.0.2' testCompile group: 'io.rest-assured', name: 'xml-path', version: '3.0.2' testCompile group: 'net.javacrumbs.json-unit', name: 'json-unit', version: '1.5.2' testCompile group: 'net.javacrumbs.json-unit', name: 'json-unit-core', version: '1.5.2' testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3' testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3' testCompile group: 'org.codehaus.groovy', name: 'groovy', version: '2.4.4' testCompile group: 'org.codehaus.groovy', name: 'groovy-json', version: '2.4.4' testCompile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' testCompile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.25' } /* test { filter { //include specific method in any of the tests includeTestsMatching "*createBasicIndividualParty" } } */ [/code] Может кто-нибудь сказать мне, почему это так? и какие изменения мне следует внести, чтобы это работало? Подробнее здесь: [url]https://stackoverflow.com/questions/58331257/gradle-package-does-not-exist[/url]