Build LinShare from sources

Checkout code

You can either build from the trunk :

$ svn co http://svn.linid.org/svn/linshare/trunk/linshare/

or from a fixed version through tags, or a historical branch :

$ svn co http://svn.linid.org/svn/linshare/branches/0.7/linshare/

Complete repositories list is available there.

Code building

For packaging the code you can use

$ mvn package

This will create a war for postgresql datasource.

To build the installer Jar and Release packages use the following maven command

$ mvn package -Dtarget=distribution

Note: You should use maven > 2.1 to build the installer Jar (see requirements).

Running the war

To run the war you should set up your env. To do this create a directory (here /etc/linshare) and place it the file src/main/resources/linShare.properties.sample as linShare.properties. You can obtain more informations on parameters at configuration

Then deploy your war on a Tomcat or Jetty Server. You should pass the -Dlinshare.config.path=file:///etc/linshare to the Java command to point to your config directory.

Embedded Jetty

To run linshare app directly in an Embedded Jetty use the following maven command

$ mvn -Dlinshare.config.path=file:///etc/linshare jetty:run

You can use -Ph2 for include the h2database and -Popends to start an opends ldap server.
Default properties come with h2 and opends already configured (see configuration).
You only need to set LINSHARE_HOME which should point to your data directory.

To start using LinShare with embedded opends and h2 use:

mvn clean jetty:run -Ph2 -Popends -DLINSHARE_HOME=./target

Then access your linShare at : http://localhost:8080/linshare/

If you use embedded Opends you can use the followings accounts

mail: user1@linpki.org
userPassword: password1

---
mail: user2@linpki.org
userPassword: password2

Using your favorite IDE to develop Linshare

Eclipse

For eclipse its recommended to use at least Eclipse 3.4+ with maven 2 plugin Maven 2

Those useful options can be use to launch Jetty throw eclipse:
-Dorg.mortbay.jetty.webapp.parentLoaderPriority=true 
-Dlinshare.config.path=file:/etc/linshare 
-DLINSHARE_HOME=${workspace_loc}/target

NetBeans

To be done

Frequently met problems

Hibernate sequence initialisation

org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
maybe you forgot to execute this SQL command:
SELECT setval('hibernate_sequence', 100);

Also available in: HTML TXT