Skip to content

Commit c8a7bbf

Browse files
authored
Merge pull request #14827 from jdaugherty/7.0.x
Support not adding components from the grails publish plugin
2 parents f219290 + bcc0495 commit c8a7bbf

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/publishing/GrailsPublishExtension.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ class GrailsPublishExtension {
9090
*/
9191
Closure pomCustomization
9292

93+
/**
94+
* If another process will add the components set this to false so only the publication is created
95+
*/
96+
Boolean addComponents = true
97+
9398
/**
9499
* The name of the publication
95100
*/

grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/publishing/GrailsPublishGradlePlugin.groovy

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,12 @@ Note: if project properties are used, the properties must be defined prior to ap
278278
delegate.artifactId = gpe.artifactId ?: project.name
279279
delegate.groupId = gpe.groupId ?: project.group
280280

281-
doAddArtefact(project, delegate)
282-
def extraArtefact = getDefaultExtraArtifact(project)
283-
if (extraArtefact) {
284-
artifact extraArtefact
281+
if(gpe.addComponents) {
282+
doAddArtefact(project, delegate)
283+
def extraArtefact = getDefaultExtraArtifact(project)
284+
if (extraArtefact) {
285+
artifact extraArtefact
286+
}
285287
}
286288

287289
pom.withXml {

0 commit comments

Comments
 (0)