Best Guide for compile with maven!

Page 1 of 5 12345 LastLast
Results 1 to 15 of 75
  1. #1
    Account Upgraded | Title Enabled! EzEraL is offline
    MemberRank
    Dec 2006 Join Date
    Greece,AthensLocation
    606Posts

    Best Guide for compile with maven!

    Welcome to "How to compile with maven" guide
    Version:v2
    Release:12/8/08
    Credits:Noctarious-Hanwik

    Ok lets start.Long time ago L2jfree change from ant to maven comprehesive tool.Many users try to manage maven but couldnt succeed
    So in this guide i will try you to learn you the most easy way to get and compile latest l2jfree gameserver(core) and of course to get and compile its forks like l2emu and l2jumbrella

    Ok this is the part of gameserver.First download the TortoiseSvn client.However because l2jfree has no support for TortoiseSvn 1.5++ you must download version 1.4.6

    Download link:SourceForge.Select 1.4.6 not another version....

    Install it.Then go to a directory that you prefer to have your workspace,for example my domuments.Create a folder and name it as the pack that you want to checkout for example l2jfree.Go inside that folder and press the right click of your mouse.You will see an option "Svn Checkout".Press it.Then add the svn of the project you want(l2jfree,l2emu,l2jumbrella) and press ok.

    Wait until it finish.When it finish go and download maven
    Download link:Maven

    Extract maven to an empty folder for example in C://
    So its directory will be C://

    Ok now go to your project checkout folder that you create earlier.You will see5 folders
    1)archive
    2)Trunk
    3)Tags
    4)Branches
    5)Release

    In release folder there are the stable version sources and in trunk the current unstable sources.Lets say that you want to build a stable version
    Go to release folder and open the version you want.For example 1.1.4.Inside it you will see a pom.xml file.Right click on it and press "open with"and then "Choose Default program".A menu will appear.Press "Browse"and go windows/system32 and select the cmd.exe file(cmd).Then open the pom.xml file with cmd.

    Finally "write your path to maven/bin/mvn assembly:assembly -Dmaven.test.skip=true" with out the ""
    So if your path is C:// you will write
    C://maven/bin/mvn assembly:assembly -Dmaven.test.skip=true
    And thats all.You wait until it finish and you compile the gameserver.Now your server is located in release/the version you choose to compile/target

    Note:Soon i will share how to compile with maven under ubuntu and other linux distros
    Last edited by EzEraL; 07-09-08 at 09:15 AM. Reason: Clean up


  2. #2
    Moved on Tobywan is offline
    MemberRank
    Jan 2006 Join Date
    SwedenLocation
    761Posts

    Re: [Share]Best Guide for compile with maven!

    Best Guide???

    Then where are all the pictures? =P

  3. #3
    Proficient Member Teufelskerl is offline
    MemberRank
    Jan 2006 Join Date
    GermanyLocation
    154Posts

    Re: [Share]Best Guide for compile with maven!

    Name:m2 plugin
    Url:m2codehaus.org
    m2codehaus.org doenst work use this ->
    Maven - The Maven Integration for Eclipse

  4. #4
    Novice Lian is offline
    MemberRank
    Sep 2007 Join Date
    Athens,GreeceLocation
    2Posts

    Re: [Share]Best Guide for compile with maven!

    L2jfree's guide is halfway correct,but it does not explain everything step by step that is why it is outdated.
    Based on l2jfree's guide,the following is a GOOD guide which will 101% help you compile :

    Download Maven

    Maven - Download Maven 2.0.7

    extract it on C:/ (or D:/ whatever disk you got) and name the folder maven.(Make sure the bin folder is located on : C:/maven/bin/ and you're ok.

    Run Maven

    open cmd (Start -> run -> cmd)
    go to your l2jfree directory (lets say you created a workspace named Server,then type cd server , cd (the project's name,assuming you have already checked out from your repository)
    Now type "cd .." until it says only C:/ or D:/ etc etc.Then "cd maven" "cd bin" (without the "") and then "mvn eclipse:eclipse"

    Eclipse Settings
    now start eclipse
    open the preferences ( window/preferences)
    open classpaths (java/Build Path/Classpath Variables)
    click "NEW"
    Name: M2_REPO
    Path: locate your .m2 directory /home/.m2/repository NOTE: home is C:\Documents and Settings\YOURUSERNAME under windows
    Now refresh your workspace and youre set

    Ready to compile?
    Open cmd again (I assume you are located at C:/Documents and Settings/YourUserName) and type
    "cd Server"
    "cd trunk" (again,this is your checked out project's name)
    "cd l2_loginserver_il" (it can be l2_gameserver_il or l2_datapack_il)(and again without the "" 's)
    then
    "C:/maven/bin/mvn"
    and it will compile.

    This is for L2jFree compiling.


    I got this error in my console (windows command line)


    ERROR: JAVA_HOME not found in your environment.
    Please set the JAVA_HOME variable in your environment to match the
    location of your Java installation


    You just have to set JAVA_HOME in your environment variable.
    workspace => right click => properties => advanced => environment variable
    Add new variable JAVA_HOME that target your installation path of JDK (ant not your JRE)

    IF THE ABOVE STILL DOES NOT WORK DO THE FOLLOWING!
    (Start -> right click "my computer" and go to properties -> advanced -> Envirronment Variables -> on the bottom box make a new entry with the following data
    Name : JAVA_HOME
    Value : C:/Program Files/Java/jdk1.6.0_02 )
    (well that is where my jdk is located)

    I do not believe you will get ANY errors...

  5. #5
    Gamma Droppo is offline
    MemberRank
    Jul 2004 Join Date
    ElmoreLocation
    3,051Posts

    Re: [Share]Best Guide for compile with maven!

    Mmmm looks like a nice guide... just needs alot of pics and it's done...

    Good one EzEraL...

    Droppo.-

  6. #6
    Account Upgraded | Title Enabled! EzEraL is offline
    MemberRank
    Dec 2006 Join Date
    Greece,AthensLocation
    606Posts

    Re: [Share]Best Guide for compile with maven!

    Thx droppo but why pictures all of us that compile with maven we didnt have pics.So why?I think is very easy

    And for the best guide i say it for fun.xD

    And thx Teufelskerl i edit the post

  7. #7
    Gamma Droppo is offline
    MemberRank
    Jul 2004 Join Date
    ElmoreLocation
    3,051Posts

    Re: [Share]Best Guide for compile with maven!

    Yeah... could be... but I will be expecting from now on, the first credits stealer that will make an exact copy of this, remove the credits, add some pics and call it his guide...
    I have seen that happen long time ago and not just once...

    Droppo.-

  8. #8
    Novice kless is offline
    MemberRank
    Jan 2007 Join Date
    2Posts

    problem

    Code:
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Cannot execute mojo: resources. It requires a project with an existing po
    m.xml, but the build is not using one.
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 26 seconds
    [INFO] Finished at: Wed Dec 05 11:08:11 EET 2007
    [INFO] Final Memory: 3M/7M
    [INFO] ------------------------------------------------------------------------
    
    C:\maven\bin>
    and then :

    Eclipse

    Whats wrong ?
    Last edited by kless; 05-12-07 at 10:49 AM. Reason: too big picture

  9. #9
    Apprentice toppogiggio is offline
    MemberRank
    Dec 2007 Join Date
    9Posts

    Re: [Share]Best Guide for compile with maven!

    Code:
    C:\Documents and Settings\toppogiggio\workspace\l2jfree>c:\maven\bin\mvn assembly:asse
    mbly
    [INFO] Scanning for projects...
    [INFO] Reactor build order:
    [INFO]   Unnamed - l2jfree:l2j-test-tools:jar:1.0.2
    [INFO]   l2jfreeParent
    [INFO]   Unnamed - l2jfree:l2j-commons:jar:1.0.9
    [INFO]   Unnamed - l2jfree:l2j-mmocore:jar:1.0.4
    [INFO]   Unnamed - l2jfree:l2j-loginserver:jar:1.0.0
    [INFO]   Unnamed - l2jfree:l2j-gameserver:jar:1.0.0
    [INFO] Searching repository for plugin with prefix: 'assembly'.
    WAGON_VERSION: 1.0-beta-2
    [INFO] ------------------------------------------------------------------------
    [INFO] Building l2jfreeParent
    [INFO]    task-segment: [assembly:assembly] (aggregator-style)
    [INFO] ------------------------------------------------------------------------
    [INFO] Preparing assembly:assembly
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Unnamed - l2jfree:l2j-test-tools:jar:1.0.2
    [INFO] ------------------------------------------------------------------------
    [INFO] [resources:resources]
    [INFO] Using default encoding to copy filtered resources.
    [INFO] [compiler:compile]
    [INFO] Nothing to compile - all classes are up to date
    [INFO] [resources:testResources]
    [INFO] Using default encoding to copy filtered resources.
    [INFO] [compiler:testCompile]
    [INFO] Nothing to compile - all classes are up to date
    [INFO] [surefire:test]
    [INFO] Surefire report directory: C:\Documents and Settings\toppogiggio\workspace\l2j
    ree\l2j-test-tools\target\surefire-reports
    org.apache.maven.surefire.booter.SurefireExecutionException: Unable to instanti
    te and execute Surefire; nested exception is java.lang.ClassNotFoundException:
    rg.apache.maven.surefire.Surefire
    java.lang.ClassNotFoundException: org.apache.maven.surefire.Surefire
            at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(Isola
    edClassLoader.java:103)
            at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(S
    refireBooter.java:281)
            at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.
    ava:818)
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] There are test failures.
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3 seconds
    [INFO] Finished at: Fri Dec 14 14:15:57 CET 2007
    [INFO] Final Memory: 6M/11M
    [INFO] ------------------------------------------------------------------------
    wtf is this ? :scratch:

  10. #10
    Member TheNazguL is offline
    MemberRank
    Nov 2006 Join Date
    55Posts

    Re: [Share]Best Guide for compile with maven!

    Quote Originally Posted by toppogiggio View Post
    Code:
    C:\Documents and Settings\toppogiggio\workspace\l2jfree>c:\maven\bin\mvn assembly:asse
    mbly
    [INFO] Scanning for projects...
    [INFO] Reactor build order:
    [INFO]   Unnamed - l2jfree:l2j-test-tools:jar:1.0.2
    [INFO]   l2jfreeParent
    [INFO]   Unnamed - l2jfree:l2j-commons:jar:1.0.9
    [INFO]   Unnamed - l2jfree:l2j-mmocore:jar:1.0.4
    [INFO]   Unnamed - l2jfree:l2j-loginserver:jar:1.0.0
    [INFO]   Unnamed - l2jfree:l2j-gameserver:jar:1.0.0
    [INFO] Searching repository for plugin with prefix: 'assembly'.
    WAGON_VERSION: 1.0-beta-2
    [INFO] ------------------------------------------------------------------------
    [INFO] Building l2jfreeParent
    [INFO]    task-segment: [assembly:assembly] (aggregator-style)
    [INFO] ------------------------------------------------------------------------
    [INFO] Preparing assembly:assembly
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Unnamed - l2jfree:l2j-test-tools:jar:1.0.2
    [INFO] ------------------------------------------------------------------------
    [INFO] [resources:resources]
    [INFO] Using default encoding to copy filtered resources.
    [INFO] [compiler:compile]
    [INFO] Nothing to compile - all classes are up to date
    [INFO] [resources:testResources]
    [INFO] Using default encoding to copy filtered resources.
    [INFO] [compiler:testCompile]
    [INFO] Nothing to compile - all classes are up to date
    [INFO] [surefire:test]
    [INFO] Surefire report directory: C:\Documents and Settings\toppogiggio\workspace\l2j
    ree\l2j-test-tools\target\surefire-reports
    org.apache.maven.surefire.booter.SurefireExecutionException: Unable to instanti
    te and execute Surefire; nested exception is java.lang.ClassNotFoundException:
    rg.apache.maven.surefire.Surefire
    java.lang.ClassNotFoundException: org.apache.maven.surefire.Surefire
            at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(Isola
    edClassLoader.java:103)
            at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(S
    refireBooter.java:281)
            at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.
    ava:818)
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] There are test failures.
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3 seconds
    [INFO] Finished at: Fri Dec 14 14:15:57 CET 2007
    [INFO] Final Memory: 6M/11M
    [INFO] ------------------------------------------------------------------------
    wtf is this ? :scratch:

    Yeah i have the same problem any help?

  11. #11
    Gamma Droppo is offline
    MemberRank
    Jul 2004 Join Date
    ElmoreLocation
    3,051Posts

    Re: [Share]Best Guide for compile with maven!

    Lol! You're trying to compile "2j-test-tools"??? you gotta be kidding me... That doesn't needs to be compiled... just gameserver, loginserver and datapack (wich uses ant) the rest like mmocore and other shits are dinamically added to the project you want to compile

    Droppo.-

  12. #12
    Account Upgraded | Title Enabled! EzEraL is offline
    MemberRank
    Dec 2006 Join Date
    Greece,AthensLocation
    606Posts

    Re: [Share]Best Guide for compile with maven!

    I add in guide images.I hope to help more now.Also because i buy second hd i install eclipse and ect here so i remove maven for some tests and i reinstall it.I follow my guide to see if it is correct and works like a charm

  13. #13
    Account Upgraded | Title Enabled! andycris1993 is offline
    MemberRank
    Sep 2007 Join Date
    RomaniaLocation
    283Posts

    Re: [Share]Best Guide for compile with maven!

    Hi
    [ERROR] mojo-execute : compiler:compile
    Diagnosis: Compilation failure
    FATAL ERROR: Error executing Maven for a project
    [ERROR] project-execute : l2jfree:l2j-gameserver:jar:1.0.0 ( task-segment: [assembly:assembly, -U] )
    Diagnosis: Compilation failure
    FATAL ERROR: Error executing Maven for a project
    org.apache.maven.BuildFailureException: Compilation failure
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:891)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:729)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:505)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:488)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
    at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:441)
    at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:382)
    at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
    Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
    at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
    at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
    ... 12 more
    Can u help me pls. I get this error in cmd and in eclipse too.And I tryed it on 3 pc and same.

  14. #14
    Account Upgraded | Title Enabled! EzEraL is offline
    MemberRank
    Dec 2006 Join Date
    Greece,AthensLocation
    606Posts

    Re: [Share]Best Guide for compile with maven!

    Are you install maven plugin in eclipse?And you install maven correct?Be more specific

  15. #15
    Account Upgraded | Title Enabled! andycris1993 is offline
    MemberRank
    Sep 2007 Join Date
    RomaniaLocation
    283Posts

    Re: [Share]Best Guide for compile with maven!

    Yes I instaled it in eclipse and I did like in your guide!
    Maybe it will work whit the old build.xml method.



Page 1 of 5 12345 LastLast

Advertisement