Hey everyone,
I have got an update:
Since I only have to do this for SVN, I will use this
https://davidwinter.me/access-control-for-subversion-with-apache2-and-authz/ for protection on the Apache side.
Because SCM Manager has a Source Viewer, I have to manipulate the SVN-Plugin and the BrowserResult() it returns in browse.json.
Since I didn't really knew how to inject this behaviour, I tried using the existing SVN plugin as base for a new one which implements the read protect. I used version 1.45 of the plugin and built my own plugin (I edited the class names).
But when deploying and testing with the scmp:run goal I ran into this error:
[WARNING] /scm/api/rest/repositories/7jP9SZsEf1/browse.json java.lang.IllegalAccessError: tried to access method sonia.scm.repository.spi.FileBaseCommandRequest.getPath()Ljava/lang/String; from class sonia.scm.repository.spi.SvnqBrowseCommand
Could anyone please provide some help and explain what went wrong? I think somehow there are two versions of the same class included (as explained here:
http://stackoverflow.com/questions/7076414/java-lang-illegalaccesserror-tried-to-access-method) but I can't figure out where to look.
My pom.xml file looks like that:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>scm-plugins</artifactId>
<groupId>sonia.scm.plugins</groupId>
<version>1.45</version>
</parent>
<artifactId>scm-restricted-svn-plugin</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>Handles SVN</description>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servlet.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>sonia.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>${svnkit.version}</version>
<exclusions>
<exclusion>
<artifactId>trilead-ssh2</artifactId>
<groupId>org.tmatesoft.svnkit</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>sonia.svnkit</groupId>
<artifactId>svnkit-dav</artifactId>
<version>${svnkit.version}</version>
</dependency>
<!-- test scope -->
<dependency>
<groupId>sonia.scm</groupId>
<artifactId>scm-test</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>sonia.scm.maven</groupId>
<artifactId>scm-maven-plugin</artifactId>
<version>${project.parent.version}</version>
<configuration>
<loggginConfiguration>src/main/conf/logging.xml</loggginConfiguration>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>maven.scm-manager.org</id>
<name>scm-manager release repository</name>
<url>http://maven.scm-manager.org/nexus/content/groups/public</url>
</repository>
<repository>
<id>maven.tmatesoft.com</id>
<name>tmatesoft release repository</name>
<url>http://maven.tmatesoft.com/content/repositories/releases/</url>
</repository>
</repositories>
</project>
I didn't edit any of the classes in the SVN plugin except I added one or two import statements (but nothing regarding the Commands).