File tree 4 files changed +29
-0
lines changed
main/java/org/openapitools/openapidiff/maven
test/java/org/openapitools/openapidiff/maven
4 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 43
43
<artifactId >junit-jupiter</artifactId >
44
44
<scope >test</scope >
45
45
</dependency >
46
+ <dependency >
47
+ <groupId >org.slf4j</groupId >
48
+ <artifactId >slf4j-simple</artifactId >
49
+ <scope >test</scope >
50
+ </dependency >
46
51
</dependencies >
47
52
48
53
<build >
Original file line number Diff line number Diff line change @@ -25,8 +25,16 @@ public class OpenApiDiffMojo extends AbstractMojo {
25
25
@ Parameter (property = "failOnChanged" , defaultValue = "false" )
26
26
Boolean failOnChanged = false ;
27
27
28
+ @ Parameter (property = "skip" , defaultValue = "false" )
29
+ Boolean skip = false ;
30
+
28
31
@ Override
29
32
public void execute () throws MojoExecutionException , MojoFailureException {
33
+ if (Boolean .TRUE .equals (skip )) {
34
+ getLog ().info ("Skipping openapi-diff execution" );
35
+ return ;
36
+ }
37
+
30
38
try {
31
39
final ChangedOpenApi diff = OpenApiCompare .fromLocations (oldSpec , newSpec );
32
40
getLog ().info (new ConsoleRender ().render (diff ));
Original file line number Diff line number Diff line change @@ -75,4 +75,15 @@ void Should_BackwardIncompatibilityException_When_WantsExceptionAndSpecIsIncompa
75
75
76
76
assertThrows (BackwardIncompatibilityException .class , mojo ::execute );
77
77
}
78
+
79
+ @ Test
80
+ void Should_Skip_Mojo_WhenSkipIsTrue () {
81
+ final OpenApiDiffMojo mojo = new OpenApiDiffMojo ();
82
+ mojo .oldSpec = new File ("src/test/resources/newspec.yaml" ).getAbsolutePath ();
83
+ mojo .newSpec = new File ("src/test/resources/oldspec.yaml" ).getAbsolutePath ();
84
+ mojo .failOnIncompatible = true ;
85
+ mojo .skip = true ;
86
+
87
+ assertDoesNotThrow (mojo ::execute );
88
+ }
78
89
}
Original file line number Diff line number Diff line change 146
146
<artifactId >jcl-over-slf4j</artifactId >
147
147
<version >${slf4j.version} </version >
148
148
</dependency >
149
+ <dependency >
150
+ <groupId >org.slf4j</groupId >
151
+ <artifactId >slf4j-simple</artifactId >
152
+ <version >${slf4j.version} </version >
153
+ </dependency >
149
154
<dependency >
150
155
<groupId >ch.qos.logback</groupId >
151
156
<artifactId >logback-classic</artifactId >
You can’t perform that action at this time.
0 commit comments