1 | ##################################################################################### |
---|
2 | |
---|
3 | Installation for eclipse |
---|
4 | |
---|
5 | ##################################################################################### |
---|
6 | |
---|
7 | 1 - You must first checkout the project from svn (url is http://piwigo.org/svn/extensions/jiwigo/). Create a new Java project from the svn version. |
---|
8 | 2 - Then install maven plugin for eclipse. It is available from that update site : http://m2eclipse.sonatype.org/sites/m2e |
---|
9 | 3 - Then enable maven dependency management : right click on the project > maven > enable dependency management. |
---|
10 | 4 - Now you must tell eclipse which folders are sources folders : right click on the project > properties > java build path |
---|
11 | > tab "Source" > Add folder. Select java and resources in main and test folders. |
---|
12 | 5 - install maven on your computer. You can download it here : http://maven.apache.org/download.html. For debian/ubuntu, |
---|
13 | maven is available via apt-get : sudo apt-get install maven2 (maybe for other distributions too, I did not search). |
---|
14 | 6 - Some dependency are not available from maven repositories. You must install them manually in your local repository : |
---|
15 | Create a new "External tool configuration" type "Program". In "Location" put the location of maven's executable. If you've |
---|
16 | downloaded maven via the link above, the executable is in the bin directory of the extracted folder. It is called "mvn" for |
---|
17 | Unix systems and mvn.bat for windows. If you've installed maven via a package manager (like apt-get), maven location will |
---|
18 | probably be "/usr/bin/mvn". In the argument field, put one of the two commands of the file "mvn-commands.txt". Run the command. |
---|
19 | If you get an error that tells you that the project location cannot be found, click on the project and run the command again. |
---|
20 | Replace the content of the field "argument" by the other command of the "mvn-commands.txt" file. |
---|
21 | 7 - create a new "External tool configuration" type "Program". In location put the maven executable again, in working directory, |
---|
22 | put "${project_loc}" and in argument put "clean eclipse:eclipse". Run the command. |
---|
23 | |
---|
24 | The project should not contain errors after that, and you should be able to launch jiwigo by launching the main class : |
---|
25 | src/main/java fr.mael.jiwigo.Main |
---|
26 | |
---|
27 | If you want to build an executable jar from the sources, I recommend to use a maven command : create a new "External tool configuration" |
---|
28 | type "Program" in location put the maven executable in working directory put "${project_loc}" and in argument put "assembly:assembly". |
---|
29 | Execute the command. The reason to use this command is that it launches the tests of the project and does not build a jar if the |
---|
30 | tests fail. It creates two jar in the "target" directory of the project : Jiwigo-version.jar and Jiwigo-version-jar-with-dependencies.jar. |
---|
31 | The first one is not usable because it contains only the class file of the project. The second one can be executed because |
---|
32 | it contains the dependencies of the project. |
---|
33 | |
---|
34 | Enjoy. |
---|
35 | |
---|
36 | I do not use other IDE, so I don't know how to install the project with other IDE. Feel free to complete this file if you know. |
---|