我无法初始化POM pom-default.xml:无法验证POM'使用' uploadArchives'上传档案时。我也尝试了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'
}
}
}
}
}
}
答案 0 :(得分:3)
我在gradle.build文件的pom.project {}块中添加了以下代码,解决了上述错误。
parent {
groupId "org.springframework.boot"
artifactId "spring-boot-starter-parent"
version "${project.bootVersion}"
}