File tree Expand file tree Collapse file tree 4 files changed +29
-0
lines changed
main/java/org/openapitools/openapidiff/maven
test/java/org/openapitools/openapidiff/maven Expand file tree Collapse file tree 4 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 4343 <artifactId >junit-jupiter</artifactId >
4444 <scope >test</scope >
4545 </dependency >
46+ <dependency >
47+ <groupId >org.slf4j</groupId >
48+ <artifactId >slf4j-simple</artifactId >
49+ <scope >test</scope >
50+ </dependency >
4651 </dependencies >
4752
4853 <build >
Original file line number Diff line number Diff line change @@ -25,8 +25,16 @@ public class OpenApiDiffMojo extends AbstractMojo {
2525 @ Parameter (property = "failOnChanged" , defaultValue = "false" )
2626 Boolean failOnChanged = false ;
2727
28+ @ Parameter (property = "skip" , defaultValue = "false" )
29+ Boolean skip = false ;
30+
2831 @ Override
2932 public void execute () throws MojoExecutionException , MojoFailureException {
33+ if (Boolean .TRUE .equals (skip )) {
34+ getLog ().info ("Skipping openapi-diff execution" );
35+ return ;
36+ }
37+
3038 try {
3139 final ChangedOpenApi diff = OpenApiCompare .fromLocations (oldSpec , newSpec );
3240 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
7575
7676 assertThrows (BackwardIncompatibilityException .class , mojo ::execute );
7777 }
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+ }
7889}
Original file line number Diff line number Diff line change 146146 <artifactId >jcl-over-slf4j</artifactId >
147147 <version >${slf4j.version} </version >
148148 </dependency >
149+ <dependency >
150+ <groupId >org.slf4j</groupId >
151+ <artifactId >slf4j-simple</artifactId >
152+ <version >${slf4j.version} </version >
153+ </dependency >
149154 <dependency >
150155 <groupId >ch.qos.logback</groupId >
151156 <artifactId >logback-classic</artifactId >
You can’t perform that action at this time.
0 commit comments