shippi
shippi

Reputation: 2474

Integrate maven project into jenkins which is versioned with svn

I just installed jenkins and want to use for my project as a build tool on a linux based server. I don't really have previous experiences with jenkins. What i managed so far is to create a simple maven project, checkout my source from the svn and build it. The jenkins checked out my project into its default workspace what i want to customise and move the source code management into the pom.xml.

I would like to put the svn repository url and the checkout directory into pom.xml and this should be relevant just for my server (linux machine). On all other environments i want to manage the checkout and build manually. (or from eclipse) Could I use maven profiles for this? If you know from the top of your head could you please provide me an example what maven plugin to use, how to profile it, and how to force jenkins to use that profile (and all of the environments to ignore this part of the pom.xml)

I am really new to this stuff therefore i would really appreciate any help. Thanks guys!

Upvotes: 0

Views: 767

Answers (1)

Piotr Gwiazda
Piotr Gwiazda

Reputation: 12222

You're doing it wrong way. Exactly opposite.

  1. Your project should always be built with mvn install. If you don't have good reason to use profiles - don't.
  2. Each developer can build the project by checking it out from svn and running mvn install. He/she should be able to use a directory and IDE of his/her choice.
  3. For Eclipse/NetBeans/IntelliJ there are plugins that just imports Maven projects.
  4. In Jenkins you create a Maven job (Mavne plug-in is distributed with standard package I guess). For a job you set a SVN sources URL and make him run mvn install. It's a good practice to set up mvn clean install on CI server.

Why do you need to change repository urls and directories? It's not a part of POM.

Upvotes: 2

Related Questions