|
13 | 13 | * <p> |
14 | 14 | * This operation is performed in order, so if there are multiple operations, you need to pay attention to the order. |
15 | 15 | * |
16 | | - * <p> |
17 | | - * For example: |
| 16 | + * <p> Examples: |
| 17 | + * |
| 18 | + * <p> Exclude the {@code slf4j-log4j12} first then add the {@code logback-classic} jar: |
18 | 19 | * <pre>{@code |
19 | | - * ClasspathReplacer({ |
20 | | - * @Action(action = EXCLUDE, value = "slf4j-log4j12-*.jar"), |
21 | | - * @Action(action = ADD, value = "ch.qos.logback:logback-classic:1.4.5") |
22 | | - * }) |
23 | | - * class SomeTest {} |
| 20 | + * @ClasspathReplacer( |
| 21 | + * value = { |
| 22 | + * @Action(verb = EXCLUDE, value = "slf4j-log4j12-*.jar"), |
| 23 | + * @Action(verb = ADD, value = "ch.qos.logback:logback-classic:1.4.5") |
| 24 | + * } |
| 25 | + * ) |
24 | 26 | * }</pre> |
25 | | - * <p> This will exclude the {@code slf4j-log4j12} first then add the {@code logback-classic} jar. |
26 | 27 | * |
27 | | - * <p> |
28 | | - * When add new dependencies, there may be dependency conflicts. For example, the log framework used by the current program is {@code logback}, and the added dependency using {@code log4j}. |
| 28 | + * <p> Exclude the {@code spring-boot-starter-web} and all its sub-dependencies: |
| 29 | + * <pre>{@code |
| 30 | + * @ClasspathReplacer( |
| 31 | + * value = { |
| 32 | + * @Action(verb = EXCLUDE, value = "org.springframework.boot:spring-boot-starter-web") |
| 33 | + * }, |
| 34 | + * recursiveExclude = true |
| 35 | + * ) |
| 36 | + * }</pre> |
| 37 | + * |
| 38 | + * <p> Configure the extra repositories or proxy repository to use when resolving dependencies: |
| 39 | + * <pre>{@code |
| 40 | + * @ClasspathReplacer( |
| 41 | + * value = { |
| 42 | + * @Action(verb = ADD, value = "com.youcompany:your-dependency:1.0.0") |
| 43 | + * }, |
| 44 | + * repositories = { |
| 45 | + * @Repository(value = "https://maven.youcompany.com/repository/release/", username = "admin", password = "${MAVEN_PASSWORD}"), |
| 46 | + * @Repository("https://maven.aliyun.com/repository/public/") |
| 47 | + * } |
| 48 | + * ) |
| 49 | + * }</pre> |
| 50 | + * |
| 51 | + * <p> When add new dependencies, there may be dependency conflicts. For example, the log framework used by the current program is {@code logback}, and the added dependency using {@code log4j}. |
29 | 52 | * Therefore, in complex scenarios, the ability to define the order of actions is a very important feature. |
30 | 53 | * |
31 | 54 | * @author Freeman |
|
0 commit comments