gpt4 book ai didi

java - Gradle : Unable to initialize POM pom-default. xml:无法验证 POM

转载 作者:行者123 更新时间:2023-11-30 08:08:25 27 4
gpt4 key购买 nike

我在使用“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'
}
}
}
}
}
}

最佳答案

我通过在 gradle.build 文件的 pom.project{ } block 中添加以下代码解决了上述错误。

parent { 
groupId "org.springframework.boot"
artifactId "spring-boot-starter-parent"
version "${project.bootVersion}"
}

关于java - Gradle : Unable to initialize POM pom-default. xml:无法验证 POM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33142437/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com