开发者

Most effective way to go from Eclipse Project to Hudson Build

We want to use Hudson/Jenkins to build our project which is currently realized entirely in Eclipse. From what I can tell, there are various ways to go from A to B, or E to H, as it were: export as Ant script, export as Maven script, export as Runnable JAR while creating an Ant script for that, etc.

All of the above seem to have in common that between "This runs in Eclipse" and "Hudson produces something that runs" there are multiple steps which are independent, for example, you can change your project, commit to SVN and trigger a Hudson build, but unless you specifically remember to "Export as Ant Script" in between, it will fail.

Is there a "one in all" solution ? I'm not worried about the amount of clicks, but instead about the various steps in between that, to make matters worse, are only needed sometimes. In short: I am looking for something that goes from "I can click on the 'Run' button and it works" to "Hudson produces something that works" without every developer having to remember every optional step in between.

Ideas ?

Edit: All of the answers so far seem to suffer from the same issue: it's all parallel development. You have your Eclipse Run Configuration, and you have Maven/Ant/Whatever build. If you change your run config, you have to then remember later to change your Maven/Ant/Whatever build, commit it, and then HOPE that all other developers notice the change to the Maven/Ant/Whatever build during their daily SVN Update, manually open the file, inspect the changes and then duplicate those changes in their own run configs. That seems li开发者_运维问答ke it's just begging for bugs and mistakes, isn't there anything that's properly integrated with the Eclipse Run Configurations ?


Hudson can build Maven or Ant projects, so the first step is to get a reproducible build with either tool, which you only need to set up one time. Then you need to take that pom.xml or build.xml file and actually commit it to Subversion. This is necessary since Hudson won't open Eclipse and will instead use the command-line to execute a build.

Then you can setup a new Hudson job that will watch Subversion for any changes. Your developers can use their normal workflow, where they use Eclipse to do builds and commit changes to source control when they're ready. Hudson will see it and pull down a fresh copy of the code base, and then will do its own compile and will report back any problems.

Personally I prefer Maven2, since I know Hudson has solid integration with it and will do things like run your JUnit tests. Eclipse used to be painful with Maven, but now there's the m2eclipse plugin.


I'd try http://www.ant4eclipse.org/.

It allows you to build your eclipse project from an ant file. From the first paragraph here: http://www.ant4eclipse.org/node/6 it sounds very much like what you want. With ant4eclipse ant will access your eclipse project and then it should be able to build through Hudson.

The aim of the ant4eclipse project is to avoid (or at least: to reduce) the redundancy of Eclipse and Ant configurations. More precisly: it consists of Ant tasks that are able to read and work with some of Eclipse's configuration files.


Migrating to Maven, Hudson has great first class intergration with Maven.

Maven 3 + Archiva makes a very potent build system. Of course there are other Repository Managers but Archiva does just enough for what I need.

Once you get Maven, you really wonder how you did without it up until then. A dedicated private Repository Manager helps this greatly, that is why Archiva is important to the mix.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