Blog

Assuming you have started a project already and have admin rights,  

create a local sshfs mount:  (http://blog.damontimm.com/how-to-mount-a-sftp-folder-ssh-ftp-on-ubuntu-linux-using-sshfs-fuse/ )

so create a folder to hold the mount:

cd ~/Desktop

mkdir sourceforge

sshfs This email address is being protected from spambots. You need JavaScript enabled to view it.:/home/project-web/clearcheckbookjavaapi /home/stephen/Desktop/sourceforge/

(can unmount with fusermount -u /home/stephen/Desktop/sourceforge/ if you want to change the directory its mounted at)

cd to your htdocs directory

cd /home/stephen/Desktop/sourceforge/htdocs/

create a maven folder

mkdir maven

cd into it

cd maven

make the directory indexable - create .htaccess file with the contents "Options +Indexes" - see http://clearcheckbookjavaapi.sourceforge.net/maven/

vi .htaccess

Options +Indexes

Now follow the steps in this link to create the repository structure and files: http://www.javaworld.com/article/2073230/maven-repository-in-three-steps.html

  1. build the project with extra commands to do the release: mvn install -DperformRelease=true -DcreateChecksum=true
  2. copy the relevant files from your local repository, ~/.m2 to your maven folder in the mount, e.g. /home/stephen/Desktop/sourceforge/htdocs/maven. This will contain the code you deployed plus any projects you have used, so you probably don't need to copy it all.
  3. cd to that folder, e.g. /home/stephen/Desktop/sourceforge/htdocs/maven and go to the release folder of your project, e.g. /home/stephen/Desktop/sourceforge/htdocs/maven/com/leonarduk/clearcheckbook/clearcheckbookapi/0.1 and rename the maven-metadata-local.xml and create the checksums:
    
    mv maven-metadata-local.xml maven-metadata.xml
    md5sum maven-metadata.xml > maven-metadata.xml.md5
    sha1sum maven-metadata.xml > maven-metadata.xml.sha1

You can now use this in another maven project by adding this to its pom.xml

...
	<dependencies>
		<dependency>
			<groupId>com.leonarduk.clearcheckbook</groupId>
			<artifactId>clearcheckbookapi</artifactId>
			<version>0.1</version>
		</dependency>
	</dependencies>
	<repositories>
		<repository>
			<releases>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
				<checksumPolicy>fail</checksumPolicy>
			</releases>
			<id>Clearcheckbookapi</id>
			<name>Clearcheckbookapi</name>
			<url>http://clearcheckbookjavaapi.sourceforge.net/maven/</url>
			<layout>default</layout>
		</repository>
	</repositories>
...