Github and Jenkins

Discussion in 'Programming' started by jessegeerts, Jun 20, 2016.

  1. I`m trying to get jenkins working which clones the repo and compiles it by using maven but it seems that it creates the output jar but doesn`t show up..

    jenkins compile log:
    Code (Text):

    Building in workspace /var/lib/jenkins/workspace/Hub
    > /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
    Fetching changes from the remote Git repository
    > /usr/bin/git config remote.origin.url https://github.com/BreachUniverse/Hub # timeout=10
    Fetching upstream changes from https://github.com/BreachUniverse/Hub
    > /usr/bin/git --version # timeout=10
    using .gitcredentials to set credentials
    > /usr/bin/git config --local credential.username jesseke55 # timeout=10
    > /usr/bin/git config --local credential.helper store --file=/tmp/git6345589354571233026.credentials # timeout=10
    > /usr/bin/git -c core.askpass=true fetch --tags --progress https://github.com/BreachUniverse/Hub +refs/heads/*:refs/remotes/origin/*
    > /usr/bin/git config --local --remove-section credential # timeout=10
    > /usr/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10
    > /usr/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
    Checking out Revision c40da9cda1d9121750e72090dfff5c74a956f06d (refs/remotes/origin/master)
    > /usr/bin/git config core.sparsecheckout # timeout=10
    > /usr/bin/git checkout -f c40da9cda1d9121750e72090dfff5c74a956f06d
    > /usr/bin/git rev-list 8c6003ca58efd767a45b32975883d734a7328806 # timeout=10
    Parsing POMs
    Modules changed, recalculating dependency graph
    Established TCP socket on 40093
    [Hub] $ /var/lib/jenkins/tools/hudson.model.JDK/Java_8/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-agent-1.7.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/conf/logging jenkins.maven3.agent.Maven32Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven /var/cache/jenkins/war/WEB-INF/lib/remoting-2.59.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-interceptor-1.7.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.7.jar 40093
    <===[JENKINS REMOTING CAPACITY]===>channel started
    Executing Maven:  -B -f /var/lib/jenkins/workspace/Hub/pom.xml install
    [INFO] Scanning for projects...
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building hub 1.0
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hub ---
    [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
    [INFO] Copying 1 resource
    [INFO]
    [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hub ---
    [INFO] Nothing to compile - all classes are up to date
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hub ---
    [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
    [INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/Hub/src/test/resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ hub ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ hub ---
    [INFO] No tests to run.
    [JENKINS] Recording test results
    [INFO]
    [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ hub ---
    [INFO] Building jar: /var/lib/jenkins/workspace/Hub/target/hub-1.0.jar
    [INFO]
    [INFO] --- maven-install-plugin:2.4:install (default-install) @ hub ---
    [INFO] Installing /var/lib/jenkins/workspace/Hub/target/hub-1.0.jar to /var/lib/jenkins/.m2/repository/com/breachuniverse/com/hub/1.0/hub-1.0.jar
    [INFO] Installing /var/lib/jenkins/workspace/Hub/pom.xml to /var/lib/jenkins/.m2/repository/com/breachuniverse/com/hub/1.0/hub-1.0.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 2.821 s
    [INFO] Finished at: 2016-06-20T18:40:22+02:00
    [INFO] Final Memory: 13M/137M
    [INFO] ------------------------------------------------------------------------
    [JENKINS] Archiving /var/lib/jenkins/workspace/Hub/pom.xml to com.breachuniverse.com/hub/1.0/hub-1.0.pom
    [JENKINS] Archiving /var/lib/jenkins/workspace/Hub/target/hub-1.0.jar to com.breachuniverse.com/hub/1.0/hub-1.0.jar
    channel stopped
    Finished: SUCCESS
    Jenkins config from project: https://drive.google.com/file/d/0Bzi7TczKmNTuZ0lDdzJmXzdpTm8/view?usp=drivesdk
     
  2. You have to archive the artifacts after Maven generates the jar I believe.