Skip to content

Commit 72adebd

Browse files
authored
Merge pull request apache#564 from lytscu/develop
spring mvc-annotation -3.x not work
2 parents 1cf0658 + 2568553 commit 72adebd

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-3.x-plugin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
<groupId>org.springframework</groupId>
3737
<artifactId>spring-core</artifactId>
3838
<version>3.2.18.RELEASE</version>
39-
<scope>compile</scope>
39+
<scope>provided</scope>
4040
</dependency>
4141
<dependency>
4242
<groupId>org.springframework</groupId>
4343
<artifactId>spring-webmvc</artifactId>
4444
<version>3.2.18.RELEASE</version>
45-
<scope>compile</scope>
45+
<scope>provided</scope>
4646
</dependency>
4747
<dependency>
4848
<groupId>javax.servlet</groupId>

apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
<groupId>org.springframework</groupId>
3737
<artifactId>spring-core</artifactId>
3838
<version>4.3.10.RELEASE</version>
39-
<scope>compile</scope>
39+
<scope>provided</scope>
4040
</dependency>
4141
<dependency>
4242
<groupId>org.springframework</groupId>
4343
<artifactId>spring-webmvc</artifactId>
4444
<version>4.3.8.RELEASE</version>
45-
<scope>compile</scope>
45+
<scope>provided</scope>
4646
</dependency>
4747
<dependency>
4848
<groupId>javax.servlet</groupId>

apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/skywalking/apm/plugin/spring/mvc/v4/define/AbstractControllerInstrumentation.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
* <code>org.springframework.web.bind.annotation.RequestMapping</code> that class has
3636
* <code>org.springframework.stereotype.Controller</code> annotation.
3737
*
38-
* <code>org.skywalking.apm.plugin.spring.mvc.ControllerConstructorInterceptor</code> set the controller base path to
38+
* <code>org.skywalking.apm.plugin.spring.mvc.v4.ControllerConstructorInterceptor</code> set the controller base path to
3939
* dynamic field before execute constructor.
4040
*
41-
* <code>org.skywalking.apm.plugin.spring.mvc.RequestMappingMethodInterceptor</code> get the request path from
41+
* <code>org.skywalking.apm.plugin.spring.mvc.v4.RequestMappingMethodInterceptor</code> get the request path from
4242
* dynamic field first, if not found, <code>RequestMappingMethodInterceptor</code> generate request path that
4343
* combine the path value of current annotation on current method and the base path and set the new path to the dynamic
4444
* filed
@@ -57,7 +57,7 @@ public ElementMatcher<MethodDescription> getConstructorMatcher() {
5757

5858
@Override
5959
public String getConstructorInterceptor() {
60-
return "org.skywalking.apm.plugin.spring.mvc.ControllerConstructorInterceptor";
60+
return "org.skywalking.apm.plugin.spring.mvc.v4.ControllerConstructorInterceptor";
6161
}
6262
}
6363
};
@@ -74,7 +74,7 @@ public ElementMatcher<MethodDescription> getMethodsMatcher() {
7474

7575
@Override
7676
public String getMethodsInterceptor() {
77-
return "org.skywalking.apm.plugin.spring.mvc.RequestMappingMethodInterceptor";
77+
return "org.skywalking.apm.plugin.spring.mvc.v4.RequestMappingMethodInterceptor";
7878
}
7979

8080
@Override
@@ -94,7 +94,7 @@ public ElementMatcher<MethodDescription> getMethodsMatcher() {
9494

9595
@Override
9696
public String getMethodsInterceptor() {
97-
return "org.skywalking.apm.plugin.spring.mvc.RestMappingMethodInterceptor";
97+
return "org.skywalking.apm.plugin.spring.mvc.v4.RestMappingMethodInterceptor";
9898
}
9999

100100
@Override

apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/test/java/org/skywalking/apm/plugin/spring/mvc/v4/define/ControllerInstrumentationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public void testGetEnhanceAnnotations() throws Throwable {
5252
public void testGetInstanceMethodsInterceptPoints() throws Throwable {
5353
InstanceMethodsInterceptPoint[] methodPoints = controllerInstrumentation.getInstanceMethodsInterceptPoints();
5454
assertThat(methodPoints.length, is(2));
55-
assertThat(methodPoints[0].getMethodsInterceptor(), is("org.skywalking.apm.plugin.spring.mvc.RequestMappingMethodInterceptor"));
56-
assertThat(methodPoints[1].getMethodsInterceptor(), is("org.skywalking.apm.plugin.spring.mvc.RestMappingMethodInterceptor"));
55+
assertThat(methodPoints[0].getMethodsInterceptor(), is("org.skywalking.apm.plugin.spring.mvc.v4.RequestMappingMethodInterceptor"));
56+
assertThat(methodPoints[1].getMethodsInterceptor(), is("org.skywalking.apm.plugin.spring.mvc.v4.RestMappingMethodInterceptor"));
5757

5858
Assert.assertFalse(methodPoints[0].isOverrideArgs());
5959
Assert.assertFalse(methodPoints[1].isOverrideArgs());
@@ -70,7 +70,7 @@ public void testGetConstructorsInterceptPoints() throws Throwable {
7070
ConstructorInterceptPoint cip = cips[0];
7171
Assert.assertNotNull(cip);
7272

73-
Assert.assertEquals(cip.getConstructorInterceptor(), "org.skywalking.apm.plugin.spring.mvc.ControllerConstructorInterceptor");
73+
Assert.assertEquals(cip.getConstructorInterceptor(), "org.skywalking.apm.plugin.spring.mvc.v4.ControllerConstructorInterceptor");
7474
Assert.assertTrue(cip.getConstructorMatcher().equals(ElementMatchers.any()));
7575
}
7676
}

apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/test/java/org/skywalking/apm/plugin/spring/mvc/v4/define/RestControllerInstrumentationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public void testGetEnhanceAnnotations() throws Throwable {
5050
public void testGetInstanceMethodsInterceptPoints() throws Throwable {
5151
InstanceMethodsInterceptPoint[] methodPoints = restControllerInstrumentation.getInstanceMethodsInterceptPoints();
5252
assertThat(methodPoints.length, is(2));
53-
assertThat(methodPoints[0].getMethodsInterceptor(), is("org.skywalking.apm.plugin.spring.mvc.RequestMappingMethodInterceptor"));
54-
assertThat(methodPoints[1].getMethodsInterceptor(), is("org.skywalking.apm.plugin.spring.mvc.RestMappingMethodInterceptor"));
53+
assertThat(methodPoints[0].getMethodsInterceptor(), is("org.skywalking.apm.plugin.spring.mvc.v4.RequestMappingMethodInterceptor"));
54+
assertThat(methodPoints[1].getMethodsInterceptor(), is("org.skywalking.apm.plugin.spring.mvc.v4.RestMappingMethodInterceptor"));
5555

5656
Assert.assertFalse(methodPoints[0].isOverrideArgs());
5757
Assert.assertFalse(methodPoints[1].isOverrideArgs());

0 commit comments

Comments
 (0)