[ 
https://issues.apache.org/jira/browse/BEAM-11068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17215696#comment-17215696
 ] 

Michael Luckey commented on BEAM-11068:
---------------------------------------

Iiuc, we try to replace 'generatePomFileForMavenJavaPublication' with our own 
pom file generation.

So, as a quick fix, we might be able to just overwrite that pom created by 
appending to given task, unless u did try that already.

e.g. something like changing from
{noformat}
// We want to use our own pom.xml instead of the generated one, so we disable
// the pom.xml generation and have the publish tasks depend on `copyPom` 
instead.
tasks.whenTaskAdded { task ->
  if (task.name == 'generatePomFileForMavenJavaPublication') {
    task.enabled = false
  } else if (task.name.startsWith('publishMavenJavaPublication')) {
    task.dependsOn copyPom
  }
}
{noformat}
{noformat}
// We want to use our own pom.xml instead of the generated one, so we disable
// the pom.xml generation and have the publish tasks depend on `copyPom` 
instead.
tasks.whenTaskAdded { task ->
  if (task.name == 'generatePomFileForMavenJavaPublication') {
    task.doLast {
     copy {
       from 'pom.xml.template'
       into mavenJavaDir
       rename 'pom.xml.template', 'pom-default.xml'
      expand(version: project.version, modules: bomModuleNames)
     }   
   }
  } else if (task.name.startsWith('publishMavenJavaPublication')) {
    task.dependsOn copyPom
  }
}
{noformat}
This should just overwrite the pom generated by the task with our own version. 
Of course we could consider to clear tasks actions first, but this probably 
does not make much of a difference.

But this is neither a 'valid' solution nor guaranteed to work at all. As hacked 
right of my head, the code most likely is broken and need to be adjusted but I 
hope u get the idea.



> beam-sdks-java-bom.pom cannot be signed after upgrade to Gradle 6
> -----------------------------------------------------------------
>
>                 Key: BEAM-11068
>                 URL: https://issues.apache.org/jira/browse/BEAM-11068
>             Project: Beam
>          Issue Type: Improvement
>          Components: build-system
>            Reporter: Robin Qiu
>            Assignee: Kenneth Knowles
>            Priority: P1
>             Fix For: 2.26.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> I am working on creating Beam 2.25.0 RC1. The repo I created 
> (https://repository.apache.org/#stagingRepositories) failed to close because:
> Missing Signature: 
> '/org/apache/beam/beam-sdks-java-bom/2.25.0/beam-sdks-java-bom-2.25.0.pom.asc'
>  does not exist for 'beam-sdks-java-bom-2.25.0.pom'.
> I checked pom files in other modules and their signatures are present, so I 
> think this problem only happens to beam-sdks-java-bom-2.25.0.pom. Also this 
> has not happened in previous releases. I suspect this is caused by the recent 
> upgrade to Gradle 6.
> I found that 
> https://github.com/apache/beam/blob/master/sdks/java/bom/build.gradle does 
> something special. It does not use a generated pom, instead it uses its own 
> template and copies that to sdks/java/bom/build/publications/mavenJava/ as 
> pom-default.xml. When I run the publish task locally, I found in 
> sdks/java/bom/build/publications/mavenJava/ that the pom-default.xml is 
> signed (i.e. pom-default.xml.asc is present), but 
> beam-sdks-java-bom-2.25.0.pom is not signed (i.e. 
> beam-sdks-java-bom-2.25.0.pom.asc is not present) in the output repository.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to