diff --git a/template/entrance/web/src/main/java/{{.packagePath}}/entrance/web/AppApplication.java b/template/entrance/web/src/main/java/{{.packagePath}}/entrance/web/AppApplication.java index 2c278b8..a54a448 100644 --- a/template/entrance/web/src/main/java/{{.packagePath}}/entrance/web/AppApplication.java +++ b/template/entrance/web/src/main/java/{{.packagePath}}/entrance/web/AppApplication.java @@ -5,6 +5,7 @@ import com.vs.sqlmapper.spring.DataSourceConfig; import com.vs.sqlmapper.spring.scan.VSDaoBeanScan; import com.vs.mock.config.EnableVSMockConfiguration; import com.vs.sqlmapper.spring.express.EnableVSMockExpress; +import com.vs.agent.TocoAgentInitializer; import com.vs.debug.stack.agent.LogStackContextInvokeRecorder; import com.vs.debug.stack.agent.MethodVisitorHandlerFilter; @@ -43,6 +44,8 @@ public class AppApplication{ } public static void main(String[] args) { - SpringApplication.run(AppApplication.class,args); + SpringApplication application = new SpringApplication(AppApplication.class); + application.addInitializers(new TocoAgentInitializer()); + application.run(args); } } diff --git a/template/entrance/web/src/main/resources/application.properties b/template/entrance/web/src/main/resources/application.properties index fd5a2cb..5f41314 100644 --- a/template/entrance/web/src/main/resources/application.properties +++ b/template/entrance/web/src/main/resources/application.properties @@ -2,4 +2,6 @@ spring.profiles.active=local envs=local,remote,online,custom project_id=${projectId} -project_name={{ .artifactId }} \ No newline at end of file +project_name={{ .artifactId }} + +com.toco.agent.attach=true \ No newline at end of file diff --git a/template/pom.xml b/template/pom.xml index 71640a8..6409965 100644 --- a/template/pom.xml +++ b/template/pom.xml @@ -31,6 +31,7 @@ 1.0-SNAPSHOT 5.2.4 1.3.0-SNAPSHOT + 1.3.0-SNAPSHOT 1.0.0-SNAPSHOT 1.0.0-SNAPSHOT 1.0.0-SNAPSHOT @@ -70,6 +71,11 @@ common-rpc ${vs.common.rpc.version} + + com.vs + common-agent + ${vs.common.agent.version} + {{- if eq .dbType "mysql" }} {{- else if eq .dbType "postgresql" }}