How to *properly* switch from Maven-style jobs to Freestyle jobs?

1,723 views
Skip to first unread message

Victor Noël

unread,
Jun 8, 2015, 4:21:46 AM6/8/15
to jenkins...@googlegroups.com
Hi,

Following the switch to Java 7+, many users have problem with the Maven-style jobs: they are forbidden to execute them with a version of Java inferior to 7.
See for example https://issues.jenkins-ci.org/browse/JENKINS-28294.

The common solution proposed by people is to switch to Freestyle project: there is more configuration to do, but the behaviour of the build will be more deterministic (see http://javaadventure.blogspot.de/2013/11/jenkins-maven-job-type-considered-evil.html for example for more explanation of why anyway maven-style jobs apparently sucks).

So, my question now is: how do I properly switch to a freestyle project?

In particular, my main concern is with dependencies and build triggering:
 - I want to be able to see the tree of builds like this: http://jenkins.petalslink.com/job/Petals%20Components%20-%20BC%20SOAP/265/
 - I want to see upstream and downstream projects like this: http://jenkins.petalslink.com/job/Petals%20Components%20-%20BC%20SOAP/
 - I want my jobs to be triggered when one of its dependencies was built (and not by checking every hours if a dependency has changed as one of the jenkins plugins do).

Anybody has good suggestion to either do that, or to convince me I don't need it?

Thank you :)

Victor

Victor Noël

unread,
Jun 15, 2015, 5:50:25 AM6/15/15
to jenkins...@googlegroups.com
Anybody? It seems an important issue to me…

Thanks,

Victor

jieryn

unread,
Jun 15, 2015, 1:29:11 PM6/15/15
to Jenkins Users
There is no automated mechanism.
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/d5e12297-218e-4564-bad1-03cac3cf6250%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Jorg Heymans

unread,
Jun 9, 2016, 3:39:12 AM6/9/16
to Jenkins Users
Just want to add to this

- freestyle does not have "deploy artifacts" post build step
- freestyle does not have way to use a local maven repository per executor
- freestyle does not have an easy way to use the maven release plugin

So yeah maybe it's evil and has issues, but the maven job type is really the only viable option for projects that heavily depend on maven mechanics.

Jorg

Baptiste Mathus

unread,
Jun 12, 2016, 8:48:59 AM6/12/16
to jenkins...@googlegroups.com
We have 90% of Maven builds. And we switched from maven to freestyle years ago.
The things you list are not among the thing I miss, the only one I admit was great was being able to do incremental builds easily.

See inline below.

2016-06-09 9:39 GMT+02:00 Jorg Heymans <jorg.h...@gmail.com>:
Just want to add to this

- freestyle does not have "deploy artifacts" post build step

Is `mvn clean deploy -DdeployAtEnd=true` somewhat what you want?

What are you trying to achieve with that feature? I never used it, so I'm curious about the use case.

 
- freestyle does not have way to use a local maven repository per executor

maven step, advanced, use private repository. That's in the UI. 
 
- freestyle does not have an easy way to use the maven release plugin

That somewhat seems a definitive statement. As we do hundreds of maven releases using freestyle jobs. Could you give details?
You can easily set up either the M2 Release plugin or the more generic Release plugin to achieve that (we used the first, and nowadays have settled on the latter).

Victor Noël

unread,
Jun 12, 2016, 9:09:30 AM6/12/16
to Jenkins Users, m...@batmat.net
So Baptiste, how did you handle the matter of triggering build of dependent modules?
Do you have one job per module or is it more one job for a multimodule project without dependencies to other jobs's modules?

Here we have something like 200 jobs for 200 maven modules and we rely extensively on the triggering of dependent modules when one is updated... (for SNAPSHOT versions).

Thanks for your advices :)

Arnaud Héritier

unread,
Jun 12, 2016, 3:10:28 PM6/12/16
to jenkins...@googlegroups.com
On Sun, Jun 12, 2016 at 2:48 PM, Baptiste Mathus <m...@batmat.net> wrote:
We have 90% of Maven builds. And we switched from maven to freestyle years ago.
The things you list are not among the thing I miss, the only one I admit was great was being able to do incremental builds easily.

See inline below.

2016-06-09 9:39 GMT+02:00 Jorg Heymans <jorg.h...@gmail.com>:
Just want to add to this

- freestyle does not have "deploy artifacts" post build step

Is `mvn clean deploy -DdeployAtEnd=true` somewhat what you want?

What are you trying to achieve with that feature? I never used it, so I'm curious about the use case.

It doesn't work if you want to deploy all your artifacts only if your build pass AND you want also to launch all tests (-Dmaven.test.failure.ignore=true) to have a global overview of all failures if something goes wrong.
If you are using -Dmaven.test.failure.ignore=true and -DdeployAtEnd=true you'll deploy your artifacts when you have tests failures.
Maven doesn't allow to do this for now.


 
- freestyle does not have way to use a local maven repository per executor

maven step, advanced, use private repository. That's in the UI. 

No, there isn't the 'per executor' option which is the only option that allows to avoid conflicts of local repo access between jobs on the same agent and without consuming one repo per workspace. (Myself I prefer to use the private repo per job - thus per workspace - but I understand that the space used can be annoying)
See https://issues.jenkins-ci.org/browse/JENKINS-17471 for many others subtleties between freestyle and maven jobs and few others issues like

 
- freestyle does not have an easy way to use the maven release plugin

That somewhat seems a definitive statement. As we do hundreds of maven releases using freestyle jobs. Could you give details?
You can easily set up either the M2 Release plugin or the more generic Release plugin to achieve that (we used the first, and nowadays have settled on the latter).


So yeah maybe it's evil and has issues, but the maven job type is really the only viable option for projects that heavily depend on maven mechanics.

Jorg

Sadly Victor there is no automation to convert maven jobs to freestyle and there is no alternative for some features like the automatic triggering based on SNAPSHOTs, the post build deploy ..
 

For more options, visit https://groups.google.com/d/optout.



--
-----
Arnaud Héritier
Mail/GTalk: aheritier AT gmail DOT com
Twitter/Skype : aheritier
Reply all
Reply to author
Forward
0 new messages