Well...  Some of us, my team included, are using the Maven jobs in Jenkins and 
they generally works fine for our projects (and is much simpler to configure).  
Be warned that Maven 3.3 support is still busted for projects that use 
.mvn/maven.config waiting on https://issues.apache.org/jira/browse/MNG-5889 to 
be merged...


-----Original Message-----
From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] 
Sent: Thursday, October 13, 2016 9:16 AM
To: Maven Users List
Subject: Re: Jenkins and Maven

https://javaadventure.blogspot.ie/2013/11/jenkins-maven-job-type-considered-evil.html
is the message from your friendly neighbourhood Apache Maven PMC member and 
Jenkins committer!

Two options:
1. (oldschool) Freestyle Job with a Maven build step 2. (coolkids) Multibranch 
Pipeline Job with a Jenkinsfile in the repository... At present the Jenkinsfile 
will have to invoke Maven via a shell/batch step... which gets a tad ugly

node() {
  withMaven(...) {
  if (isUnix()) {
    sh 'mvn clean verify'
  } else {
    bat 'mvn clean verify'
  }
  junit '**/target/surefire-reports/*.xml, **/target/failsafe-reports/*.xml'
  // plus whatever else you are having yourself
  }
}

There is a dedicated `mvn` step in the works... not here yet... and there is a 
newer better syntax for Jenkinsfile in progress:
https://github.com/jenkinsci/pipeline-model-definition-plugin

So hopefully, you'll soon be able to do

pipeline {
  agent label:'linux'
  stages {
    stage('Build') {
      // the syntax to specify the Maven tool version is still in progress
      steps {
        mvn 'clean verify'
        // remains to be seen if the `mvn` step will auto-junit
      }
    }
  }
  notifications {
    always {
      mail ...
    }
  }
}

On 13 October 2016 at 14:59, Benson Margulies <bimargul...@gmail.com> wrote:

> We've about had it with bamboo, and are dusting off our old Jenkins 
> instance.
>
> I recall some messages here about things _not_ to do with Jenkins and 
> Maven. Do we avoid the 'maven build type' altogether and just run 
> Maven from the shell, or is my memory faulty? Anything else.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to