Basic compilation
git clone https://github.com/nebulostore/nebulostore.git
mvn clean install
local tests:
Systests:
scripts/run_local_test.sh
console:
scripts/console-test.sh
planetlab:
prepare environment:
- update the username from scripts/_constants.sh to your planet-lab account (mimuw: mimuw_nebulostore)
- update the host list from scripts/nodes/hosts.txt; see scripts/nodes/README how to generate such a list
- upload libs to planetlab: scripts/upload-libs-to-planet-lab.sh
run systests:
scripts/run-planet-lab-test.sh
run console:
scripts/pl-console-test.sh
clean-up:
kill remaining java processes on top XXX hosts from scripts/nodes/hosts.txt
scripts/killall-java.sh XXX
Workflow: git and gerrit code review
http://naan.mimuw.edu.pl/trac/wiki/Git%20Gerrit
JavaDoc
How to generate:
- Go to project root (e.g. trunk)
- Run: javadoc -d javadoc_main/ -sourcepath src/main/java/ -subpackages org.nebulostore
- Run: javadoc -d javadoc_test/ -sourcepath src/test/java/ -subpackages org.nebulostore
- Enjoy your documentation under javadoc_main and javadoc_test and improve it!
Eclipse configuration & plugins
- m2eclipse
- AspectJ Development Tools (AJDT)
-
AspectJ Maven connector http://dist.springsource.org/release/AJDT/configurator/(will be installed automatically when importing the project) - checkstyle (see below)
File - Import - Existing Maven Projects; and pick the root nebulostore directory
Code Style
Out style guidelines are available here http://students.mimuw.edu.pl/~bk277531/nebulostore/style.html.
The guidelines are copied from geosoft.no. Our slight modifications are marked by purple background.
We also use CheckStyle as an Eclipse plugin to help us follow the rules. It performs on-line checks for
violations and in most cases is able to automatically format code.
Documentation for CheckStyle rules is available here: http://checkstyle.sourceforge.net/.
Eclipse Plugin Installation
Installation instructions for the Eclipse-CS plugin are here: http://eclipse-cs.sourceforge.net/downloads.html.
When the plugin is installed, checkstyle should be already configured in the eclipse project from the svn.
To configure checkstyle from scratch, follow these steps:
- use checks.xml from the repository nebulostore/resources/checkstyle/checks.xml and save it to some permanent location.
- In Eclipse, right-click on your project in Package Explorer and select Properties.
- Select Checkstyle from the left-side menu (if you don't see it then something went wrong with the installation).
- Select Local Check Configurations and load new External Configuration from the checks.xml file.
- Select Main tab and choose the new configuration to be used for all files.
- Again right-click on your project and select Checkstyle -> Activate Checkstyle.
- Enjoy.
Formatter configuration
After installing eclipse-cs you also need to create new formatter consistent with the checkstyle:
- Go to Window -> preferences -> checkstyle -> new and select our checkstyle file "checks.xml" as "External configuration file".
Press OK.
- Navigate to your project (i.e. nebulostore), right click -> checkstyle -> Create Formatter Profile.
- Select newly created formatter by going to Window -> preferences ->Java -> CodeStyle -> Formatter and select
eclipse-cs PROJECT_NAME (i.e. nebulostore) as your active formatter.
Now using ctrl+shift+F to format your code should clean it in a manner consistent with checkstyle (note that not all errors can be fixed automatically).
Maven checkstyle plugin
During maven verify phase checkstyle is performed. Basic:
mvn clean install
will perform checkstyle
Planet-lab tests
Basic login to planet-lab hosts:
ssh -i .ssh/id_planetlab -l mimuw_nebulostore roti.mimuw.edu.pl
Maven
Maven is a very powerfull tool for building, packaging, deploying java projects. (http://maven.apache.org/)
The main artifact in maven project is pom.xml file in main direcotry.
One of the coolest features of maven is dependency management. It became very popular so most of java libraries are available in maven central or some local repositories.
So if we want e.g. google-guava (we want this :)) all we have to do is add in pom.xml:
<dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>12.0</version> </dependency>
Sometimes when package is not available in central repo we have to add entry to
<repositories></repositories>
as well to tell maven where to look for dependencies.
Maven dowloads jar (it can dowload sources and java-docs for your ide as well) and stores it in
~/.m2/respository
Generating eclipse project
Run
mvn eclipse:eclipse
Basic Maven usage
mvn clean install
The most frequently used command. It cleans, compiles, runs tests, packages, and install in local repo your project.
mvn compile
Compiles project, generates sources. Binaries are stored in target directory.
mvn clean
Removes target direcotry
mvn package
Compiles, runs tests, creates your project archive, jar in our case.
mvn install
Compiles, runs tests, creates your project archive and installs it in local maven repository. From now your other local projects can refer to that via {{{#!sh dependency }}}.
To create an executable (via java -jar) jar we need to write:
<build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.3</version> <configuration> <archive> <manifest> <mainClass>org.nebulostore.testing.RunPingPong</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <finalName>runpingpong</finalName> <appendAssemblyId>false</appendAssemblyId> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
There are profiles defined for making executables for main classes.
maven clean install -Ptext-interface
Runs profile
text-interface
I guess in the future will want to do deployment and releasing via maven.
FindBugs
FindBugs is a tool for static code analysis. http://findbugs.sourceforge.net/
It is executed during maven check phase. Results are printed out on console and in xml report file in target dir.
You can invoke gui by
mvn findbugs:gui
. You can use FindBugs as your IDE plugin.
Releasing Nebulostore
To perform a release of Nebulostore you have to:
- have an account with deploy permissions in http://naan.mimuw.edu.pl:8888/artifactory/.
- configure your maven by providing settings.xml file in Your ~/.m2 directory. (Working example settings.xml file is attached to this page, You have to remember to modify credentials in example file.)
- mvn release:prepare -DignoreSnapshots=true (when asked for names press enter to use default values)
- mvn release:perform
- update nebulostore version in scripts/_jar-properties.sh.
Performing above actions will perform packaging and deploying Nebulostore to its maven repo.
Artifactory
Our maven repo is run by Artifactory project.
Aritfactory is deployed on Tomcat in /opt/apache-tomcat .../webapps
url: http://naan.mimuw.edu.pl:8888/artifactory/
Sonar
url: http://naan.mimuw.edu.pl:9000
Trac
Creating an account
- Login on naan.
- Create an account:
htdigest /opt/trac/nebulostore/trac.htpasswd trac <selected_login>
Admin rights
If you want to change settings of our Trac, you should get admin rights. There are two ways of doing this:
- Ask one another admin to give you admin rights.
- Add these rights manually on naan using this command:
trac-admin /opt/trac/nebulostore/ permission add <username> TRAC_ADMIN
Attachments (1)
-
settings.xml
(12.2 KB) -
added by pm 6 years ago.
maven settings for naan repo
Download all attachments as: .zip