From 7183e066def4e42afaa70288963ea19d6e9a0899 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Fri, 21 Oct 2022 11:50:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E7=89=87=E6=AE=B5=E6=89=A7?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project-management/backend/pom.xml | 47 +++++++++++++++++++ .../listener/ProjectAppStartListener.java | 25 ++++++++++ 2 files changed, 72 insertions(+) diff --git a/project-management/backend/pom.xml b/project-management/backend/pom.xml index ecf239a272..aa20ba6e02 100644 --- a/project-management/backend/pom.xml +++ b/project-management/backend/pom.xml @@ -117,6 +117,53 @@ ${java.version} + + org.apache.maven.plugins + maven-dependency-plugin + + + copy + generate-resources + + copy + + + + + + + org.apache.jmeter + ApacheJMeter_functions + ${jmeter.version} + jar + true + src/main/resources/jmeter/lib/ext + ApacheJMeter_functions.jar + + + io.metersphere + metersphere-jmeter-functions + ${metersphere-jmeter-functions.version} + jar + true + src/main/resources/jmeter/lib/ext + metersphere-jmeter-functions.jar + + + org.python + jython-standalone + ${jython.version} + jar + true + src/main/resources/jmeter/lib/ext + jython-standalone.jar + + + ${project.build.directory}/wars + false + true + + diff --git a/project-management/backend/src/main/java/io/metersphere/listener/ProjectAppStartListener.java b/project-management/backend/src/main/java/io/metersphere/listener/ProjectAppStartListener.java index db8a2baafe..ce5b335750 100644 --- a/project-management/backend/src/main/java/io/metersphere/listener/ProjectAppStartListener.java +++ b/project-management/backend/src/main/java/io/metersphere/listener/ProjectAppStartListener.java @@ -2,6 +2,8 @@ package io.metersphere.listener; import io.metersphere.commons.utils.LogUtil; import org.apache.jmeter.util.JMeterUtils; +import org.python.core.Options; +import org.python.util.PythonInterpreter; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.context.ApplicationListener; import org.springframework.context.i18n.LocaleContextHolder; @@ -14,8 +16,13 @@ public class ProjectAppStartListener implements ApplicationListener