Skip to content

Commit d39047a

Browse files
committed
Optimize the pom dependencies of joylive-core-api
1 parent fedf515 commit d39047a

7 files changed

Lines changed: 19 additions & 10 deletions

File tree

joylive-core/joylive-core-framework/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
<dependency>
1717
<groupId>com.jd.live</groupId>
1818
<artifactId>joylive-core-api</artifactId>
19+
<scope>provided</scope>
1920
</dependency>
2021
<dependency>
2122
<groupId>org.projectlombok</groupId>
2223
<artifactId>lombok</artifactId>
2324
</dependency>
2425
</dependencies>
25-
</project>
26+
</project>

joylive-core/joylive-core-mcp-server/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<dependency>
2020
<groupId>com.jd.live</groupId>
2121
<artifactId>joylive-core-api</artifactId>
22+
<scope>provided</scope>
2223
</dependency>
2324
<dependency>
2425
<groupId>org.projectlombok</groupId>

joylive-core/joylive-governance-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<dependency>
2020
<groupId>com.jd.live</groupId>
2121
<artifactId>joylive-core-api</artifactId>
22+
<scope>provided</scope>
2223
</dependency>
2324
<dependency>
2425
<groupId>com.jd.live</groupId>
@@ -36,7 +37,6 @@
3637
<groupId>org.projectlombok</groupId>
3738
<artifactId>lombok</artifactId>
3839
</dependency>
39-
4040
</dependencies>
4141

4242
</project>

joylive-core/joylive-governance-api/src/test/java/com/jd/live/agent/governance/policy/service/CircuitBreakPolicyTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ void testProtectMode() {
2727
CircuitBreakPolicy policy = new CircuitBreakPolicy();
2828
policy.setOutlierMaxPercent(50);
2929
policy.setLevel(CircuitBreakLevel.SERVICE);
30-
Assertions.assertTrue(policy.isProtectMode(null, 1));
31-
Assertions.assertTrue(policy.isProtectMode(null, 2));
30+
Assertions.assertFalse(policy.isProtectMode(null, 1));
31+
Assertions.assertFalse(policy.isProtectMode(null, 2));
3232
policy.setLevel(CircuitBreakLevel.API);
33-
Assertions.assertTrue(policy.isProtectMode(null, 1));
34-
Assertions.assertTrue(policy.isProtectMode(null, 2));
33+
Assertions.assertFalse(policy.isProtectMode(null, 1));
34+
Assertions.assertFalse(policy.isProtectMode(null, 2));
3535
policy.setLevel(CircuitBreakLevel.INSTANCE);
3636
Assertions.assertTrue(policy.isProtectMode(null, 1));
3737
Assertions.assertFalse(policy.isProtectMode(null, 2));
@@ -57,8 +57,8 @@ void testProtected() {
5757
// Simulate 1 broken instance (add inspector)
5858
policy.addInspector("instance-1", now -> null);
5959

60-
// outlierMaxPercent=100%, 1 broken instance, 1 total → 1/1=100% at limit, not over → NOT protected
61-
Assertions.assertFalse(policy.isProtected(1));
60+
// outlierMaxPercent=100%, 1 broken instance, 1 total → 1/1=100% at limit, we should start protecting!
61+
Assertions.assertTrue(policy.isProtected(1));
6262
Assertions.assertFalse(policy.isProtected(2));
6363

6464
// Verify the bug scenario: isProtectMode (with +1) incorrectly returns true for new/unknown endpoints

joylive-implement/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<dependency>
3434
<groupId>com.jd.live</groupId>
3535
<artifactId>joylive-core-api</artifactId>
36+
<scope>provided</scope>
3637
</dependency>
3738

3839
<dependency>
@@ -52,4 +53,4 @@
5253
</dependency>
5354
</dependencies>
5455

55-
</project>
56+
</project>

joylive-plugin/pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@
2727
<dependency>
2828
<groupId>com.jd.live</groupId>
2929
<artifactId>joylive-core-api</artifactId>
30+
<scope>provided</scope>
3031
</dependency>
3132
<dependency>
3233
<groupId>com.jd.live</groupId>
3334
<artifactId>joylive-governance-api</artifactId>
35+
<scope>provided</scope>
3436
</dependency>
3537
</dependencies>
3638

37-
</project>
39+
</project>

joylive-test/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
</modules>
2222

2323
<dependencies>
24+
<dependency>
25+
<groupId>com.jd.live</groupId>
26+
<artifactId>joylive-core-api</artifactId>
27+
</dependency>
2428
<dependency>
2529
<groupId>com.jd.live</groupId>
2630
<artifactId>joylive-core-framework</artifactId>

0 commit comments

Comments
 (0)