$ sudo apt install subversion subversion-tools libapache2-mod-svn
$ svnserve --version svnserve, version 1.9.7 (r1800392) compiled Mar 28 2018, 08:49:13 on x86_64-pc-linux-gnu ...
$ sudo mkdir /data /data/subversion /data/subversion/repositories /data/subversion/repositories/myproject # $ sudo mkdir -p /data/subversion/repositories/myproject $ sudo chmod -R 775 /data/subversion/ $ sudo chown -R mtitek:mtitek /data/subversion/
svnadmin create
" to create the SVN repository:$ svnadmin create /data/subversion/repositories/myproject
$ svn info file://localhost/data/subversion/repositories/myproject Path: myproject URL: file://localhost/data/subversion/repositories/myproject Relative URL: ^/ Repository Root: file://localhost/data/subversion/repositories/myproject ...
$ ls -1 /data/subversion/repositories/myproject conf db format hooks locks README.txt
$ sudo mkdir /data/svn /data/svn/mtitek-svn-test /data/svn/mtitek-svn-test/trunk /data/svn/mtitek-svn-test/branches /data/svn/mtitek-svn-test/tags $ sudo chmod -R 775 /data/svn/mtitek-svn-test/ $ sudo chown -R mtitek:mtitek /data/svn/mtitek-svn-test/
svn import
" to create the SVN project structure:$ svn import /data/svn/mtitek-svn-test file://localhost/data/subversion/repositories/myproject/mtitek-svn-test -m "Initial creation of 'mtitek-svn-test'" Adding /data/svn/mtitek-svn-test/branches Adding /data/svn/mtitek-svn-test/tags Adding /data/svn/mtitek-svn-test/trunk Committing transaction... Committed revision 1.
$ svn ls file://localhost/data/subversion/repositories/myproject/mtitek-svn-test branches/ tags/ trunk/
file:///data/subversion/repositories/myproject/mtitek-svn-test
"$ sudo mkdir /data/workspace $ sudo chmod -R 755 /data/workspace/ $ sudo chown -R mtitek:mtitek /data/workspace/
mvn archetype:generate
" to create the maven project:$ cd /data/workspace/ $ mvn archetype:generate \ -DarchetypeGroupId=org.apache.maven.archetypes \ -DarchetypeArtifactId=maven-archetype-quickstart \ -DarchetypeVersion=1.4 \ -DgroupId=mtitek.svn.test \ -DartifactId=mtitek-svn-test-a \ -Dpackage=mtitek.svn.test \ -Dversion=1.0.0-SNAPSHOT \ -DinteractiveMode=false
$ svn import /data/workspace/mtitek-svn-test-a \ file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/trunk/mtitek-svn-test-a \ -m "Initial creation of 'mtitek-svn-test-a'"
$ svn ls file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/trunk/mtitek-svn-test-a/ pom.xml src/
$ rm -rf /data/workspace/mtitek-svn-test-a
$ svn co file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/trunk/mtitek-svn-test-a/ /data/workspace/mtitek-svn-test-a
pom.xml
" file:$ cd /data/workspace/mtitek-svn-test-a/ $ vi pom.xml
<scm> <connection>scm:svn:file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/trunk/mtitek-svn-test-a</connection> <developerConnection>scm:svn:file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/trunk/mtitek-svn-test-a</developerConnection> <url>file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/trunk/mtitek-svn-test-a</url> </scm>
$ svn ci -m "Adding scm configuration"
$ mvn release:branch \ -DbranchName="mtitek-svn-test-a-branch-1.0.1-SNAPSHOT" \ -DreleaseVersion="1.0.1-SNAPSHOT" \ -DupdateBranchVersions=true \ -DupdateWorkingCopyVersions=false \ -DautoVersionSubmodules=true
$ svn ls file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/branches/mtitek-svn-test-a-branch-1.0.1-SNAPSHOT pom.xml src/
$ cd /data/workspace $ svn co file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/branches/mtitek-svn-test-a-branch-1.0.1-SNAPSHOT /data/workspace/mtitek-svn-test-a-branch-1.0.1-SNAPSHOT
pom.xml
":$ cd /data/workspace/mtitek-svn-test-a-branch-1.0.1-SNAPSHOT $ vi pom.xml
<version>1.0.1-SNAPSHOT</version> <scm> <connection>scm:svn:file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/branches/mtitek-svn-test-a-branch-1.0.1-SNAPSHOT</connection> <developerConnection>scm:svn:file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/branches/mtitek-svn-test-a-branch-1.0.1-SNAPSHOT</developerConnection> <url>file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/branches/mtitek-svn-test-a-branch-1.0.1-SNAPSHOT</url> </scm>
mvn release:perform
:[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project mtitek-svn-test-a: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
mtitek-svn-test-a
" project:$ cd /data/workspace/mtitek-svn-test-a
pom.xml
" file of the project "mtitek-svn-test-a
".distributionManagement
" element to configure the nexus repositories Snapshots and Releases:$ vi pom.xml
<distributionManagement> <snapshotRepository> <id>httpNexusSnapshots</id> <name>Snapshots repository</name> <url>http://localhost:8081/repository/maven-snapshots</url> </snapshotRepository> <repository> <id>httpNexusReleases</id> <name>Releases repository</name> <url>http://localhost:8081/repository/maven-releases</url> </repository> </distributionManagement>
$ svn ci -m "Adding nexus repositories configuration"
mvn versions:use-releases
" command:$ mvn versions:use-releases -DgenerateBackupPoms=false -DexcludeReactor=true
mvn release:prepare
" command:$ mvn release:prepare -DautoVersionSubmodules=true
... What is the release version for "mtitek-svn-test-a"? (mtitek.svn.test:mtitek-svn-test-a) 1.0.0: : What is SCM release tag or label for "mtitek-svn-test-a"? (mtitek.svn.test:mtitek-svn-test-a) mtitek-svn-test-a-1.0.0: : What is the new development version for "mtitek-svn-test-a"? (mtitek.svn.test:mtitek-svn-test-a) 2.0.1-SNAPSHOT: : ...
pom.xml
" file:<version>1.0.1-SNAPSHOT</version>
pom.xml.releaseBackup
" file:<version>1.0.0-SNAPSHOT</version>
mvn release:perform
" command:$ mvn release:perform
[INFO] [INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ mtitek-svn-test-a --- [INFO] Uploaded to httpNexusReleases: http://localhost:8081/repository/maven-releases/mtitek/svn/test/mtitek-svn-test-a/1.0.0/mtitek-svn-test-a-1.0.0.jar [INFO] Uploaded to httpNexusReleases: http://localhost:8081/repository/maven-releases/mtitek/svn/test/mtitek-svn-test-a/1.0.0/mtitek-svn-test-a-1.0.0.pom [INFO] Uploaded to httpNexusReleases: http://localhost:8081/repository/maven-releases/mtitek/svn/test/mtitek-svn-test-a/maven-metadata.xml [INFO] Uploaded to httpNexusReleases: http://localhost:8081/repository/maven-releases/mtitek/svn/test/mtitek-svn-test-a/1.0.0/mtitek-svn-test-a-1.0.0-sources.jar [INFO] Uploaded to httpNexusReleases: http://localhost:8081/repository/maven-releases/mtitek/svn/test/mtitek-svn-test-a/1.0.0/mtitek-svn-test-a-1.0.0-javadoc.jar
$ svn ls file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/tags/mtitek-svn-test-a-1.0.0 pom.xml src/
$ cd /data/workspace
$ svn co file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/tags/mtitek-svn-test-a-1.0.0 /data/workspace/mtitek-svn-test-a-1.0.0
$ cd /data/workspace/mtitek-svn-test-a-1.0.0 $ vi pom.xml
<version>1.0.0</version> <scm> <connection>scm:svn:file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/tags/mtitek-svn-test-a-1.0.0</connection> <developerConnection>scm:svn:file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/tags/mtitek-svn-test-a-1.0.0</developerConnection> <url>file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/tags/mtitek-svn-test-a-1.0.0</url> </scm>
$ sudo mkdir /data/subversion_dump/ $ sudo chmod -R 775 /data/subversion_dump/ $ sudo chown -R mtitek:mtitek /data/subversion_dump/ $ cd /data/subversion/repositories/myproject
$ svnadmin dump . --incremental > /data/subversion_dump/dump-incremental * Dumped revision 0. * Dumped revision 1. * Dumped revision 2. ...
$ svn delete -m "Deleting project 'mtitek-svn-test-a-1.0.0'" file://localhost/data/subversion/repositories/myproject/mtitek-svn-test/tags/mtitek-svn-test-a-1.0.0
$ sudo vi /etc/apache2/sites-available/000-default.conf
VirtualHost
" element:<Location /svn> DAV svn SVNParentPath /data/subversion/repositories SVNListParentPath On AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/subversion/passwd Require valid-user </Location>
$ sudo htpasswd -c /etc/subversion/passwd svnmtitek New password: Re-type new password: Adding password for user svnmtitek
$ sudo a2enmod dav_svn Considering dependency dav for dav_svn: Enabling module dav. Enabling module dav_svn. To activate the new configuration, you need to run: service apache2 restart
$ sudo addgroup subversion $ sudo adduser www-data subversion $ sudo adduser mtitek subversion $ sudo chown -R mtitek:subversion /data/subversion/
$ sudo service apache2 restart
$ svn ls http://localhost/svn/myproject/mtitek-svn-test --username svnmtitek Authentication realm: <http://localhost:80> Subversion Repository Password for 'svnmtitek': ********* branches/ tags/ trunk/
$ cd /data/workspace/mtitek-svn-test-a $ vi pom.xml
<scm> <connection>scm:svn:http://localhost/svn/myproject/mtitek-svn-test/trunk/mtitek-svn-test-a</connection> <developerConnection>scm:svn:http://localhost/svn/myproject/mtitek-svn-test/trunk/mtitek-svn-test-a</developerConnection> <url>http://localhost/svn/myproject/mtitek-svn-test/trunk/mtitek-svn-test-a</url> </scm>
$ svn ci -m "Updating scm connection to use http protocol"
$ rm -rf /data/workspace/mtitek-svn-test-a $ cd /data/workspace
$ svn co http://localhost/svn/myproject/mtitek-svn-test/trunk/mtitek-svn-test-a/ /data/workspace/mtitek-svn-test-a
$ cd /data/workspace/mtitek-svn-test-a
$ svn info Path: . Working Copy Root Path: /data/workspace/mtitek-svn-test-a URL: http://localhost/svn/myproject/mtitek-svn-test/trunk/mtitek-svn-test-a Relative URL: ^/mtitek-svn-test/trunk/mtitek-svn-test-a Repository Root: http://localhost/svn/myproject ...
$ apt list --installed | grep subversion
$ sudo apt remove subversion
$ sudo apt remove --auto-remove subversion