Craftbukkit maven repo 1.7.9-R0.2

Discussion in 'Plugin Development' started by hubeb, Oct 16, 2014.

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

    hubeb

    Hey everyone,

    Does anyone know of a secondary maven repo for craftbukkit 1.7.9-R0.2. I've looked around and they all seem to be down. Any help would be appreciated.

    Thanks,
    Min3
     
  2. Offline

    fireblast709

    hubeb you can install local files into your local Maven repo.
     
  3. Offline

    hubeb

    fireblast709 How im using jenkins to build my plugin builds, is there a way I can do that using jenkins?
     
  4. Offline

    Europia79

    hubeb

    Code:
    mvn install:install-file -Dfile=/location/to/file/craftbukkit-1.7.9-R0.2.jar -DgroupId=org.bukkit -DartifactId=craftbukkit -Dversion=1.7.9-R0.2 -Dpackaging=jar -DcreateChecksum=true
    export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.3
    export M2=$M2_HOME/bin
    export PATH=$M2:$PATH
    export JAVA_HOME=/usr/java/jdk1.7.0_51
    export PATH=$JAVA_HOME:$PATH
    
    Substitute the paths tho.
    Code:
    root$> find / -name *maven*
     
  5. Offline

    hubeb

    Europia79 will it work with site url since its jenkins, or do I upload it somewhere?
     
  6. Offline

    Europia79

    hubeb

    i believe you have to populate the Jenkins Home Directory: ~/.m2/repository

    Login as root user. View the /etc/passwd file to see what the home directory for jenkins is. Goto the jenkins home directory and cd .m2. Then make a settings.xml file that points to the local repository.

    Code:
    root@server:~# cd /
    root@server:/# ls
    root@server:/# cd etc/
    root@server:/etc# cat passwd
    root@server:/etc# cd /var/lib/jenkins
    root@server:/var/lib/jenkins# cd .m2
    root@server:/var/lib/jenkins/.m2# ls
    root@server:/var/lib/jenkins/.m2# nano settings.xml
    Paste this in settings.xml (if it's blank). If it's not blank, just check that the setting for localRepository is correct.
    Code:
    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                          http://maven.apache.org/xsd/settings-1.0.0.xsd">
      <localRepository>${user.home}/.m2/repository</localRepository>
      <interactiveMode>false</interactiveMode>
      <usePluginRegistry>false</usePluginRegistry>
      <offline>false</offline>
    </settings>
    control+x to exit. It'll ask if you wanna save the changes: Press 'y' and press enter to keep the same file name.

    Then do
    Code:
    su - jenkins -c 'mvn install:install-file -Dfile=/path/to/file/craftbukkit-1.7.9-R0.2.jar -DgroupId=org.bukkit -DartifactId=craftbukkit -Dversion=1.7.9-R0.2 -Dpackaging=jar -DcreateChecksum=true'
    It works for me. I just haven't tested an actual jenkins build yet.

    One final command:
    Code:
    chown jenkins:jenkins settings.xml
     
    and if necessary:
     
    mkdir repository
    chown -R jenkins:jenkins repository
    Good luck!
     
  7. Offline

    hubeb

    Europia79 Thanks a bunch :)

    Europia79
    Code:
    root@plugin-market:~# cd /var/lib/jenkins/.m2/                                                                                                                                                       root@plugin-market:/var/lib/jenkins/.m2# su - jenkins -c 'mvn install:install-fi                                                                                                                     le -Dfile=/home/cb/craftbukkit-1.7.9-R0.2.jar -DgroupId=org.bukkit -DartifactId=                                                                                                                     craftbukkit -Dversion=1.7.9-R0.2 -Dpackaging=jar -DcreateChecksum=true'
    [ERROR] Could not create local repository at /var/lib/jenkins/.m2/repository ->                                                                                                                      [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit                                                                                                                     ch.
    [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 rea                                                                                                                     d the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LocalRepositor                                                                                                                     yNotAccessibleException
    root@plugin-market:/var/lib/jenkins/.m2# mvn -X
    Apache Maven 3.0.4
    Maven home: /usr/share/maven
    Java version: 1.7.0_55, vendor: Oracle Corporation
    Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
    Default locale: en_US, platform encoding: ANSI_X3.4-1968
    OS name: "linux", version: "2.6.32-042stab090.5", arch: "amd64", family: "unix"
    [INFO] Error stacktraces are turned on.
    [DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
    [DEBUG] Reading user settings from /root/.m2/settings.xml
    [DEBUG] Using local repository at /root/.m2/repository
    [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /root/                                                                                                                     .m2/repository
    [INFO] Scanning for projects...
    [DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (non                                                                                                                     e)
    [DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.co                                                                                                                     re, parent: null]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 0.329s
    [INFO] Finished at: Fri Oct 17 16:52:57 EDT 2014
    [INFO] Final Memory: 3M/9M
    [INFO] ------------------------------------------------------------------------
    [ERROR] No goals have been specified for this build. You must specify a valid li                                                                                                                     fecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id                                                                                                                     >:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are                                                                                                                     : validate, initialize, generate-sources, process-sources, generate-resources, p                                                                                                                     rocess-resources, compile, process-classes, generate-test-sources, process-test-                                                                                                                     sources, generate-test-resources, process-test-resources, test-compile, process-                                                                                                                     test-classes, test, prepare-package, package, pre-integration-test, integration-                                                                                                                     test, post-integration-test, verify, install, deploy, pre-site, site, post-site,                                                                                                                      site-deploy, pre-clean, clean, post-clean. -> [Help 1]
    org.apache.maven.lifecycle.NoGoalSpecifiedException: No goals have been specifie                                                                                                                     d for this build. You must specify a valid lifecycle phase or a goal in the form                                                                                                                     at <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-ver                                                                                                                     sion>]:<goal>. Available lifecycle phases are: validate, initialize, generate-so                                                                                                                     urces, process-sources, generate-resources, process-resources, compile, process-                                                                                                                     classes, generate-test-sources, process-test-sources, generate-test-resources, p                                                                                                                     rocess-test-resources, test-compile, process-test-classes, test, prepare-package                                                                                                                     , package, pre-integration-test, integration-test, post-integration-test, verify                                                                                                                     , install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, pos                                                                                                                     t-clean.
            at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl                                                                                                                     eStarter.java:104)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
            at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
            at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.                                                                                                                     java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces                                                                                                                     sorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun                                                                                                                     cher.java:290)
            at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav                                                                                                                     a:230)
            at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La                                                                                                                     uncher.java:409)
            at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:                                                                                                                     352)
    [ERROR]
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please rea                                                                                                                     d the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifie                                                                                                                     dException
    root@plugin-market:/var/lib/jenkins/.m2#
    
    Getting this error and have no idea how to fix it.

    Europia79
    From Jenkins:
    Code:
    Parsing POMs
    [workspace] $ /var/lib/jenkins/tools/hudson.model.JDK/JDK7/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.5.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/boot/plexus-classworlds-2.5.1.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/conf/logging jenkins.maven3.agent.Maven31Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven /var/cache/jenkins/war/WEB-INF/lib/remoting-2.46.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.5.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 58968
    <===[JENKINS REMOTING CAPACITY]===>channel started
    Executing Maven:  -B -f /var/lib/jenkins/jobs/RPCore/workspace/pom.xml clean package
    [ERROR] Could not create local repository at /var/lib/jenkins/.m2/repository -> [Help 1]
    [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/LocalRepositoryNotAccessibleException
    channel stopped
    Finished: FAILURE
    Running mvn -ex:
    Code:
    root@plugin-market:/var/lib/jenkins/.m2# mvn -ex
    [INFO] Error stacktraces are turned on.
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 0.226s
    [INFO] Finished at: Fri Oct 17 17:15:41 EDT 2014
    [INFO] Final Memory: 3M/9M
    [INFO] ------------------------------------------------------------------------
    [ERROR] The goal you specified requires a project to execute but there is no POM                                                                                                                      in this directory (/var/lib/jenkins/.m2). Please verify you invoked Maven from                                                                                                                      the correct directory. -> [Help 1]
    org.apache.maven.lifecycle.MissingProjectException: The goal you specified requi                                                                                                                    res a project to execute but there is no POM in this directory (/var/lib/jenkins                                                                                                                    /.m2). Please verify you invoked Maven from the correct directory.
            at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl                                                                                                                    eStarter.java:89)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
            at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
            at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.                                                                                                                    java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces                                                                                                                    sorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun                                                                                                                    cher.java:290)
            at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav                                                                                                                    a:230)
            at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La                                                                                                                    uncher.java:409)
            at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:                                                                                                                    352)
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
  8. Offline

    Europia79

    hubeb

    Code:
    [DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
    [DEBUG] Reading user settings from /root/.m2/settings.xml
    [DEBUG] Using local repository at /root/.m2/repository
    I don't have time to look into right now. But i'll look into it later.

    The directories that I used were just as examples. You should verify the /etc/passwd file with
    Code:
    cd /etc/
    cat passwd
    Use that to see what the jenkins user home directory is.

    Also, you can look at the contents of /root/.m2/settings.xml and /usr/share/maven/conf/settings.xml. And see what they say. It looks like your local repo is at /root/.m2/repository

    So you might be able to install files into the root users local repo... And Jenkins may or may not be able to use it. Depending on how your setup is configured.

    I'll have to look at the details later.
     
  9. Offline

    hubeb

    Europia79 Seems like its in the correct dir:
    [​IMG]
     
Thread Status:
Not open for further replies.

Share This Page