我有一个gradle文件,该文件可以在某些古老的gradle版本中使用,但我想升级到gradle 5.0。不幸的是,它使用常春藤而不是maven来发布其jar。我将其简化为一个简单的测试用例。
我不确定是否遗漏了某些东西或它的错误或什么。我已经在下面附上了gradle。我正在运行
./gradlew wrapper && ./gradlew publish --info && cat build/publications/ivy/ivy.xml
也许有一种新的处理方式,但是如果这样,我就找不到其记录的地方。这是源build.gradle。
plugins {
id 'java'
id 'ivy-publish'
}
sourceSets {
testSupport {
java {
compileClasspath += main.output
runtimeClasspath += main.output
}
}
test {
java {
compileClasspath += testSupport.output
runtimeClasspath += testSupport.output
}
}
}
dependencies {
compile group: 'com.ibm.icu', name: 'icu4j', version: '58.2'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
compile group: 'io.swagger', name: 'swagger-parser', version: '1.0.32'
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
task testSupportJar(type: Jar) {
from sourceSets.testSupport.output
appendix "test-support"
}
task testSupportSourceJar(type: Jar) {
from sourceSets.testSupport.java.srcDirs
appendix "test-support-sources"
}
artifacts {
archives sourceJar
archives testSupportJar
archives testSupportSourceJar
}
publishing {
repositories {
ivy {
name = 'myRepo'
url = "file://${buildDir}/repo"
layout "pattern", {
artifact "[organisation]/[module]/[revision]/jars/[artifact].[ext]"
ivy "[organisation]/[module]/[revision]/ivys/ivy-[revision].xml"
}
}
}
publications {
ivy(IvyPublication) {
organisation = 'com.example.com'
// If you comment out the configurations below it will generate sensible ivy.xml
configurations {
"compile" {}
"runtime" {}
}
from components.java
artifact(sourceJar) {
type "source"
extension "src.jar"
conf "runtime"
}
}
}
}
wrapper {
// 4.7 works but 4.8+ doesn't.
gradleVersion = '4.7'
}
答案 0 :(得分:0)
哦,我刚刚想通了。其# go through the pagination links to access infinite scroll
next_page = response.css('div.paginator-control a::attr(href)').extract_first()
if next_page is not None:
next_page = response.urljoin(next_page)
yield scrapy.Request(next_page, callback=self.parse_item)
和from components.java
元素位的相对顺序。如果configurations
首先是configurations
的优先级,而后者似乎被忽略了。如果将from components.java
放在from components.java
前面,则可以使用,而不必手动声明默认情况下生成的配置。
FFS gradle。