[Share]Best Guide for compile with maven!

View previous topic View next topic Go down

[Share]Best Guide for compile with maven!

Post by  on Sun Dec 23, 2007 1:55 pm

Well hello guys because many users dont know how to compile with maven
and switch from l2jfree to another team because of maven i made this
guide
exactly for them

This guide has 3 parts


Part 1
Download and run maven

First go to Maven - Download Maven 2.0.7and download maven.I suggest you to download with zip and not with other tools
Second when you download it extract it in C: So the location of the program will be C:\Maven 2.0.7
Then rename Maven 2.0.0.7 to maven.So its location will be C:\maven
Finaly go to to l2jfree source that you download with eclipse.Open the cmd and type C:\maven\bin\mvn assembly:assembly
And it will start toi run maven.Wait it until it finish.

Part 2
Configure Eclipse

Go in the location that you have eclipse(not 3.1 but newer.I prefer
3.3)Start eclipse and select:window/preferences\java/Build
Path/Classpath Variables
click "NEW"
and write in "Name"field M2_REPO
And in "Path"filed locate the m2 directory.It will be in C:\Documents and Settings\YOURUSERNAME
Now refresh your workspace and you are set

Part 3
Install Eclipse Maven plugin
Open eclipse and select help\software updates\find and install\Select
new features to install and press the option "New Remote site"
and add:

Name:m2 plugin
Url:m2eclipse.codehaus.org
Press ok and finsh.Then it will download maven plugin when it finish
press "Install all"and then when eclipse ask you to restart press "yes"
At the end go to run\external tools\open external tools dialog and
select m2 build.And press the option "New lanch configuration"
When you click on "New lanch configuration" option it will pop up a new menu with 2 options.(Base Directory and Goals)

In base direcotry select "Browze workspace" and you will see all
eclipse projects that you have.Select l2jfree but click on the arrow
that it will show you trunk,tags,branches.Select trunk(if you want to
compile interlude version)and select gameserver for example.
In "Goals option add the goal assembly:assembly and press run

And the gameserver will be compiled.If you want to compile the loginserver just select login server

Frequently asked questions
I paste them from l2jfree forum

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

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[/color]


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)


Diagnosis: Invalid task 'jar': you must specify a valid lifecycle phase, or a goal

The good command is :
mvn assembly:assembly to build your project

You can add
-Dmaven.test.skip=true to skip the test
-U to force the download of new maven plugin versions
-o to keep offline

mvn clean to clean your build


I have an error message, CHECKSUM FAILED
This is just a warning, not an error. The build will continue.

Plug-in org.maven.ide.eclipse was unable to load class org.maven.ide.eclipse.preferences.Maven2Preference Page.


Eclipse 3.2
plugin < Maveen 2.0 integration 0.0.9 >



The
problem is not with the plugin. What you need to keep in mind is that
the plugin is built on top on Maven. So you need to install Maven first
and run it at least one time from the command line so that the
"Documents and Settings/<username>/.m2" directory is created.
Once that is done, go back in Eclipse and everything will be ok.



Usefull tips

when you ready to compile open your cmd and go to the main folder of
your workspace project(such c:, cd workspace, cd l2_gamesever_il). When
u get on its folder only type ur path to maven and the mvn inside bin
folder (u'll be on ur l2_gamesever_il folder, you type c:\maven\bin\mvn
assembly:assembly)

And Thats it. its takes bout 1~2 mins

Have fun...


Favourite Game : MuOnline
Registration date : 1969-12-31

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum