Application.java文件内容
package io.metersphere;
import io.metersphere.config.JmeterProperties;
import io.metersphere.config.KafkaProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration;
import org.springframework.boot.autoconfigure.neo4j.Neo4jAutoConfiguration;
import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication(exclude = {
QuartzAutoConfiguration.class,
LdapAutoConfiguration.class,
Neo4jAutoConfiguration.class
})
@ServletComponentScan
@EnableConfigurationProperties({
KafkaProperties.class,
JmeterProperties.class
})
@EnableScheduling
@PropertySource(value = {
"classpath:/base.properties",
"file:D:\\ideaProject\\MeterSphere\\MeterSphere\\backend\\src\\main\\resources\\metersphere.properties",
// "file:C:\\Users\\29450\\IdeaProjects\\MeterSphere\\backend\\src\\main\\resources\\metersphere.properties",
}, encoding = "UTF-8", ignoreResourceNotFound = true)
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
metersphere.properties文件内容
# ?????
spring.datasource.url=jdbc:mysql://192.168.1.5:3307/metersphere?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false
spring.datasource.username=root
spring.datasource.password=root
# kafka ???node-controller ?? data-streaming ?????? kafka ????????????
kafka.partitions=1
kafka.replicas=1
kafka.topic=JMETER_METRICS
kafka.test.topic=JMETER_TESTS
kafka.bootstrap-servers={KAFKA_IP}:19092
kafka.log.topic=JMETER_LOGS
kafka.report.topic=JMETER_REPORTS
# node-controller ???? jmeter ????
jmeter.image=registry.fit2cloud.com/metersphere/jmeter-master:0.0.6
# TCP Mock ????
tcp.mock.port=10000-10010
# Redis ??
spring.redis.host=192.168.1.5
spring.redis.port=6379
spring.redis.password=Password123@redis
# ?????lcoal ???????????
run.mode=local
vue.config.js文件内容
const path = require('path');
const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin')
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
productionSourceMap: false,
devServer: {
port: 8080,
proxy: {
//1.8需求:增加分享功能,不登陆即可看到文档页面。所以代理设置增加了(?!/document)文档页面的相关信息
// ['^(?!/login)']: {
['^((?!/login)(?!/document))']: {
target: 'http://localhost:8081',
ws: true,
},
}
},
pages: {
business: {
entry: "src/business/main.js",
template: "src/business/index.html",
filename: "index.html"
},
login: {
entry: "src/login/login.js",
template: "src/login/login.html",
filename: "login.html"
},
document: {
entry: "src/document/document.js",
template: "src/document/document.html",
filename: "document.html",
},
sharePlanReport: {
entry: "src/template/report/plan/share/share-plan-report.js",
template: "src/template/report/plan/share/share-plan-report.html",
filename: "share-plan-report.html",
},
sharePerformanceReport: {
entry: "src/template/report/performance/share/share-performance-report.js",
template: "src/template/report/performance/share/share-performance-report.html",
filename: "share-performance-report.html",
},
shareApiReport: {
entry: "src/template/report/api/share/share-api-report.js",
template: "src/template/report/api/share/share-api-report.html",
filename: "share-api-report.html",
},
shareUiReport: {
entry: "src/template/report/ui/share/share-ui-report.js",
template: "src/template/report/ui/share/share-ui-report.html",
filename: "share-ui-report.html",
},
enterpriseReport: {
entry: "src/template/enterprise/share/share-enterprise-report.js",
template: "src/template/enterprise/share/share-enterprise-report.html",
filename: "share-enterprise-report.html",
},
planReport: { //这个配置要放最后,不然会导致测试计划导出报告没有将css和js引入html,原因没具体研究
entry: "src/template/report/plan/plan-report.js",
template: "src/template/report/plan/plan-report.html",
filename: "plan-report.html",
}
},
configureWebpack: {
devtool: 'cheap-module-source-map',
resolve: {
alias: {
'@': resolve('src')
}
},
},
css: {
extract: {
ignoreOrder: true,
}
},
chainWebpack: config => {
// 报告模板打包成一个html
config.plugin('html-planReport')
.tap(args => {
args[0].inlineSource = '.(js|css)$';
return args;
});
config.plugin('inline-source-html-planReport')
.after('html-planReport')
.use(HtmlWebpackInlineSourcePlugin);
config.plugins.delete('prefetch');
}
};
配置文件路径
启动metersphere
后端启动Application
启动前端
在终端里进入前端目录
cd frontend
D:\ideaProject\MeterSphere\MeterSphere>cd frontend
D:\ideaProject\MeterSphere\MeterSphere\frontend>npm i
D:\ideaProject\MeterSphere\MeterSphere\frontend>npm run serve