Re: Jenkins and Maven

2016-10-13 Thread Olivier Lamy
Hehe
Thanks Benson to put some coins in the troll machine :-)
Well if evil is really ease the user's life so this plugin can be
considered evil :-)
You have some very convenient features such building dependent projects,
javadoc etc..
So it's just a matter of not spending too long on configuring Jenkins using
a ui :-)

Olivier (will not troll more)




On 14 October 2016 at 03:33, Manfred Moser  wrote:

> I agree with Stephen .. avoid the Maven job type. In fact I would install
> Daniel's
>
> https://github.com/daniel-beck/hide-maven-plugin\
>
> I have spent many hours trying to fix broken builds with the Maven job
> type only to switch to Freestyle jobs and they just work. There is a reason
> why Eclipse Hudson declared the job type legacy and has an improved Maven
> freestyle integration (but thats kind of beside the point when you look at
> Jenkins).
>
> Also in terms of settings management and such I suggest to use the config
> file provider plugin.
>
> I recorded a demo video about that stuff some while ago (for Sonatype in
> the context of deploying to Nexus but applies generically). Its part of the
> tips from the trenches series
>
> http://www.sonatype.org/nexus/members-only/video-gallery-2/
> free-training-sonatype-nexus-and-clm-tips-from-the-trenches/
>
> Here are the two Jenkins videos
>
> https://www.youtube.com/watch?v=JpXksHynouk
> https://www.youtube.com/watch?v=xHJrqKf0cLk
>
> Also if you want to invoke maven from a shell script or so you might want
> to look at the wrapper.
>
> https://github.com/takari/maven-wrapper
>
> Hth
>
> Manfred
>
>
>
> Benson Margulies wrote on 2016-10-13 06:59:
>
> > 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
>
>


Re: Jenkins and Maven

2016-10-13 Thread Manfred Moser
I agree with Stephen .. avoid the Maven job type. In fact I would install 
Daniel's 

https://github.com/daniel-beck/hide-maven-plugin\

I have spent many hours trying to fix broken builds with the Maven job type 
only to switch to Freestyle jobs and they just work. There is a reason why 
Eclipse Hudson declared the job type legacy and has an improved Maven freestyle 
integration (but thats kind of beside the point when you look at Jenkins).

Also in terms of settings management and such I suggest to use the config file 
provider plugin.

I recorded a demo video about that stuff some while ago (for Sonatype in the 
context of deploying to Nexus but applies generically). Its part of the tips 
from the trenches series

http://www.sonatype.org/nexus/members-only/video-gallery-2/free-training-sonatype-nexus-and-clm-tips-from-the-trenches/

Here are the two Jenkins videos

https://www.youtube.com/watch?v=JpXksHynouk
https://www.youtube.com/watch?v=xHJrqKf0cLk

Also if you want to invoke maven from a shell script or so you might want to 
look at the wrapper.

https://github.com/takari/maven-wrapper

Hth

Manfred



Benson Margulies wrote on 2016-10-13 06:59:

> 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



Re: Jenkins and Maven

2016-10-13 Thread Stephen Connolly
For pipeline you want to use the mavenLocalRepo property of the withMaven
step in the
https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Maven+Plugin

On 13 October 2016 at 16:41, Benson Margulies  wrote:

> So, here's a specific puzzle. I want to enable multiple branches in
> the Jenkins job and concurrent builds. How do I avoid two jobs trying
> to write the same local repo at the same time?
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


RE: Jenkins and Maven

2016-10-13 Thread Robert Patrick
To make concurrent Jenkins builds work, simply enable the "Use private Maven 
repository" option in the Jenkins Maven build jobs and select the appropriate 
"Strategy" (e.g., "Local to the workspace" or "Local to the executor").  This 
works fine for us...


-Original Message-
From: Nigel Magnay [mailto:nigel.mag...@gmail.com] 
Sent: Thursday, October 13, 2016 10:54 AM
To: Maven Users List
Subject: Re: Jenkins and Maven

You install
https://github.com/takari/takari-local-repository

