Thursday, August 27, 2009

Adding a java library to local maven repository.

Downloading jar file somewhere on hdd.
Execute command:
mvn install:install-file -Dfile=/home/erani/jlibs/kaptcha-2.3.jar -DgroupId=com.google.code
-DartifactId=kaptcha -Dversion=2.3 -Dpackaging=jar


adding dependency in pom.xml

<dependency>
<groupId>com.google.code</groupId>
<artifactId>kaptcha</artifactId>
<version>2.3</version>
</dependency>

Thursday, August 13, 2009

SVN and web access

So we need an access to svn throw apache, here is how to do it.
I will assume that a svn repository already made, if not, consult please http://artis.imag.fr/~Xavier.Decoret/resources/svn/index.html

1. Install apache2, and libapache2-svn

2. Create "svn" directory in /etc and enter in it.
mkdir /etc/svn
cd /etc/svn


3. Create access file for two users:
htpasswd -cm users root
htpasswd -m users user

You will be prompted to enter password twice for each user, do it.

4. Create roles file
nano control
And add following:
[/]
root=rw
user=r

If you want to add role for specific folder in project than add also
[myproject:/]
root=rw
user=rw


5. Configure Apache2.
Find configuration file for apache2, it's depend of Linux distribution. Add/Edit the file so that in result you will have:


<location>
DAV svn
SVNPath /lib/svn # path to svn repository
AuthzSVNAccessFile /etc/svn/control
Require valid-user
AuthType Basic
AuthName "Subversion Repositories at example.com"
AuthUserFile /etc/svn/users
</location>


6 Restart apache

I hope it will be helpful.

Also you can look at:
http://queens.db.toronto.edu/~nilesh/linux/subversion-howto/
http://www.howtoforge.com/subversion_web_access_apache
http://www.howtogeek.com/howto/ubuntu/install-subversion-with-web-access-on-ubuntu/