aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-04-16 19:05:09 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-04-16 19:05:09 +0200
commit8ea5c540ef2c1c9e22e06b717758a0d2dcb647a5 (patch)
tree12623b8fcbf7404931ecb8cabc42806e9f328384 /sonar-plugin-api
parentb86b183dfd764d432e353ce19a243ca321dd4f63 (diff)
downloadsonarqube-8ea5c540ef2c1c9e22e06b717758a0d2dcb647a5.tar.gz
sonarqube-8ea5c540ef2c1c9e22e06b717758a0d2dcb647a5.zip
Replacement injection of ServletContext by Properties in Platform
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/pom.xml11
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java7
-rw-r--r--sonar-plugin-api/src/main/resources/sq-version.txt1
3 files changed, 18 insertions, 1 deletions
diff --git a/sonar-plugin-api/pom.xml b/sonar-plugin-api/pom.xml
index 74f16c9a01e..2cd8b5bea82 100644
--- a/sonar-plugin-api/pom.xml
+++ b/sonar-plugin-api/pom.xml
@@ -1,5 +1,6 @@
<?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/xsd/maven-4.0.0.xsd">
+<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -191,6 +192,14 @@
</executions>
</plugin>
</plugins>
+
+ <resources>
+ <resource>
+ <!-- Used to set SonarQube version in sq-version.txt file -->
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
</build>
</project>
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java b/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java
index d6c39401c2d..7fd8afd1b1e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java
@@ -22,6 +22,7 @@ package org.sonar.api.platform;
import org.sonar.api.BatchComponent;
import org.sonar.api.ServerComponent;
+import java.io.File;
import java.util.Date;
/**
@@ -35,6 +36,12 @@ public abstract class Server implements BatchComponent, ServerComponent {
public abstract Date getStartedAt();
+ public abstract File getRootDir();
+
+ public abstract File getDeployDir();
+
+ public abstract String getContextPath();
+
/**
* @return the server URL when executed from batch, else null.
* @since 2.4
diff --git a/sonar-plugin-api/src/main/resources/sq-version.txt b/sonar-plugin-api/src/main/resources/sq-version.txt
new file mode 100644
index 00000000000..ad96e7cf933
--- /dev/null
+++ b/sonar-plugin-api/src/main/resources/sq-version.txt
@@ -0,0 +1 @@
+${project.version}