[ 
https://issues.apache.org/jira/browse/BEAM-3256?focusedWorklogId=87592&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-87592
 ]

ASF GitHub Bot logged work on BEAM-3256:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Apr/18 15:32
            Start Date: 04/Apr/18 15:32
    Worklog Time Spent: 10m 
      Work Description: lukecwik closed pull request #5014: BEAM-3256 Add 
archetype testing/generation to existing GradleBuild Pr…
URL: https://github.com/apache/beam/pull/5014
 
 
   

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/.test-infra/jenkins/job_beam_PreCommit_Java_GradleBuild.groovy 
b/.test-infra/jenkins/job_beam_PreCommit_Java_GradleBuild.groovy
index df416359ed8..c5edbf1bf67 100644
--- a/.test-infra/jenkins/job_beam_PreCommit_Java_GradleBuild.groovy
+++ b/.test-infra/jenkins/job_beam_PreCommit_Java_GradleBuild.groovy
@@ -44,6 +44,8 @@ job('beam_PreCommit_Java_GradleBuild') {
     '--continue',
     // Until we verify the build cache is working appropriately, force 
rerunning all tasks
     '--rerun-tasks',
+    // Specify maven home on Jenkins
+    '-Pmaven_home=/home/jenkins/tools/maven/apache-maven-3.5.2'
   ]
 
   def gradle_command_line = './gradlew ' + gradle_switches.join(' ') + ' 
:javaPreCommit'
diff --git a/build.gradle b/build.gradle
index ad58db61eeb..15cab675a2b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -168,6 +168,8 @@ task javaPreCommit() {
   dependsOn ":rat"
   dependsOn ":sdks:java:core:buildNeeded"
   dependsOn ":sdks:java:core:buildDependents"
+  dependsOn ":sdks:java:maven-archetypes:examples:archetypesTest"
+  dependsOn ":sdks:java:maven-archetypes:starter:starterTest"
   dependsOn ":examples:java:preCommit"
 }
 
diff --git a/sdks/java/maven-archetypes/examples/build.gradle 
b/sdks/java/maven-archetypes/examples/build.gradle
index c701303c2be..47699e9ed1e 100644
--- a/sdks/java/maven-archetypes/examples/build.gradle
+++ b/sdks/java/maven-archetypes/examples/build.gradle
@@ -55,6 +55,17 @@ task generateSources(type: Exec) {
   commandLine './generate-sources.sh'
 }
 
+// Add archetype testing/generation to existing GradleBuild PreCommit
+// https://issues.apache.org/jira/browse/BEAM-3256
+task archetypesTest(type: Exec) {
+  if (project.hasProperty("maven_home")) {
+    commandLine "${maven_home}/bin/mvn", 'clean', 'install'
+    environment "MAVEN_HOME", "${maven_home}"
+  } else {
+    commandLine 'mvn', 'clean', 'install'
+  }
+}
+
 sourceSets {
  main {
   output.dir('src', builtBy: 'generateSources')
diff --git a/sdks/java/maven-archetypes/starter/build.gradle 
b/sdks/java/maven-archetypes/starter/build.gradle
index a7a5bd5d29f..a3fb3831a6e 100644
--- a/sdks/java/maven-archetypes/starter/build.gradle
+++ b/sdks/java/maven-archetypes/starter/build.gradle
@@ -21,6 +21,15 @@ applyJavaNature(artifactId: 
"beam-sdks-java-maven-archetypes-starter")
 
 description = "Apache Beam :: SDKs :: Java :: Maven Archetypes :: Starter"
 
+task starterTest(type: Exec) {
+  if (project.hasProperty("maven_home")) {
+    commandLine "${maven_home}/bin/mvn", 'clean', 'install'
+    environment "MAVEN_HOME", "${maven_home}"
+  } else {
+    commandLine 'mvn', 'clean', 'install'
+  }
+}
+
 dependencies {
   shadow project(path: ":runners:direct-java", configuration: "shadow")
   shadow project(path: ":sdks:java:core", configuration: "shadow")


 

----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 87592)
    Time Spent: 2h  (was: 1h 50m)

> Add archetype testing/generation to existing GradleBuild PreCommit
> ------------------------------------------------------------------
>
>                 Key: BEAM-3256
>                 URL: https://issues.apache.org/jira/browse/BEAM-3256
>             Project: Beam
>          Issue Type: Sub-task
>          Components: build-system
>            Reporter: Luke Cwik
>            Assignee: yifan zou
>            Priority: Major
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> This build currently is not exercising the archetype build and tests 
> https://github.com/apache/beam/blob/master/.test-infra/jenkins/job_beam_PreCommit_Java_GradleBuild.groovy
> found here:
> https://github.com/apache/beam/tree/master/sdks/java/maven-archetypes



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to