Getting A Build Process In Place

Discussion in 'Java' started by Lee Theobald, Dec 7, 2012.

  1. Lee Theobald

    Lee Theobald Guest

    Hi all,

    I'm trying to get our company build process a little more automated and would appreciate some feedback on where to direct our attention. The current build process works as follows:

    - Projects are normally web applications packaged in wars. We use Maven tomanage dependencies etc. & the code is stored in SVN.
    - Within our pom.xml, we have a number of Maven profiles. There is normally a "shared" profile that contains the majority of the configuration for the application (put in place with the resources plugin) followed by a more environment specific profile (dev, staging, production etc.) containing additional information.
    - When it comes to building for an environment, a developer will build a war file on his local machine using a machine command similar to "mvn -P shared,production clean package".
    - This gives the developer a war file. They then SCP these up to the relevant server, extract to a Tomcat & restart that Tomcat.

    This is working fine but there's a lot of room for improvement. Recently we've looked at using Jenkins for continuous integration but haven't got toofar with it.

    So here are the points I'm wondering about:

    1) Are Maven profiles the best way of storing this specific environment? The pom's are certainly getting bloated with a lot of configuration & this can be quite intimidating to a newbie. Any suggestions on alternatives
    2) The whole devops movement seems to be something that could help me out here but I'm not too sure where to start. I've heard about a pipeline usingsomething along the lines of Maven --> Jenkins --> Puppet working well. With Jenkins handling the build & Puppet deploying. Does anyone have any experience with this?

    Cheers for any input
    Lee,
    Lee Theobald, Dec 7, 2012
    #1
    1. Advertising

  2. Lee Theobald

    Arne Vajhøj Guest

    On 12/7/2012 5:36 AM, Leif Roar Moldskred wrote:
    > In my personal opinion, although Maven does a pretty good job of
    > dependency management, it's not a very good _build_ tool, in part
    > because Maven's profiles is a cumbersome, awkward way to manage
    > environment configurations.
    >
    > I much prefer the new generation of build systems such as Gradle or
    > Buildr which combines Maven style dependency management and sensible
    > defaults with a programmatic approach. (That said, the greater
    > flexibility and ease-of-change of these tools might require a little
    > more self-discipline when developing the builds of your projects to
    > keep them from becoming a mess of special rules and exceptions.)


    I would be tempted to say that the biggest problem of Maven is
    that it has to be "the Maven way" and the biggest benefit of Maven
    is that it has to be "the Maven way".

    :)

    Arne
    Arne Vajhøj, Dec 8, 2012
    #2
    1. Advertising

  3. Lee Theobald

    Roedy Green Guest

    On Fri, 7 Dec 2012 02:06:39 -0800 (PST), Lee Theobald
    <> wrote, quoted or indirectly quoted someone who
    said :

    >
    >I'm trying to get our company build process a little more automated and wou=
    >ld appreciate some feedback on where to direct our attention. The current =
    >build process works as follows:


    The way I do it is use a Java program to stomp out ANT scripts. This
    way I have to specify a bare minimum to build a project and I can
    change the way every build script works by changing one line of code.

    ANT is very quick at compiling because it loads javac only once. It
    also has GenJar which figures out by itself what to include in the
    Jar.

    I can't compare it with Maven. Maven docs did not speak to me in the
    terms I wanted to understand what it does before I would invest in the
    learning curve.


    ANT is preposterously verbose, but at least is its comprehensible.
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    Students who hire or con others to do their homework are as foolish
    as couch potatoes who hire others to go to the gym for them.
    Roedy Green, Dec 8, 2012
    #3
  4. In <> Lee Theobald wrote:

    > I'm trying to get our company build process a little more automated and
    > would appreciate some feedback on where to direct our attention. The
    > current build process works as follows. Projects are normally web
    > applications packaged in wars. We use Maven to manage dependencies.


    I agree that using profiles in maven builds is rather verbose and not very
    simple to work with. I'd almost consider profiles a necessary evil that should
    only be considered as a feature of last resort.

    Have you considered using separate modules, all depending on or using the
    base project as a parent? I think this approach is easier, it is straight
    forward to understand that a separate module has different configuration
    files, compared to how hard it is to perceive how a combination of profiles
    affects a build.

    What I usually do is to have a base module that contains the source code and
    the development environment configuration. Then you have separate modules
    for the integration test environment and production environment, each with
    their set of configuration files that overrides the ones in the base module.

    If you want to you can set this up as a multi module project, ie parent that
    contains submodules development, integration, and production. Though
    multi-module projects have their own gotchas, so if you want to keep it
    simple, start by just make separate standard modules with dependencies.

    BTW, I hope you are aware that when you declare a dependency of type war,
    the war is unpacked, including web resources, in the dependent project. That
    means that your jsp-files can be maintained in the base module, they do not
    have to be copied or version managed separately in the dependent modules.

    https://maven.apache.org/plugins/maven-war-plugin/overlays.html

    Using Jenkins is indeed a good idea too. Though the purpose of using a
    continuous build system, to me at least, is orthogonal to the goal of
    having a transparent build configuration. Jenkins runs the slow and boring
    integration tests and reminds you that you forgot to add that new source
    file in your last commit before you pushed. It doesn't by it self make your
    build configuration more understandable.

    Maybe even the opposite? If you set up Jenkins to compile your rather
    complicated build targets, so that you seldom have to do it yourself, then
    you are confronted with that complexity less often and forget how it works.
    You might end up with a cargo cult based build configuration.

    --
    Fredrik Jonson
    Fredrik Jonson, Dec 8, 2012
    #4
  5. Lee Theobald

    Arne Vajhøj Guest

    On 12/8/2012 3:51 AM, Roedy Green wrote:
    > On Fri, 7 Dec 2012 02:06:39 -0800 (PST), Lee Theobald
    > <> wrote, quoted or indirectly quoted someone who
    > said :
    >> I'm trying to get our company build process a little more automated and wou=
    >> ld appreciate some feedback on where to direct our attention. The current =
    >> build process works as follows:

    >
    > The way I do it is use a Java program to stomp out ANT scripts. This
    > way I have to specify a bare minimum to build a project and I can
    > change the way every build script works by changing one line of code.


    Ant has built in ways to achieve that.

    Arne
    Arne Vajhøj, Dec 9, 2012
    #5
  6. Lee Theobald

    Lee Theobald Guest

    Thanks for the responses everyone. You've given me a few threads to investigate.
    Lee Theobald, Jan 24, 2013
    #6
  7. Lee Theobald

    Roedy Green Guest

    On Thu, 24 Jan 2013 01:45:21 -0800 (PST), Lee Theobald
    <> wrote, quoted or indirectly quoted someone who
    said :

    >Thanks for the responses everyone. You've given me a few threads to investigate.


    see http://mindprod.com/jgloss/ant.html

    Maven is more abstract.
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    The first 90% of the code accounts for the first 90% of the development time.
    The remaining 10% of the code accounts for the other 90% of the development
    time.
    ~ Tom Cargill Ninety-ninety Law
    Roedy Green, Jan 27, 2013
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Srinvias Vikram
    Replies:
    2
    Views:
    356
    Cindy M -WordMVP-
    Jun 20, 2004
  2. =?Utf-8?B?SXJmYW4gQWtyYW0=?=

    Getting the page to display at the right place..

    =?Utf-8?B?SXJmYW4gQWtyYW0=?=, Dec 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    282
    =?Utf-8?B?SXJmYW4gQWtyYW0=?=
    Dec 27, 2004
  3. John Shum
    Replies:
    0
    Views:
    1,501
    John Shum
    Oct 10, 2005
  4. Gergely Buday

    getting jar file's place

    Gergely Buday, May 27, 2004, in forum: Java
    Replies:
    3
    Views:
    432
    Michiel Konstapel
    May 31, 2004
  5. Joe Van Dyk
    Replies:
    6
    Views:
    165
    Csaba Henk
    Apr 2, 2005
Loading...

Share This Page