我是使用Gradle和Artifactory的新手,并且我使用了一个从此example site无法正常工作的示例,我收到此错误消息:
Extension of type 'PublishingExtension' does not exist. Currently registered extension types: [DefaultExtraPropert iesExtension, DefaultArtifactPublicationSet_Decorated, ReportingExtension_Decorated, DefaultProjectComponentContai ner_Decorated, DefaultProjectSourceSet_Decorated, DefaultBinaryContainer_Decorated]
我在这一行有一个错误:
defaults{
publications ('mavenJava')
}
有人可以帮我解决这个问题,我已经在这个问题上停留了很长时间了。
在按照JBaruch的建议检查链接并与代码进行比较之后,我更改了插件,但仍然存在相同的问题。也许我有些困惑?
(这就是为什么我将发布整个源代码)
buildscript {
repositories {
maven {
url 'http://.../artifactory/libs-release'
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
name = "maven-main-cache"
}
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1"
}
}
apply plugin: 'scala'
apply plugin: 'maven-publish'
apply plugin: "com.jfrog.artifactory"
version = '1.0.0-SNAPSHOT'
group = 'com.buransky'
repositories {
add buildscript.repositories.getByName("maven-main-cache")
}
dependencies {
compile 'org.scala-lang:scala-library:2.11.2'
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.useAnt = false
}
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = 'libs-snapshot-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
defaults{
publications ('mavenJava')
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
非常感谢你
最佳答案
您没有应用maven-publish
插件应该提供的artifactory
插件。
请查看the documentation,this answer也可能会有所帮助(请注意,插件名称会更改)。
关于gradle - Gradle Artifactory发布错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28585727/