Jenkins - Help - Maven

Discussion in 'Plugin Development' started by vYN, Apr 22, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    vYN

    Hi... I haven't found any good tutorials on setting up Jenkins. And make it clone my github repo... And then build a jar from that....

    If anyone know how to do this... Or have some good tutorials on it... Please give me some links :)
    I have searched google for a little while... And found some... But it's not kinda working for me...

    And sorry if i posted this in the wrong place.. I wasn't sure where else to post it....
     
  2. Offline

    BeMacized

    I don't fully get it either, but I set something up myself which seems to work. Here's what I did:

    I went to the plugin manager, and installed a plugin called "github" (https://wiki.jenkins-ci.org/display/JENKINS/Github Plugin)
    I then went to "Configure System" and set "Github Web Hook" to "Manually manage hook URLs"
    (I finally got stuck because I didn't have git setup properly on the server, so make sure you have jenkins linked to your git installation properly. you can add your git installation under "git" here on the same page "configure system")
    I then created a new project, chose, "Build a free-style software project" and selected "git" under "Source code management". Then I set my Repository URL to "[email protected]:MyUser/MyRepo.git", and my "Branch Specifier" to "**". Under "Build Triggers" I checked "Build when a change is pushed to GitHub". For Post-Build Actions, I selected "archive the artifacts", and set the files to archive to "dist/*.jar". (That path might be different for you, make sure it is in the folder where your final plugin compiles).

    Then I just saved it, and pushed to my repo. Boom, it compiled.
    That might have been vague, but this worked for me, so I hope it helped you. Maybe someone else can explain it better

    EDIT: Oh I totally forgot to mention: you need to go to your github repo, go to its settings, and enable "Jenkins github plugin". Then check the "active" checkbox, and enter the following url as hook url: http://hostname+path-to-your-jenkins/github-webhook/
     
  3. Offline

    vYN

    A little update... I think i'm gonna use maven with this... But I got a question about "dependencies" with maven.... I have no clue how to add them.... Help please???

    Jenkins build error:

    Code:
    [JENKINS] Archiving /var/lib/jenkins/jobs/PrivateWarps/workspace/pom.xml to /var/lib/jenkins/jobs/PrivateWarps/modules/pro.homiecraft$PrivateWarps/builds/2013-04-22_22-04-35/archive/pro.homiecraft/PrivateWarps/1.2.1-SNAPSHOT/PrivateWarps-1.2.1-SNAPSHOT.pom
    Waiting for Jenkins to finish collecting data
    mavenExecutionResult exceptions not empty
    message : Failed to execute goal on project PrivateWarps: Could not resolve dependencies for project pro.homiecraft:PrivateWarps:jar:1.2.1-SNAPSHOT: Could not find artifact bukkit:bukkit:jar:1.5.1 in central (http://repo.maven.apache.org/maven2)
    cause : Could not resolve dependencies for project pro.homiecraft:PrivateWarps:jar:1.2.1-SNAPSHOT: Could not find artifact bukkit:bukkit:jar:1.5.1 in central (http://repo.maven.apache.org/maven2)
    Stack trace :
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project PrivateWarps: Could not resolve dependencies for project pro.homiecraft:PrivateWarps:jar:1.2.1-SNAPSHOT: Could not find artifact bukkit:bukkit:jar:1.5.1 in central (http://repo.maven.apache.org/maven2)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:210)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:117)
        at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
        at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
        at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
        at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
        at hudson.remoting.UserRequest.perform(UserRequest.java:118)
        at hudson.remoting.UserRequest.perform(UserRequest.java:48)
        at hudson.remoting.Request$2.run(Request.java:326)
        at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:722)
    Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project pro.homiecraft:PrivateWarps:jar:1.2.1-SNAPSHOT: Could not find artifact bukkit:bukkit:jar:1.5.1 in central (http://repo.maven.apache.org/maven2)
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:189)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:185)
        ... 30 more
    Caused by: org.sonatype.aether.resolution.DependencyResolutionException: Could not find artifact bukkit:bukkit:jar:1.5.1 in central (http://repo.maven.apache.org/maven2)
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:375)
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:183)
        ... 31 more
    Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact bukkit:bukkit:jar:1.5.1 in central (http://repo.maven.apache.org/maven2)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:358)
        ... 32 more
    Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact bukkit:bukkit:jar:1.5.1 in central (http://repo.maven.apache.org/maven2)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:947)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:941)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)
        at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
        ... 3 more
    channel stopped
    Finished: FAILURE
     
Thread Status:
Not open for further replies.

Share This Page