Как устранить ошибку красного пути к классам для строки 10
import org.basex.core.BaseXException;
из Eclipse:
, которая была импортирована как:
после создания в консоли:
thufir@dur:~/eclipse-workspace/gradleProject$
thufir@dur:~/eclipse-workspace/gradleProject$ gradle init --type java-application --test-framework testng
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details
Select build script DSL:
1: groovy
2: kotlin
Enter selection (default: groovy) [1..2] 1
Project name (default: gradleProject):
Source package (default: gradleProject):
BUILD SUCCESSFUL in 42s
2 actionable tasks: 2 executed
thufir@dur:~/eclipse-workspace/gradleProject$
сгенерированного файла сборки Gradle, я только добавил группу компиляции basex
:
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.4.1/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building an application
id 'application'
}
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// This dependency is found on compile classpath of this component and consumers.
implementation 'com.google.guava:guava:27.0.1-jre'
compile group: 'org.basex', name: 'basex', version: '9.2.4'
// Use TestNG framework, also requires calling test.useTestNG() below
testImplementation 'org.testng:testng:6.14.3'
}
// Define the main class for the application
mainClassName = 'gradleProject.App'
test {
// Use TestNG for unit tests
useTestNG()
}
Плагин gradle установлен , и, как следует, gradle успешно запускает проект из консоли:
thufir@dur:~/eclipse-workspace/gradleProject$
thufir@dur:~/eclipse-workspace/gradleProject$ gradle clean run
> Task :run
Oct. 11, 2019 3:30:31 P.M. gradleProject.App loadProperties
INFO: {databasePath=src/main/resources/treasury.xml, xmlFromUrl=https://www.treasurydirect.gov/xml/A_20080410_1.xml, databaseName=treasury}
Oct. 11, 2019 3:30:31 P.M. gradleProject.App loadProperties
INFO: Name Resources Size Input Path
--------------------------------------------------------------------------------------------------------
treasury 1 12024 /home/thufir/eclipse-workspace/gradleProject/src/main/resources/treasury.xml
1 database(s).
Oct. 11, 2019 3:30:32 P.M. gradleProject.App loadProperties
INFO: Name Resources Size Input Path
--------------------------------------------------------------------------------------------------------
treasury 1 12024 /home/thufir/eclipse-workspace/gradleProject/src/main/resources/treasury.xml
1 database(s).
BUILD SUCCESSFUL in 1s
4 actionable tasks: 4 executed
thufir@dur:~/eclipse-workspace/gradleProject$