Help with jenkins packaging into a jar file

Discussion in 'Plugin Development' started by deery50, Jul 28, 2013.

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

    deery50

    So I have a github project for my plugin here: https://github.com/Deery50/CDT
    and I got a free cloudbees account and have the plugin on my jenkins here: https://deery50.ci.cloudbees.com/job/CDT/
    I am pretty completely knew to jenkins and was wondering how to go around making it so that it packages the job into a jar file, thanks to anyone who helps!
     
  2. Offline

    Comphenix

    I'd recommend switching to Maven (possibly Ant), as it will download and prepare all the necessary dependencies for you. Here's an example of a pom.xml for one of my projects.

    If you haven't already, I'd recommend installing Maven Project Plugin and
    Jenkins GIT plugin. Then you create a new job based on Maven 2/3, and enter these configuration options (ignore sidebar links).
     
  3. Offline

    deery50

  4. Offline

    Comphenix

    I can't see your console log, even after signing up to the service:
    Code:
    Authorization failed
     
    You are not authorized to use this Jenkins instance. If you think this is an error please contact CloudBees support.
    Can you post it as a pastebin link instead?
     
  5. Offline

    deery50

  6. Offline

    Comphenix

    You need to add Essentials to your dependencies.

    Now - I haven't been able to find Essentials on any Maven repositories, so you may have to host it yourself. I recommend Sonatype Nexus.

    However ... you may use my Maven Repository in the meantime, but I won't keep it up to date with the latest version. So you really should host this yourself:
    HTML:
    <dependency>
      <groupId>com.earth2me.essentials</groupId>
      <artifactId>Essentials</artifactId>
      <version>Dev2.12.53</version>
    </dependency>
    Remember to add my repository:
    HTML:
    <repository>
      <id>comphenix-rep</id>
      <name>Comphenix Maven Releases</name>
      <url>http://repo.comphenix.net/content/groups/public</url>
    </repository>
     
  7. Offline

    deery50

  8. Offline

    Comphenix

    Strange, Sonatype seems to only have created the file, not uploaded it. It may be a bug in the old version I'm using.

    Oh well, I managed to fix it by copying the JAR file directly in Explorer.

    As for getting your own, you could try go looking for a free host. But a general VPS is not all that expensive, and you could use it to host your Jenkins CI as well. Just don't go for AWS, it's not very cost-effective at the low scale IMO.
     
  9. Offline

    deery50

    Comphenix
    So I got my own repository, which anyone is more than free to use if they need an essentials repo, I'll try to keep it updated just make sure that your pom.xml version matches the one in the repo. Here is the repo: http://repository-deery50.forge.cloudbees.com/release/
    But anyway, the problem now is that if you were to go to my plugins download and looked in the jar here:https://deery50.ci.cloudbees.com/job/CDT/7/
    it doesn't look like a normal bukkit plugin's jar. How would I make it so the compiler archives the right things to the right places, once again I am completely new to maven.

    Comphenix
    After a feew builds it stopped working, here is my pom: https://github.com/Deery50/CDT/blob/master/pom.xml
    here is the console log: https://deery50.ci.cloudbees.com/job/CDT/21/console

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  10. Offline

    Comphenix

    This is exactly what happened to me in post #8. I don't know why the upload failed, but you've got an empty JAR file on the repository. Now, I have physical access to the server (and thus the file system), so I could simply overwrite that file in the repository. Can you?

    As for your resources problem - the folder should be in src/main/resources, not src/resources. Pay attention. :p
     
  11. Offline

    deery50

  12. Offline

    deery50

    Comphenix
    Do you know of any free VPS hosts with like...128 mb of memory?
     
  13. Offline

    Comphenix

    There's usually a catch, though. I've seen hosts that require you to install spyware or annoying browser toolbars, though I suppose you could do that on a VM ...

    But, I think you should go for a cheap host instead. I found a pretty good deal here (2GB for 5€ a month), for instance. And you might want to consider more RAM, though it depends on what you intend to run. I use about 280 MB to run a Jenkins server, for instance.
     
Thread Status:
Not open for further replies.

Share This Page