我有一个使用Gradle(1.12)创建jar文件的非常简单的spring-boot(1.0.2)示例(基于http://spring.io/guides/gs/rest-service/)。
我正在尝试使用maven或maven-publish gradle插件构建并发布到本地Maven存储库,但出现错误:
Unable to initialize POM pom-default.xml: Failed to validate POM for project ngdc.sample:hello-springboot at /Users/jcc/Documents/stash/hello-springboot/build/poms/pom-default.xml
而且不明白为什么。版本,组和archivesBaseName都在build.gradle中指定。一个不依赖SpringBoot的类似项目也可以正常工作。
有人可以建议出什么问题吗?
谢谢!
- 约翰
最佳答案
您可能需要确保也指定了父pom或依赖项管理(取决于您的配置,但是如果您使用的是Spring Boot Gradle插件,则可能确实需要它)。此处的示例:https://github.com/spring-projects/spring-boot/blob/master/spring-boot-integration-tests/spring-boot-gradle-tests/src/test/resources/installer.gradle
install {
repositories.mavenInstaller {
pom.project {
parent {
groupId 'org.springframework.boot'
artifactId 'spring-boot-starter-parent'
version "${project.bootVersion}"
}
}
}
}
关于gradle - 使用Gradle和Spring Boot时无法发布到本地Maven存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23665976/