-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid pom is produced when using both the dependency management plugin and Gradle's bom support #257
Comments
This looks like a Gradle bug to me. This plugin only adds Lines 106 to 117 in a206b9a
There's also a test that verifies this behaviour: Lines 129 to 145 in a206b9a
If you have evidence to the contrary, please comment with it here and we can re-open the issue to investigate. Otherwise, I think this needs to be reported to the Gradle team. You could also avoid the problem by using either the dependency management plugin or Gradle's platform support, rather than mixing the two. |
Hello, |
Using implementation platform("my.company:dependencies:$version")
implementation platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion") Correctly publishes to Artifactory. |
Hi @acidbee , I am facing the same issue. Were you able to fix it? |
@piyush8098 Did you try the suggestion above?
|
I had the same problem when using In order to fix this I removed the awssdk:bom implementation and directly just referenced the AWS components I needed: Obviously less than ideal, but I wasn't able to get anything working that was already posted. |
I get the same issue while using dependencyManagement only. Groovytasks.withType(GenerateMavenPom).all {
doLast {
File file = new File("$buildDir/publications/maven/pom-default.xml")
def text = file.text
def pattern = "(?s)(<dependencyManagement>.+?<dependencies>)(.+?)(</dependencies>.+?</dependencyManagement>)"
Matcher matcher = text =~ pattern
if (matcher.find()) {
text = text.replaceFirst(pattern, "")
def firstDeps = matcher.group(2)
text = text.replaceFirst(pattern, '$1$2' + firstDeps + '$3')
}
file.write(text)
}
} Kotlintasks.withType<GenerateMavenPom>().all {
doLast {
val file = File("$buildDir/publications/maven/pom-default.xml")
var text = file.readText()
val regex = "(?s)(<dependencyManagement>.+?<dependencies>)(.+?)(</dependencies>.+?</dependencyManagement>)".toRegex()
val matcher = regex.find(text)
if (matcher != null) {
text = regex.replaceFirst(text, "")
val firstDeps = matcher.groups[2]!!.value
text = regex.replaceFirst(text, "$1$2$firstDeps$3")
}
file.writeText(text)
}
} |
thanks @FrogDevelopper 's solutions , it save my day. |
@FrogDevelopper excellent solution! thanks! |
omg thank you. you saved my friday. |
@wilkinsona Hello! |
@jvandort is correct (thank you, Justin). The tests didn't catch the problem as the name (returned as |
When including other BOMs in a build file, generating POMs for publishing artifacts include two dependency management nodes resulting in an invalid POM.
build.gradle.kts
Running a publish task results in an error
build/publications/jar/pom-default.xml
The text was updated successfully, but these errors were encountered: