哪个代码库中有 eXist,并且如何在使用 Gradle 时将其添加到类路径中?

huangapple go评论73阅读模式
英文:

which repository has eXist and how is it added to the classpath with gradle?

问题

以下是翻译好的内容:

寻求导入 eXist 数据库以及其他附加依赖项。

哪些仓库最适合满足这些要求?

构建的堆栈跟踪:

thufir@dur:~/NetBeansProjects/twitterBaseX$ 
thufir@dur:~/NetBeansProjects/twitterBaseX$ gradle clean build 
> 任务:compileJava 失败                                                       
                                                                                  
FAILURE: 构建失败。                                                   
    
* 出现了什么问题:
任务 ':compileJava' 的执行失败。
> 无法解析配置文件“:compileClasspath”的所有文件。
   > 找不到 org.exist-db.thirdparty.com.thaiopensource:jing:20151127。
     已在以下位置搜索:
       - https://repo.maven.apache.org/maven2/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.pom
       - https://repo.maven.apache.org/maven2/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.jar
       - https://mvnrepository.com/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.pom
       - https://mvnrepository.com/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.jar
       - https://jcenter.bintray.com/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.pom
       - https://jcenter.bintray.com/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.jar
     所需版本:
         project : > org.exist-db:exist-core:5.2.0
   > 找不到 org.exist-db.thirdparty.javax.xml.xquery:xqjapi:1.0-fr。
     已在以下位置搜索:
       - https://repo.maven.apache.org/maven2/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.pom
       - https://repo.maven.apache.org/maven2/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.jar
       - https://mvnrepository.com/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.pom
       - https://mvnrepository.com/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.jar
       - https://jcenter.bintray.com/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.pom
       - https://jcenter.bintray.com/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.jar
     所需版本:
         project : > org.exist-db:exist-core:5.2.0

* 尝试:
运行时添加 --stacktrace 选项以获取堆栈跟踪。运行时添加 --info 或 --debug 选项以获取更多日志输出。运行时添加 --scan 以获取完整洞察力。

* 获取更多帮助,请访问 https://help.gradle.org

构建失败,耗时 3 秒
2 个可操作的任务:2 个已执行
thufir@dur:~/NetBeansProjects/twitterBaseX$                                       

似乎只有 exist-db 的导入导致了问题:

/*
 * 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.
       
    mavenCentral()
    //
    //maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    maven { url "https://mvnrepository.com/" }
    jcenter()
}

dependencies {
    // This dependency is found on compile classpath of this component and consumers.
    implementation 'com.google.guava:guava:27.0.1-jre'

    // Use TestNG framework, also requires calling test.useTestNG() below
    testImplementation 'org.testng:testng:6.14.3'
    
    compile group: 'org.twitter4j', name: 'twitter4j-core', version: '4.0.1'
    compile group: 'org.basex', name: 'basex', version: '9.2.4'
    compile group: 'net.sf.xmldb-org', name: 'xmldb-api', version: '1.7.0'
    // https://mvnrepository.com/artifact/org.exist-db/exist-core
    compile group: 'org.exist-db', name: 'exist-core', version: '5.2.0'

    
}
// Define the main class for the application
mainClassName = 'twitterBaseX.App'

test {
    // Use TestNG for unit tests
    useTestNG()
}

通过注释掉这个 compile group 可以进行干净的构建。可能是要添加正确的仓库?

英文:

Looking to import the eXist database, as well as additional dependencies.

What repositories work best for this requirements?

stack trace for build:

thufir@dur:~/NetBeansProjects/twitterBaseX$ 
thufir@dur:~/NetBeansProjects/twitterBaseX$ gradle clean build 
> Task :compileJava FAILED                                                        
FAILURE: Build failed with an exception.                                          
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.exist-db.thirdparty.com.thaiopensource:jing:20151127.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.pom
- https://repo.maven.apache.org/maven2/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.jar
- https://mvnrepository.com/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.pom
- https://mvnrepository.com/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.jar
- https://jcenter.bintray.com/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.pom
- https://jcenter.bintray.com/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.jar
Required by:
project : > org.exist-db:exist-core:5.2.0
> Could not find org.exist-db.thirdparty.javax.xml.xquery:xqjapi:1.0-fr.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.pom
- https://repo.maven.apache.org/maven2/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.jar
- https://mvnrepository.com/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.pom
- https://mvnrepository.com/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.jar
- https://jcenter.bintray.com/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.pom
- https://jcenter.bintray.com/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.jar
Required by:
project : > org.exist-db:exist-core:5.2.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
2 actionable tasks: 2 executed
thufir@dur:~/NetBeansProjects/twitterBaseX$                                       

it's only the import for exist-db which seems to be causing trouble:

/*
* 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.
mavenCentral()
//
//maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://mvnrepository.com/" }
jcenter()
}
dependencies {
// This dependency is found on compile classpath of this component and consumers.
implementation 'com.google.guava:guava:27.0.1-jre'
// Use TestNG framework, also requires calling test.useTestNG() below
testImplementation 'org.testng:testng:6.14.3'
compile group: 'org.twitter4j', name: 'twitter4j-core', version: '4.0.1'
compile group: 'org.basex', name: 'basex', version: '9.2.4'
compile group: 'net.sf.xmldb-org', name: 'xmldb-api', version: '1.7.0'
// https://mvnrepository.com/artifact/org.exist-db/exist-core
compile group: 'org.exist-db', name: 'exist-core', version: '5.2.0'
}
// Define the main class for the application
mainClassName = 'twitterBaseX.App'
test {
// Use TestNG for unit tests
useTestNG()
}

as commenting out that compile group allows a clean build. Presumably it's a question of adding the correct repo's properly?

答案1

得分: 3

对于 eXist-db 5.x.x,您需要两个仓库:

  1. Maven Central 用于 eXist-db 自身的构件。
  2. eXist-db 的仓库(http://repo.evolvedbinary.com/repository/exist-db/)用于一些第三方构件,这些构件无法发布到 Maven Central,因为它们不符合 Maven Central 的要求。
英文:

For eXist-db 5.x.x you need two repositories:

  1. Maven Central for the eXist-db artifacts themselves.
  2. eXist-db's Repository (http://repo.evolvedbinary.com/repository/exist-db/) for some third-party artifacts which cannot be published to Maven Central as they do not meet the requirements for Maven Central.

huangapple
  • 本文由 发表于 2020年1月30日 18:31:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/59983939.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定