Or fix the bug from, like, 2007 ?
https://issues.apache.org/jira/browse/MNG-2802

On Thu, Oct 13, 2016 at 4:41 PM, Benson Margulies <bimargul...@gmail.com>
wrote:

> So, here's a specific puzzle. I want to enable multiple branches in 
> the Jenkins job and concurrent builds. How do I avoid two jobs trying 
> to write the same local repo at the same time?
>
> -
> 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



Re: Jenkins and Maven

2016-10-13 Thread Nigel Magnay
You install
https://github.com/takari/takari-local-repository

Or fix the bug from, like, 2007 ?
https://issues.apache.org/jira/browse/MNG-2802

On Thu, Oct 13, 2016 at 4:41 PM, Benson Margulies 
wrote:

> So, here's a specific puzzle. I want to enable multiple branches in
> the Jenkins job and concurrent builds. How do I avoid two jobs trying
> to write the same local repo at the same time?
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Jenkins and Maven

2016-10-13 Thread Benson Margulies
So, here's a specific puzzle. I want to enable multiple branches in
the Jenkins job and concurrent builds. How do I avoid two jobs trying
to write the same local repo at the same time?

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



RE: Jenkins and Maven

2016-10-13 Thread Robert Patrick
I wasn't attacking your opinion or your credentials.  The lack of detailed 
justification for statements simply made me question how applicable they were 
to me (and others).  As such, I wanted to provide another point of view.  

Granted, the Maven jobs hide a lot of what they are doing so if your project 
does things that break the assumptions made by these jobs, then debugging it is 
probably challenging.  In my projects, I try to follow the KISS principle in 
designing and implementing my builds.  I have yet to meet a project where the 
Maven job did not work for me unless I ran into a Maven bug/limitation (like 
MNG-5889).


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

When they work, they work... when they don't work they blow up in your face... 
and they break how maven is supposed to work... so anyone that actually has a 
good understanding of Maven will be surprised by the evil things the evil one 
does...

Having been a Jenkins committer since 2006, and given that my day job is 
actually developing Jenkins... feel free to take my opinions however you see fit

On 13 October 2016 at 15:24, Robert Patrick <robert.patr...@oracle.com>
wrote:

> 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
>
>

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



Re: Jenkins and Maven

2016-10-13 Thread Stephen Connolly
When they work, they work... when they don't work they blow up in your
face... and they break how maven is supposed to work... so anyone that
actually has a good understanding of Maven will be surprised by the evil
things the evil one does...

Having been a Jenkins committer since 2006, and given that my day job is
actually developing Jenkins... feel free to take my opinions however you
see fit

On 13 October 2016 at 15:24, Robert Patrick <robert.patr...@oracle.com>
wrote:

> 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
>
>


RE: Jenkins and Maven

2016-10-13 Thread Robert Patrick
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



Re: Jenkins and Maven

2016-10-13 Thread Benson Margulies
Thanks, Stephen.

Now, if surefile would stop failing with:

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.18:test
(default-test) on project rosapi-front-end-anvils-transport: Execution
default-test of goal
org.apache.maven.plugins:maven-surefire-plugin:2.18:test failed.
NullPointerException -> [Help 1]

after printing its summary message, all would be well.


On Thu, Oct 13, 2016 at 10:16 AM, swapnil barwat
 wrote:
> +1 for pipeline build.
>
> On Thu, Oct 13, 2016 at 10:15 AM, Stephen Connolly <
> stephen.alan.conno...@gmail.com> wrote:
>
>> 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 
>> 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
>> >
>> >
>>
>
>
>
> --
> regards..
> Swapnil Barwat

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



Re: Jenkins and Maven

2016-10-13 Thread swapnil barwat
+1 for pipeline build.

On Thu, Oct 13, 2016 at 10:15 AM, Stephen Connolly <
stephen.alan.conno...@gmail.com> wrote:

> 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 
> 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
> >
> >
>



-- 
regards..
Swapnil Barwat


Re: Jenkins and Maven

2016-10-13 Thread Stephen Connolly
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  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
>
>