Saxon S9 API未使用Gradle中的本地罐子暴露
我想在 gradle 中本地包含 jar 文件,我创建了一个 libs 文件夹并在其中添加了 jar 文件。这些 jar 已添加到类路径中,但我无法访问 api。
my build.gradle :
plugins {
id 'java'
id 'io.github.lhotari.gradle-nar-plugin' version '0.5.1'
}
group 'com.acs.contentlake.nifi'
version '1.0'
repositories {
mavenCentral()
gradlePluginPortal()
maven {
url("https://mvnrepository.com/artifact/apache-xerces/resolver")
}
flatDir {
dirs 'libs'
}
}
compileJava{
sourceCompatibility('8')
targetCompatibility('8')
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
implementation group: 'org.apache.nifi', name: 'nifi-api', version: '1.15.0'
implementation group: 'org.apache.nifi', name: 'nifi-utils', version: '1.15.0'
// implementation group: 'net.sf.saxon', name: 'Saxon-HE', version: '10.6'
implementation group: 'xerces', name: 'xercesImpl', version: '2.9.1'
implementation group: 'apache-xerces', name: 'resolver', version: '2.9.1'
implementation 'org.codehaus.groovy:groovy-all:3.0.8'
// implementation files('libs/saxon-ee-10.6.jar', 'icu4j-59.1.jar', 'jline-2.14.6.jar', 'saxon-ee-test-10.6.jar', 'saxon-sql-10.6.jar')
// implementation fileTree(dir: 'libs', include: ['*.jar'])
// implementation name: 'saxon-ee-10.6'
implementation fileTree(include: ['*.jar'], dir: './libs/SaxonEE10-6J')
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.apache.nifi:nifi-mock:1.15.0'
}
test {
useJUnitPlatform()
}
我想使用 Saxon-EE jar,但在任何 Web 存储库上都没有。
我无法导入
import net.sf.saxon.s9api.*;
如果我使用 Saxon-HE 那么它工作正常,但我想使用任何网络存储库上都没有的许可版本
I want to include jar files locally in gradle, I have created a libs folder and added the jars there. the jars are added to the class path but I am not able to access the api.
my build.gradle :
plugins {
id 'java'
id 'io.github.lhotari.gradle-nar-plugin' version '0.5.1'
}
group 'com.acs.contentlake.nifi'
version '1.0'
repositories {
mavenCentral()
gradlePluginPortal()
maven {
url("https://mvnrepository.com/artifact/apache-xerces/resolver")
}
flatDir {
dirs 'libs'
}
}
compileJava{
sourceCompatibility('8')
targetCompatibility('8')
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
implementation group: 'org.apache.nifi', name: 'nifi-api', version: '1.15.0'
implementation group: 'org.apache.nifi', name: 'nifi-utils', version: '1.15.0'
// implementation group: 'net.sf.saxon', name: 'Saxon-HE', version: '10.6'
implementation group: 'xerces', name: 'xercesImpl', version: '2.9.1'
implementation group: 'apache-xerces', name: 'resolver', version: '2.9.1'
implementation 'org.codehaus.groovy:groovy-all:3.0.8'
// implementation files('libs/saxon-ee-10.6.jar', 'icu4j-59.1.jar', 'jline-2.14.6.jar', 'saxon-ee-test-10.6.jar', 'saxon-sql-10.6.jar')
// implementation fileTree(dir: 'libs', include: ['*.jar'])
// implementation name: 'saxon-ee-10.6'
implementation fileTree(include: ['*.jar'], dir: './libs/SaxonEE10-6J')
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.apache.nifi:nifi-mock:1.15.0'
}
test {
useJUnitPlatform()
}
I want to use Saxon-EE jars which are not available on any web repo.
I am unable to import
import net.sf.saxon.s9api.*;
If I use Saxon-HE then it is working fine, but I want to use the licensed edition which is not available on any web repo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
猜测,
filetree(包括:['*.jar'],dir:'./libs/saxonee10-6j')
没有做您认为的事情。我通常在此时尝试调试gradle文件是创建一个“ helloworld”任务,该任务打印了classpath: <代码>实现
。将其添加到您的
存储库中
关闭:然后您只需加载EE即可:
At a guess,
fileTree(include: ['*.jar'], dir: './libs/SaxonEE10-6J')
isn't doing what you think it is. What I usually do at this point trying to debug Gradle files is create a "helloWorld" task that prints the classpath:(Where you have to uncomment the lines and replace
jsbuild
with a local configuration that you derive fromimplementation
. I don't think you can access theimplementation
classpath directly for reasons I doubt I fully understand.)However, I can make this all much easier for you. Add this to your
repositories
closure:And then you can just load EE with Maven: