Jim Sellers
Jim Sellers

Reputation: 553

Sonarqube 5.2 doesn't like working directory as a sym link. How to specify the working dir?

With sonarqube 5.2, it uses Files.createDirectories which does not like if the last part is a sym link. https://bugs.openjdk.java.net/browse/JDK-8130464

Caused by: java.nio.file.FileAlreadyExistsException: /home/bamboo/.sonar
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:88)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:383)
    at java.nio.file.Files.createDirectory(Files.java:630)
    at java.nio.file.Files.createAndCheckIsDirectory(Files.java:734)
    at java.nio.file.Files.createDirectories(Files.java:683)
    at org.sonar.batch.bootstrap.GlobalTempFolderProvider.createTempFolder(GlobalTempFolderProvider.java:83)
    ... 92 more

How are you supposed to specify the working directory? I've tried sonar.properties using the key sonar.working.directory but that did not seem to work. https://github.com/SonarSource/sonarqube/blob/master/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java#L457

Thanks in advance for your help.

Upvotes: 2

Views: 463

Answers (1)

Duarte Meneses
Duarte Meneses

Reputation: 2938

The property you referred is used to define the working directory within the project being analysed.

The problem you are having is related to the sonar home directory, which is usually global per user and located in ~/.sonar.

Try with sonar.userHome.

The path is defined here: https://github.com/SonarSource/sonarqube/blob/master/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalTempFolderProvider.java#L95

Upvotes: 2

Related Questions