aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/batch/BatchIndex.java5
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/batch/BatchWs.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/platform/web/RoutesFilter.java8
-rw-r--r--sonar-application/assembly.xml3
4 files changed, 11 insertions, 9 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/batch/BatchIndex.java b/server/sonar-server/src/main/java/org/sonar/server/batch/BatchIndex.java
index 511c90baf40..9fbf1e9e0af 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/batch/BatchIndex.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/batch/BatchIndex.java
@@ -34,7 +34,8 @@ import org.sonar.api.server.ServerSide;
import org.sonar.server.platform.ServerFileSystem;
/**
- * JAR files to be downloaded by sonar-runner.
+ * Scanner Engine JAR file(s) to be downloaded by sonar-scanner-api. There is currently only one JAR (see assembly.xml)
+ * but let's keep possibility to pass several files for possible future evolutions.
*/
@ServerSide
public class BatchIndex implements Startable {
@@ -50,7 +51,7 @@ public class BatchIndex implements Startable {
@Override
public void start() {
StringBuilder sb = new StringBuilder();
- batchDir = new File(fs.getHomeDir(), "lib/batch");
+ batchDir = new File(fs.getHomeDir(), "lib/scanner");
if (batchDir.exists()) {
Collection<File> files = FileUtils.listFiles(batchDir, HiddenFileFilter.VISIBLE, FileFilterUtils.directoryFileFilter());
for (File file : files) {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/batch/BatchWs.java b/server/sonar-server/src/main/java/org/sonar/server/batch/BatchWs.java
index 0b8b5bcb13b..8218c8e57fc 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/batch/BatchWs.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/batch/BatchWs.java
@@ -55,7 +55,7 @@ public class BatchWs implements WebService {
controller.createAction("index")
.setInternal(true)
.setSince("4.4")
- .setDescription("List the JAR files to be downloaded by source analyzer")
+ .setDescription("List the JAR files to be downloaded by scanners")
.setHandler((request, response) -> {
try {
response.stream().setMediaType("text/plain");
@@ -71,7 +71,7 @@ public class BatchWs implements WebService {
NewAction action = controller.createAction("file")
.setInternal(true)
.setSince("4.4")
- .setDescription("Download a JAR file required by source analyzer")
+ .setDescription("Download a JAR file listed in the index (see batch/index)")
.setResponseExample(getClass().getResource("batch-file-example.txt"))
.setHandler((request, response) -> {
String filename = request.mandatoryParam("name");
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/web/RoutesFilter.java b/server/sonar-server/src/main/java/org/sonar/server/platform/web/RoutesFilter.java
index 5de1bd2971b..55338541c03 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/web/RoutesFilter.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/web/RoutesFilter.java
@@ -19,8 +19,6 @@
*/
package org.sonar.server.platform.web;
-import static java.lang.String.format;
-
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
@@ -31,6 +29,8 @@ import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import static java.lang.String.format;
+
public class RoutesFilter implements Filter {
private static final String EMPTY = "";
@@ -43,10 +43,10 @@ public class RoutesFilter implements Filter {
HttpServletResponse response = (HttpServletResponse) servletResponse;
String path = request.getRequestURI().replaceFirst(request.getContextPath(), EMPTY);
if (path.startsWith(BATCH_WS + "/") && path.endsWith(".jar")) {
- // Scanner is still using /batch/file.jar url
+ // Old scanners were using /batch/file.jar url (see SCANNERAPI-167)
response.sendRedirect(format("%s%s/file?name=%s", request.getContextPath(), BATCH_WS, path.replace(BATCH_WS + "/", EMPTY)));
} else if ("/batch_bootstrap/index".equals(path)) {
- // Scanner is still using /batch_bootstrap url
+ // Old scanners were using /batch_bootstrap url (see SCANNERAPI-167)
response.sendRedirect(format("%s%s/index", request.getContextPath(), BATCH_WS));
} else if (API_SOURCES_WS.equals(path)) {
// SONAR-7852 /api/sources?resource url is still used
diff --git a/sonar-application/assembly.xml b/sonar-application/assembly.xml
index dc2e1dadf0b..bdb5076457e 100644
--- a/sonar-application/assembly.xml
+++ b/sonar-application/assembly.xml
@@ -80,8 +80,9 @@
<scope>provided</scope>
</dependencySet>
+ <!-- Scanner Engine that is returned by batch/index WS -->
<dependencySet>
- <outputDirectory>lib/batch</outputDirectory>
+ <outputDirectory>lib/scanner</outputDirectory>
<useTransitiveDependencies>false</useTransitiveDependencies>
<includes>
<include>org.sonarsource.sonarqube:sonar-scanner-engine-shaded</include>