「uploadArchives」を使用してアーカイブをアップロードすると、「POM pom-default.xml を初期化できません: POM の検証に失敗しました」というメッセージが表示されます。maven-publish プラグインも試しましたが、まだ運がありません。どんな助けでも感謝します。
以下は私のgradle.buildファイルです:
buildscript {
ext {
springBootVersion = '1.2.6.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath('io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE')
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'maven'
apply plugin: 'signing'
jar {
baseName = 'zmailapp'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-ws')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.lau ncher.StandardVMType/JavaSE-1.8'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.7'
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
group = "com.adadyn"
archivesBaseName = "zmailapp"
version = "0.0.1-SNAPSHOT"
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy /maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'ZmailApp'
packaging 'jar'
// optionally artifactId can be defined here
description 'A application used as an example on how to set up pushing its components to the Central Repository.'
url 'http://zmailapp.com'
scm {
connection 'scm:git:https://github.com/zishan2050/ZmailApp'
developerConnection 'scm:git:https://github.com/zishan2050/ZmailApp'
url 'https://github.com/zishan2050/ZmailApp'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'manfred'
name 'Manfred Moser'
email 'manfred@sonatype.com'
}
}
}
}
}
}