|
Building Hudson requires JDK1.6.x and Maven 2.x. To build Hudson so that you can make modifications, follow the steps below: // check out the workspace $ svn co https://svn.dev.java.net/svn/hudson/trunk/hudson $ svn co https://svn.dev.java.net/svn/hudson/trunk/www $ cd hudson // use maven2 for build $ mvn install If it asks for username/password, you can either use your java.net ID, or simply specify "guest" as the user name and empty password.
The first build will take a while, because it has to download million jars from all over the world. You'll also need to have Java6 to build Hudson (even though Hudson will run on Java5. Mac users, try Soylatte or Apple has a developer preview of Java6 you can download from the Developer Connection)
At the end you should have hudson/main/war/target/hudson.war, which is the hudson you just built.
Configure work environmentTo work on the Hudson code productively, you should generate your IDE project files (note: these commands run maven offline (i.e. -o), which is faster but might not work correctly if you have not just run a "mvn install"): // if you are using IntelliJ $ mvn -DdownloadSources=true idea:idea // if you are using Eclipse $ mvn -DdownloadSources=true eclipse:eclipse NetBeans users should consider using this NetBeans module for working with Hudson. There is a step-by-step guide to working with Eclipse once you've run the above commands. Due to a bug in Eclipse, Eclipse users may need to remove src/main/resources from the source folder list after projects are imported to the workspace. See this e-mail thread for more details. Debugging HudsonMaven Jetty plugin offers a convenient debugging environment, but for a few reasons we maintain a modified version of the plugin under a different name, so the plugin name is different but the configuration parameters are the same. Do the following to run Hudson under the debugger, and open http://localhost:8080/ in your browser: $ cd main/war $ export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n" $ mvn hudson:run This will launch maven with the debugger port for 8000. You can connect to this port from your IDE by using the remote debug feature. Once this starts running, keep it running. Jetty will pick up all the changes automatically. 1. When you make changes to view files in core/src/main/resources, just hit F5 in your browser to see the changes. Other Tips1. Consider running Maven like mvn -o ... to avoid hitting repositories every time. This will make various operations considerably faster. CreditsThe sponsor statement from YourKit Java Profiler, which gave us a free license for the Hudson project.
|

Comments (1)
about 7 hours ago
Karl Palsson says:
Under debugging hudson, have you got any advice on how to debug plugins?Under debugging hudson, have you got any advice on how to debug plugins?