PrerequisitesBuilding Jenkins requires at minimum, a fairly recent version of JDK 1.6 (JRE will not suffice, and there are reports indicating that 6u17 was not sufficiently new), as well as Maven (3.0.4+). alias jdk6='export JAVA_HOME=$JAVA_6_HOME ; export PATH=$JAVA_6_HOME/bin:$PATH' Issues:
Configure work environmentTo checkout Jenkins, follow the steps below. Then run Maven build at least once to have it generate additional source files: // check out the workspace $ git clone https://github.com/jenkinsci/jenkins.git // Download dependencies and build with Maven // Note: mvn install may be a prerequisite for other mvn targets $ cd jenkins $ mvn -Plight-test install The git repository mentioned above is where the core of Jenkins is located, i.e. not the plugins. In the root of the repository is a file called changelog.html, which you should update if/when you become a committer. The first build will take a while, because it has to download all needed dependencies and plugins from Maven central.
EclipseYou can either use M2Eclipse/m2e to import the Maven projects directly or create Eclipse project files from the command line and then import the projects into Eclipse. There's no consensus in the community as to which approach is better. Experienced Maven users seem to prefer m2eclipse, but people new to Maven seem to find the latter easier and more predictable. For the latter do: // generate .project and .classpath for Eclipse $ mvn -DdownloadSources=true eclipse:eclipse There is a step-by-step guide to working with Eclipse once you've run the above commands. NetBeans/Intellij IDEANetBeans (6.7+) users can just open the POM directly, with File -> Open Project and navigate to the jenkins folder. IntelliJ IDEA users can directly open a Maven POM.
Debugging JenkinsMaven 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. First you need to add org.jenkins-ci.tools as a plugin group to your maven settings.xml file, as described in Plugin tutorial#SettingUpEnvironment. Then do the following to run Jenkins under the debugger, and open http://localhost:8080/ in your browser: # To change the port run mvnDebug jenkins-dev:run -Dport=9090 $ cd war $ mvnDebug jenkins-dev: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.
If you are developing plugins and want to test them see Plugin Structure#Testing With Jenkins Other Tips
CreditsThe sponsor statement from YourKit Java Profiler, which gave us a free license for the Hudson project.
|
Building Jenkins
Skip to end of metadata
Go to start of metadata
Comments (22)
Jul 08, 2008
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?
Aug 26, 2008
Kohsuke Kawaguchi says:
See Plugin tutorial for how to develop and debug plugins.See Plugin tutorial for how to develop and debug plugins.
Dec 08, 2010
RaghavendraSiddappa says:
when I try to add AuthType SSPI SSPIAuth On SSPIAuthoritative On SSPIOf...when I try to add
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
SSPIOfferBasic On
SSPIBasicPreferred On
to my subversion.conf file so that subversion and hudson are integrated/configured, and try to re-start my subversion is failing, Kindly suggest. Currently my subversion.conf file looks like:
<Location /svn>
DAV svn
SVNListParentPath On
SVNParentPath C:/Users/Raja/svn-repos
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile c:\etc\svn-auth-file
Require valid-user
AuthzSVNAccessFile c:/etc/svn-acl
</Location>
Appreciate your help/suggestion....
Nov 26, 2008
yongjun says:
I have a question about the IDE eclipse. I followed the build steps and download...I have a question about the IDE eclipse. I followed the build steps and downloaded hudson source codes. If I use eclipse3.2, build always failed. The common error is 'some type is collides with a package". Then I change to eclipse3.4, there are still some compile errors but I can deal with them finally.
So Kohsuke, may you suggest which IDE we can use for hudson development?
BTW, I am in solaris 10, x86. The top support Eclipse version is 3.2.
Thank you very much.
Jun 09, 2009
phecht - says:
Recently I have had issues with building. If I do this before hand, it wor...Recently I have had issues with building. If I do this before hand, it works fine.
Sep 01, 2009
Eric Badiere says:
This is my first attempt at building hudson and I am getting the following when ...This is my first attempt at building hudson and I am getting the following when I run 'mvn -o install' :
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.jvnet.hudson.tools:maven-hpi-plugin:1.31:apt-compile': Unable to find the mojo 'org.jvnet.hudson.tools:maven-hpi-plugin:1.31:apt-compile' in the plugin 'org.jvnet.hudson.tools:maven-hpi-plugin
Any help wold be appreciated.
Oct 14, 2009
Clifton Craig says:
I get a compile error when building from source: [INFO] [stapler:apt-compile] ...I get a compile error when building from source:
[INFO] [stapler:apt-compile]
[INFO] Compiling 561 source files to /Users/cliftoncraig07/java-apps/Hudson-src/hudson/main/core/target/classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Fatal error compiling
Embedded error: Error while executing the external compiler.
error=2, No such file or directory
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 31 seconds
[INFO] Finished at: Wed Oct 14 19:07:23 EDT 2009
[INFO] Final Memory: 65M/81M
[INFO] ------------------------------------------------------------------------
cliffmac:main cliftoncraig07$ javac -version
javac 1.6.0_13
Dec 02, 2009
Lucky Luke says:
Hi I am releatively new to Hudson. I get the following error when i try to run ...Hi
I am releatively new to Hudson. I get the following error when i try to run mvn -e install -Dmaven.test.skip=true
.
.
.
.
.
[INFO] [enforcer:display-info
]
[INFO] Maven Version: 2.1.0
[INFO] JDK Version: 1.6.0_13 normalized as: 1.6.0-13
[INFO] OS Info: Arch: x86 Family: windows Name: windows xp Version: 5.1
[INFO] [site:attach-descriptor]
[INFO] [install:install]
.
.
.
.
[resolveArtifact] Copying C:\Documents and Settings\rajesh.nair\.m2\repository\c
om\sun\winsw\winsw\1.8\winsw-1.8-bin.exe to D:\Java\EclipseWorkspace\svn\hudson{color}
trunk\hudson\main\core\target\classes\windows-service\hudson.exe
[INFO] Executed tasks
[INFO] [resources:resources]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2432 resources
[INFO] [stapler:apt-compile]
[INFO] Compiling 583 source files to D:\Java\EclipseWorkspace\svn\hudson\trunk\h
udson\main\core\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
D:\Java\EclipseWorkspace\svn\hudson\trunk\hudson\main\core\src\main\java\hudson{color}
os\windows\ManagedWindowsServiceLauncher.java:[51,0] cannot access org.kohsuke.j
interop.JIProxy
class file for org.kohsuke.jinterop.JIProxy not found
import static org.jvnet.hudson.wmi.Win32Service.Win32OwnProcess;
D:\Java\EclipseWorkspace\svn\hudson\trunk\hudson\main\core\src\main\java\hudson{color}
os\windows\ManagedWindowsServiceLauncher.java:[51,0] cannot access org.kohsuke.j
interop.JIProxy
class file for org.kohsuke.jinterop.JIProxy not found
import static org.jvnet.hudson.wmi.Win32Service.Win32OwnProcess;
D:\Java\EclipseWorkspace\svn\hudson\trunk\hudson\main\core\src\main\java\hudson{color}
os\windows\ManagedWindowsServiceLauncher.java:[140,64] cannot find symbol
symbol : method cast(java.lang.Class<org.jvnet.hudson.wmi.Win32Service>)
location: interface org.jvnet.hudson.wmi.SWbemObject
D:\Java\EclipseWorkspace\svn\hudson\trunk\hudson\main\core\src\main\java\hudson{color}
os\windows\ManagedWindowsServiceLauncher.java:[145,24] cannot find symbol
symbol : variable Win32OwnProcess
location: class hudson.os.windows.ManagedWindowsServiceLauncher
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:699)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:540)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:519)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:371)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:332)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation fail
ure
at org.kohsuke.stapler.AbstractCompilerMojo.execute(AbstractCompilerMojo
.java:508)
at org.kohsuke.stapler.CompilerMojo.execute(CompilerMojo.java:111)
at org.kohsuke.stapler.AptMojo.execute(AptMojo.java:21)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:678)
... 16 more
Can someone help me figure out what I am doing wrong?
Thanks,
LL
Sep 23, 2010
Vishal Jain says:
Any idea on the solution for above issue.? I am facing the same. :(Any idea on the solution for above issue.? I am facing the same. :(
Dec 18, 2009
Russ Hickingbottom says:
Ummm... I get an error on the very first step. Using svn at the CLI I get "svn:...Ummm... I get an error on the very first step.
Using svn at the CLI I get "svn: OPTIONS of 'https://svn.dev.java.net/svn/hudson/trunk/hudson': could not connect to server (https://svn.dev.java.net)"
I am behind a firewall here at work so I am looking into that but is there a possibility this url is incorrect?
Thanks,
Russ
Dec 18, 2009
Russ Hickingbottom says:
OK nevermind - it was the proxy after all. I had to set it up in my server...OK nevermind - it was the proxy after all. I had to set it up in my servers file for Subversion.
Mar 25, 2010
Mark Michaelis says:
I had problems checking out Hudson on Windows. Thanks to this post I found the r...I had problems checking out Hudson on Windows. Thanks to this post I found the reason and the solution: The problem is the 255 character limit of Windows which you can workaround with absolute paths. So on Windows you might want to call:
Still having problems that download is sometimes interrupted having problems to move the entries-file. Read some hints saying that the virus scanner might be the reason. But although I thought problems got better after I disabled the virus scanner the problems didn't not vanish completely.
Apr 26, 2010
tsobala says:
Mark, I guess I have the same problem, download is interrupted. Have you succeed...Mark, I guess I have the same problem, download is interrupted. Have you succeeded with it?
Jul 06, 2010
jasonrobinson - says:
Does the SVN repository have case sensitive file names? I found that there...Does the SVN repository have case sensitive file names? I found that there are 2 directories with the same name (below) that differ only in the case of letters used. This is causing issues using "SVN co" on Win7x64 cmd line.
www2\download\plugins\PerfPublisher
www2/download/plugins/perfpublisher
Jul 06, 2010
jasonrobinson - says:
Below line links to error (410 thread deleted) page. Test suite requires a gra...Below line links to error (410 thread deleted) page.
Test suite requires a graphical environment and until fixed see this thread.
Does anyone have this page (or the contents) archived?
Jul 19, 2010
kuuyee - says:
I can't checkout svnI can't checkout svn
Jun 27, 2011
Ian Roberts says:
Im getting an error when trying to build jenkins. I have followed the abov...Im getting an error when trying to build jenkins. I have followed the above instructions.
I am on debian 6, i have tried to compile with system's java6 1.6.26, and installed my own 1.6.23 to try. I have also tried with maven2 2.2.1 and maven 3.0.3.
I get this error:
[INFO] Executing tasks
[echo] The build id is: 1.419-SNAPSHOT (private-06/27/2011 14:28-ir)
[mkdir] Created dir: /home/ir/jenkins/core/target/classes/hudson/model
[mkdir] Created dir: /home/ir/jenkins/core/target/classes/jenkins/model
[mkdir] Created dir: /home/ir/jenkins/core/target/classes/windows-service
[resolveArtifact] Copying /home/ir/.m2/repository/com/sun/winsw/winsw/1.10/winsw-1.10-bin.exe to /home/ir/jenkins/core/target/classes/windows-service/jenkins.exe
[null] Copying 1 file to /home/ir/jenkins/core/target/classes/windows-service
[INFO] Executed tasks
[debug] execute contextualize
[INFO] [resources:resources
]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4267 resources
[INFO] Copying 2 resources
[INFO] Copying 2 resources
[INFO] [stapler:apt-compile
]
[INFO] Compiling 757 source files to /home/ir/jenkins/core/target/classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
error: Could not create declaration for annotation type AncestorInPath
error: Could not create declaration for annotation type JavaScriptMethod
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25 seconds
[INFO] Finished at: Mon Jun 27 14:28:23 BST 2011
[INFO] Final Memory: 89M/1460M
Has someone come across this error. Im trying to build my own hudson to fix PAM issue with jenkins cli and authentication.
Sep 14, 2011
Simon Payne says:
I get a different compilation error when compiling Jenkins core which I download...I get a different compilation error when compiling Jenkins core which I downloaded today from the GIT URL https://github.com/jenkinsci/jenkins.git. This is with a 32-bit machine running Windows XP Pro.
I am using Apache Maven 2.2.1 and Oracle/Sun JDK 1.6.0_24.
[INFO] [compiler:compile
]
[INFO] Compiling 785 source files to D:\jenkins\jenkins\core\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \jenkins\jenkins\core\src\main\java\hudson\util\DescribableList.java:[42,48] package org.apache.avalon.framework.configuration does not exist
[ERROR] \jenkins\jenkins\core\src\main\java\hudson\util\DescribableList.java:[42,48] package org.apache.avalon.framework.configuration does not exist
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
\jenkins\jenkins\core\src\main\java\hudson\util\DescribableList.java:[42,48] package org.apache.avalon.framework.configuration does not exist
\jenkins\jenkins\core\src\main\java\hudson\util\DescribableList.java:[42,48] package org.apache.avalon.framework.configuration does not exist
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 minutes 5 seconds
[INFO] Finished at: Wed Sep 14 17:02:21 BST 2011
[INFO] Final Memory: 68M/247M
[INFO] ------------------------------------------------------------------------
Can anyone advise?
Simon
Jan 06, 2012
Jim Leary says:
A couple of interesting things here: Using Eclipse 3.6 (Helios) on Mac OSX Lion ...A couple of interesting things here: Using Eclipse 3.6 (Helios) on Mac OSX Lion (JVM 1.6):
Now I'm getting an interesting error in Eclipse: The method configRoundtrip(MavenModuleSet) is ambiguous for the type MavenModuleSetTest MavenModuleSetTest.java
So in project jenkins-test-harness, code module hudson.maven.MavenModuleSetTest.java:
configRoundTrip(...) is found in org.jvnet.hudson.test.HudsonTestCase.java:
The references are ambiguous because Interface Job extends Item as well, so the compiler cannot choose which method signature to use. If I comment out the first overloaded method protected <P extends Job> P configRoundtrip(P job)... This allows the Eclipse build to complete successfully, although I know this is not the correct solution.
So ... what is the correct solution? Is it an Eclipse/Project config issue?
I know I can just build everything using Maven command line, but I'd like to find a solution to this problem if I can. The code I'm using is a fork in my own account.
Thanks - Jim L.
Description Resource Path Location Type
The method configRoundtrip(MavenModuleSet) is ambiguous for the type MavenModuleSetTest MavenModuleSetTest.java /jenkins-test-harness/src/test/java/hudson/maven line 12 Java Problem
Feb 22, 2012
martin chen says:
I get a issue when I run mvn $ mvn -Plight-test install INFO Scanning for proje...I get a issue when I run mvn
$ mvn -Plight-test install
INFO Scanning for projects...
Feb 22, 2012 10:36:15 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn
警告: Error injecting: org.apache.maven.wagon.providers.http.HttpWagon
java.lang.NoClassDefFoundError: javax/net/ssl/HostnameVerifier
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
my environment:
Apache Maven 3.0.4 (r1232337; 2012-01-17 16:44:56+0800)
Maven home: /home/martin/soft/apache-maven-3.0.4
Java version: 1.6.0_16, vendor: Sun Microsystems Inc.
Can anyone advise?
May 11, 2012
Jason Tong says:
I got an issue when trying to import jenkis src as a maven project into Eclipse(...I got an issue when trying to import jenkis src as a maven project into Eclipse(with m2e plugin installed).
It shows errors as following.
any suggestion?
Aug 16, 2012
Dave Kelsey says:
These instructions don't work for me. so far it's been a colossal waste of...These instructions don't work for me. so far it's been a colossal waste of time.
I setup a local nexus repo and added the proxy repos as describe in https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Development+Environment+with+Nexus#JenkinsDevelopmentEnvironmentwithNexus-hudsonrepos.
I added the jenkins-ci.org repo as well from https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial#Plugintutorial-SettingUpEnvironmentas
Without this nexus/maven never finds anything jenkins related.
I follow the steps above:
This is what I get:
maven it trying to download the pom.xm for maven-hpi-plugin. This doesn't exist when I search Nexus.
when I look in my local repository I don't see the jar though it states it downloaded it.
Add Comment