Building Jenkins

Skip to end of metadata
Go to start of metadata

Prerequisites

Building 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+).
Looks like the Maven Enforcer plugin apparently looks at your JAVA_HOME environment variable. Here is a small linux alias I used to switch to jdk 1.6:

alias jdk6='export JAVA_HOME=$JAVA_6_HOME ; export PATH=$JAVA_6_HOME/bin:$PATH'

Issues:

  • Test suite requires a graphical environment.

Configure work environment

To 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.
If it succeeds with BUILD SUCCESSFUL at the end, you are good to go.
At the end you should have war/target/jenkins.war, which is the Jenkins you just built.

Building and running tests can cause permgem errors. If that is the case, try to increase the JVM limit for Maven targets, by setting the following environment variable:
$ export MAVEN_OPTS="-XX:MaxPermSize=128m"

Eclipse

You 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 IDEA

NetBeans (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.

If your IDE complains that 'Messages' class is not found, they are missing because they are supposed to be generated. Run a Maven build once and you should see them all. If that doesn't fix the problem, make sure your IDE added target/generated-sources to the compile source roots.
If IntelliJ IDEA fails to compile with error messages "XXX clashes with package of same name", this is caused by issue IDEA-80331. JetBrains suggest to add resources:*.groovy to Settings | Compiler | Resource Patterns as a workaround.

Debugging Jenkins

Maven 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 Jenkins under the debugger, and open http://localhost:8080/ in your browser:

# To change the port run mvnDebug hudson-dev:run -Dport=9090
$ cd war
$ mvnDebug hudson-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.

  1. When you make changes to view files in core/src/main/resources, just hit F5 in your browser to see the changes.
  2. When you make changes to static resources in war/resources, just hit F5 in your browser to see the changes.
  3. When you change Java source files. Compile them in your IDE and Jetty should pick that up. You don't need to run mvn at all for this.
  4. NetBeans users can just hit Debug with main/war open.

If you are developing plugins and want to test them see Plugin Structure#Testing With Jenkins

Other Tips

  1. Consider running Maven like mvn -o ... to avoid hitting repositories every time. This will make various operations considerably faster.
  2. When Maven complains about something, try "cd $JENKINS; mvn clean install".
  3. The above mentioned profile (-Plight-test) does only run the fairly quick unit tests and leaves out the integration test in the test-harness module. If you want to skip all tests (not recommended!), run Maven with "-Dskip-test-harness".
  4. If you have trouble that isn't addressed here, please send email to the Jenkins dev list. The developers all read that list frequently. You might not get an answer for a long time - or not at all - if you post your questions as comments to this page.
  5. Setting up a local Maven repository manager can considerably speed up your Jenkins builds, and make life with Maven more pleasant in general. Please click here for Artifactory or here for Nexus instructions.
  6. Use can also use Artifctory for easy and rapid setup for hackatons and meetups.

Credits

The sponsor statement from YourKit Java Profiler, which gave us a free license for the Hudson project.

Open-source license for YourKit Java Profiler
YourKit is kindly supporting open source projects with its full-featured Java Profiler. YourKit, LLC is creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products: YourKit Java Profiler and YourKit ASP.NET Profiler
Open-source license for StackProbe Profiler
StackProbe is kindly supporting open source projects with its profiler, StackProbe Profiler
Open-source license for IntelliJ IDEA
JetBrains is kindly supporting open-source projects with their OSS license for IntelliJ IDEA.
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. 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?

    1. 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.

      1. 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....

  2. 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.

  3. 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. 

    # 177 used below is the minimum, using 256M would allow for future needs.
    
    MAVEN_OPTS="-Xmx177M"
    mvn -Dmaven.test.skip=true install  
    
  4. 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.

  5. 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

  6. 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

    Unknown macro: {execution}

     

    ]
    [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

    1. 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. :(

  7. 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

    1. 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.

  8. 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:

    C:\dev> svn co https://svn.dev.java.net/svn/hudson/trunk/hudson \\?\C:\dev\hudson
    C:\dev> svn co https://svn.dev.java.net/svn/hudson/trunk/www \\?\C:\dev\www
    

    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.

    1. 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?

  9. 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

  10. 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?

  11. Jul 19, 2010

    kuuyee - says:

    I can't checkout svn

    I can't checkout svn

  12. 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

    Unknown macro: {execution}

    ]
    [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

    Unknown macro: {execution}

    ]
    [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.

    1. 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

      Unknown macro: {execution}

      ]
      [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

  13. 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):

    1. generated the Eclipse projects and imported them, and received build errors stating Access exceptions to the JVM libraries.  I solved that problem by deleting the specified JVM (JSE 1.5) in each project build path and then re-specified the local JVM.

    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:

    public class MavenModuleSetTest extends HudsonTestCase {
    
        public void testConfigRoundtripLocalRepository() throws Exception {
    
            MavenModuleSet p = createMavenProject();
    
            configRoundtrip(p);  <-- The Error
    
            assertNull(p.getExplicitLocalRepository());
    
            // make sure it roundtrips
    
            PerJobLocalRepositoryLocator before = new PerJobLocalRepositoryLocator();
    
            p.setLocalRepository(before);
    
            configRoundtrip(p); <-- The Error
    
            assertEqualDataBoundBeans(p.getLocalRepository(),before);
    
            assertTrue(before!=p.getLocalRepository());
    
        }
    
    }
    

    configRoundTrip(...) is found in org.jvnet.hudson.test.HudsonTestCase.java:

    [snip .. org.jvnet.hudson.test.HudsonTestCase.java]
    
    
    /**
    
         * Loads a configuration page and submits it without any modifications, to
    
         * perform a round-trip configuration test.
    
         * <p>
    
         * See http://wiki.jenkins-ci.org/display/JENKINS/Unit+Test#UnitTest-Configurationroundtriptesting
    
         */
    
        protected <P extends Job> P configRoundtrip(P job) throws Exception {
    
            submit(createWebClient().getPage(job,"configure").getFormByName("config"));
    
            return job;
    
        }
    
        protected <P extends Item> P configRoundtrip(P job) throws Exception {
    
            submit(createWebClient().getPage(job, "configure").getFormByName("config"));
    
            return job;
    
        }
    
    
    [snip]
    
    
    

         

    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

  14. Feb 22, 2012

    martin chen says:

    I get a issue when I run mvn $ mvn -Plight-test install [INFO] Scanning...

    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?

  15. 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?

          

  16. 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:

    // 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

    This is what I get:

    mvn -Plight-test install
    [INFO] Scanning for projects...
    Downloading: http://localhost:8081/nexus/content/groups/public/org/jenkins-ci/tools/maven-hpi-plugin/1.78/maven-hpi-plugin-1.78.pom
    [WARNING] The POM for org.jenkins-ci.tools:maven-hpi-plugin:jar:1.78 is missing, no dependency information available
    Downloading: http://localhost:8081/nexus/content/groups/public/org/jenkins-ci/tools/maven-hpi-plugin/1.78/maven-hpi-plugin-1.78.jar
    [ERROR] The build could not read 2 projects -> [Help 1]
    [ERROR]
    [ERROR]   The project org.jenkins-ci.main:maven-plugin:1.479-SNAPSHOT (/Users/admin/Documents/workspace/jenkins/maven-plugin/pom.xml) has 2 errors
    [ERROR]     Unresolveable build extension: Plugin org.jenkins-ci.tools:maven-hpi-plugin:1.78 or one of its dependencies could not be resolved: Could not find artifact org.jenkins-ci.tools:maven-hpi-plugin:jar:1.78 in nexus (http://localhost:8081/nexus/content/groups/public) -> [Help 2]
    [ERROR]     Unknown packaging: hpi @ line 36, column 14
    [ERROR]
    [ERROR]   The project org.jenkins-ci.main:ui-samples-plugin:1.479-SNAPSHOT (/Users/admin/Documents/workspace/jenkins/ui-samples-plugin/pom.xml) has 2 errors
    [ERROR]     Unresolveable build extension: Plugin org.jenkins-ci.tools:maven-hpi-plugin:1.78 or one of its dependencies could not be resolved: Could not find artifact org.jenkins-ci.tools:maven-hpi-plugin:jar:1.78 in nexus (http://localhost:8081/nexus/content/groups/public) -> [Help 2]
    [ERROR]     Unknown packaging: hpi @ line 36, column 14
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
    [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
    

    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.