You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ol...@apache.org on 2020/04/10 02:34:16 UTC

[tomcat-taglibs-rdc] branch master updated: make this buildable in Jenkins

This is an automated email from the ASF dual-hosted git repository.

olamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat-taglibs-rdc.git


The following commit(s) were added to refs/heads/master by this push:
     new d9269f7  make this buildable in Jenkins
d9269f7 is described below

commit d9269f7b62d2568bb7f3f20ba667264fc25d8814
Author: olivier lamy <ol...@apache.org>
AuthorDate: Fri Apr 10 12:33:57 2020 +1000

    make this buildable in Jenkins
    
    Signed-off-by: olivier lamy <ol...@apache.org>
---
 .gitignore  |  2 ++
 Jenkinsfile | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 pom.xml     | 13 +++++++++++++
 3 files changed, 79 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ffac74e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+target/
+*.iml
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..dc0a883
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,64 @@
+#!groovy
+
+pipeline {
+  agent any
+  options {
+    durabilityHint('PERFORMANCE_OPTIMIZED')
+    buildDiscarder(logRotator(numToKeepStr: '7', artifactNumToKeepStr: '2'))
+    timeout(time: 60, unit: 'MINUTES')
+  }
+  stages {
+    stage( "Parallel Stage" ) {
+      parallel {
+        stage( "Build / Test - JDK8" ) {
+          agent { node { label 'ubuntu' } }
+          options { timeout( time: 120, unit: 'MINUTES' ) }
+          steps {
+            mavenBuild( "JDK 1.8 (latest)", "clean install" )
+            script {
+              if (env.BRANCH_NAME == 'master') {
+                mavenBuild( "JDK 1.8 (latest)", "deploy" )
+              }
+            }
+          }
+        }
+        stage( "Build / Test - JDK11" ) {
+          agent { node { label 'ubuntu' } }
+          options { timeout( time: 120, unit: 'MINUTES' ) }
+          steps {
+            mavenBuild( "JDK 11 (latest)", "clean install" )
+          }
+        }
+      }
+    }
+  }
+}
+
+
+
+/**
+ * To other developers, if you are using this method above, please use the following syntax.
+ *
+ * mavenBuild("<jdk>", "<profiles> <goals> <plugins> <properties>"
+ *
+ * @param jdk the jdk tool name (in jenkins) to use for this build
+ * @param cmdline the command line in "<profiles> <goals> <properties>"`format.
+ * @return the Jenkinsfile step representing a maven build
+ */
+def mavenBuild(jdk, cmdline) {
+  def mvnName = 'Maven 3.6.3'
+  //def localRepo = "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}" // ".repository" //
+  //def settingsName = 'oss-settings.xml'
+  def mavenOpts = '-Xms2g -Xmx2g -Djava.awt.headless=true'
+
+  withMaven(
+          maven: mvnName,
+          jdk: "$jdk",
+          publisherStrategy: 'EXPLICIT',
+          //globalMavenSettingsConfig: settingsName,
+          options: [junitPublisher(disabled: false)],
+          mavenOpts: mavenOpts) {
+    // Some common Maven command line + provided command line
+    sh "mvn -V -B -DfailIfNoTests=false -Dmaven.test.failure.ignore=true $cmdline"
+  }
+}
diff --git a/pom.xml b/pom.xml
index 6505dad..64ed010 100644
--- a/pom.xml
+++ b/pom.xml
@@ -143,4 +143,17 @@
     </dependencies> 
   </dependencyManagement>
 
+  <repositories>
+    <repository>
+      <id>apache.snapshots</id>
+      <url>https://repository.apache.org/content/repositories/snapshots/</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+
 </project>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org