[
https://issues.apache.org/jira/browse/BEAM-5351?focusedWorklogId=142873&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-142873
]
ASF GitHub Bot logged work on BEAM-5351:
----------------------------------------
Author: ASF GitHub Bot
Created on: 10/Sep/18 20:35
Start Date: 10/Sep/18 20:35
Worklog Time Spent: 10m
Work Description: charlesccychen closed pull request #6358: [BEAM-5351]
Fix missing pom.xml file in artifact jar.
URL: https://github.com/apache/beam/pull/6358
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
index c861588e1e3..d17f16ca5ed 100644
--- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
@@ -771,10 +771,11 @@ class BeamModulePlugin implements Plugin<Project> {
// Create a task which emulates the maven-archiver plugin in
generating a
// pom.properties file.
+ def pomPropertiesFile =
"${project.buildDir}/publications/mavenJava/pom.properties"
project.task('generatePomPropertiesFileForMavenJavaPublication') {
- outputs.file
"${project.buildDir}/publications/mavenJava/pom.properties"
+ outputs.file "${pomPropertiesFile}"
doLast {
- new
File("${project.buildDir}/publications/mavenJava/pom.properties").text =
+ new File("${pomPropertiesFile}").text =
"""version=${project.version}
groupId=${project.group}
artifactId=${project.name}
@@ -785,10 +786,23 @@ artifactId=${project.name}
// Have the shaded include both the generate pom.xml and its
properties file
// emulating the behavior of the maven-archiver plugin.
project.shadowJar {
+ def pomFile =
"${project.buildDir}/publications/mavenJava/pom-default.xml"
+
+ // Validate that the artifacts exist before copying them into the
jar.
+ doFirst {
+ if (!project.file("${pomFile}").exists()) {
+ throw new GradleException("Expected ${pomFile} to have been
generated by the 'generatePomFileForMavenJavaPublication' task.")
+ }
+ if (!project.file("${pomPropertiesFile}").exists()) {
+ throw new GradleException("Expected ${pomPropertiesFile} to have
been generated by the 'generatePomPropertiesFileForMavenJavaPublication' task.")
+ }
+ }
+
dependsOn 'generatePomFileForMavenJavaPublication'
- into("META-INF/maven/${project.group}/${project.name}") { from
"${project.buildDir}/publications/mavenJava/pom.xml" }
+ into("META-INF/maven/${project.group}/${project.name}") { from
"${pomFile}" }
+
dependsOn project.generatePomPropertiesFileForMavenJavaPublication
- into("META-INF/maven/${project.group}/${project.name}") { from
"${project.buildDir}/publications/mavenJava/pom.properties" }
+ into("META-INF/maven/${project.group}/${project.name}") { from
"${pomPropertiesFile}" }
}
// Only build artifacts for archives if we are publishing
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 142873)
Time Spent: 40m (was: 0.5h)
> 2.7.0 RC1 jars missing META-INF/maven/groupId/artifactId/pom.xml
> ----------------------------------------------------------------
>
> Key: BEAM-5351
> URL: https://issues.apache.org/jira/browse/BEAM-5351
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Affects Versions: 2.7.0
> Reporter: Luke Cwik
> Assignee: Charles Chen
> Priority: Major
> Attachments: beam-examples-java-2.7.0.jar
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> It seems as though **generatePomFileForMavenJavaPublication** pom.xml was
> renamed to pom-default.xml as output which broke the the shadowJar task
> [here|https://github.com/apache/beam/blob/883f01536440bdf9b582d785b6e609a4a90cfdff/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy#L788].
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)