OpenAPITools / openapi-diff

Utility for comparing two OpenAPI specifications.
Apache License 2.0
804 stars 153 forks source link

[ERROR] Invalid packaging for parent POM org.apache.commons:commons-collections4:4.4, must be "pom" but is "jar" @ #408

Closed P-Shivkumar closed 1 year ago

P-Shivkumar commented 2 years ago

Hi team,

While using this plugin to get diff of the openapi specs, I am getting this error. Full stack trace I am attaching here.

I have used this plugin as below:

            <plugin>
                <groupId>org.openapitools.openapidiff</groupId>
                <artifactId>openapi-diff-maven</artifactId>
                <version>${openapi-diff-version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>diff</goal>
                        </goals>
                        <configuration>
                            <!-- Reference specification (perhaps your prod schema) -->
                            <oldSpec>${project.basedir}/src/main/resources/openapi.json</oldSpec>
                            <!-- Specification generated by your project in the compile phase -->
                            <newSpec>${project.basedir}/target/classes/openapi.yaml</newSpec>
                            <!-- Fail only if API changes broke backward compatibility (default: false) -->
                            <failOnIncompatible>true</failOnIncompatible>
                            <!-- Fail if API changed (default: false) -->
                            <failOnChanged>true</failOnChanged>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
[DEBUG]   Included /Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven-event-listener.jar
[DEBUG] Populating class realm maven.ext
[DEBUG]   Included /Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven-event-listener.jar
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: javax.annotation.* < maven.ext
[DEBUG]   Imported: javax.annotation.security.* < maven.ext
[DEBUG]   Imported: javax.inject.* < maven.ext
[DEBUG]   Imported: org.apache.maven.* < maven.ext
[DEBUG]   Imported: org.apache.maven.artifact < maven.ext
[DEBUG]   Imported: org.apache.maven.classrealm < maven.ext
[DEBUG]   Imported: org.apache.maven.cli < maven.ext
[DEBUG]   Imported: org.apache.maven.configuration < maven.ext
[DEBUG]   Imported: org.apache.maven.exception < maven.ext
[DEBUG]   Imported: org.apache.maven.execution < maven.ext
[DEBUG]   Imported: org.apache.maven.execution.scope < maven.ext
[DEBUG]   Imported: org.apache.maven.lifecycle < maven.ext
[DEBUG]   Imported: org.apache.maven.model < maven.ext
[DEBUG]   Imported: org.apache.maven.monitor < maven.ext
[DEBUG]   Imported: org.apache.maven.plugin < maven.ext
[DEBUG]   Imported: org.apache.maven.profiles < maven.ext
[DEBUG]   Imported: org.apache.maven.project < maven.ext
[DEBUG]   Imported: org.apache.maven.reporting < maven.ext
[DEBUG]   Imported: org.apache.maven.repository < maven.ext
[DEBUG]   Imported: org.apache.maven.rtinfo < maven.ext
[DEBUG]   Imported: org.apache.maven.settings < maven.ext
[DEBUG]   Imported: org.apache.maven.toolchain < maven.ext
[DEBUG]   Imported: org.apache.maven.usability < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.* < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.authentication < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.authorization < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.events < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.observers < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.proxy < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.repository < maven.ext
[DEBUG]   Imported: org.apache.maven.wagon.resource < maven.ext
[DEBUG]   Imported: org.codehaus.classworlds < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.* < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.classworlds < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.component < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.configuration < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.container < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.context < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.lifecycle < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.logging < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.personality < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < maven.ext
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < maven.ext
[DEBUG]   Imported: org.eclipse.aether.* < maven.ext
[DEBUG]   Imported: org.eclipse.aether.artifact < maven.ext
[DEBUG]   Imported: org.eclipse.aether.collection < maven.ext
[DEBUG]   Imported: org.eclipse.aether.deployment < maven.ext
[DEBUG]   Imported: org.eclipse.aether.graph < maven.ext
[DEBUG]   Imported: org.eclipse.aether.impl < maven.ext
[DEBUG]   Imported: org.eclipse.aether.installation < maven.ext
[DEBUG]   Imported: org.eclipse.aether.internal.impl < maven.ext
[DEBUG]   Imported: org.eclipse.aether.metadata < maven.ext
[DEBUG]   Imported: org.eclipse.aether.repository < maven.ext
[DEBUG]   Imported: org.eclipse.aether.resolution < maven.ext
[DEBUG]   Imported: org.eclipse.aether.spi < maven.ext
[DEBUG]   Imported: org.eclipse.aether.transfer < maven.ext
[DEBUG]   Imported: org.eclipse.aether.version < maven.ext
[DEBUG]   Imported: org.fusesource.jansi.* < maven.ext
[DEBUG]   Imported: org.slf4j.* < maven.ext
[DEBUG]   Imported: org.slf4j.event.* < maven.ext
[DEBUG]   Imported: org.slf4j.helpers.* < maven.ext
[DEBUG]   Imported: org.slf4j.spi.* < maven.ext
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Message scheme: color
[DEBUG] Message styles: debug info warning error success failure strong mojo project
[DEBUG] Reading global settings from /usr/local/Cellar/maven/3.8.5/libexec/conf/settings.xml
[DEBUG] Reading user settings from /Users/shivkpat/.m2/settings.xml
[DEBUG] Reading global toolchains from /usr/local/Cellar/maven/3.8.5/libexec/conf/toolchains.xml
[DEBUG] Reading user toolchains from /Users/<user>/.m2/toolchains.xml
[DEBUG] Using local repository at /Users/<user>/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /Users/<user>/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Dependency collection stats {ConflictMarker.analyzeTime=622815, ConflictMarker.markTime=265089, ConflictMarker.nodeCount=20, ConflictIdSorter.graphTime=350591, ConflictIdSorter.topsortTime=218243, ConflictIdSorter.conflictIdCount=14, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=3330371, ConflictResolver.conflictItemCount=20, DefaultDependencyCollector.collectTime=168383106, DefaultDependencyCollector.transformTime=6564216}
[DEBUG] kr.motd.maven:os-maven-plugin:jar:1.6.2
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.5.3:compile
[DEBUG]       org.apache.maven:maven-model:jar:3.5.3:compile
[DEBUG]          org.apache.commons:commons-lang3:jar:3.5:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:3.5.3:compile
[DEBUG]       org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.3:compile
[DEBUG]          javax.enterprise:cdi-api:jar:1.0:compile
[DEBUG]             javax.annotation:jsr250-api:jar:1.0:compile
[DEBUG]             javax.inject:javax.inject:jar:1:compile
[DEBUG]          org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.3:compile
[DEBUG]          org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG]       org.codehaus.plexus:plexus-classworlds:jar:2.5.2:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.1.0:compile
[DEBUG]    com.google.code.findbugs:jsr305:jar:3.0.2:compile
[DEBUG] Created new class realm extension>kr.motd.maven:os-maven-plugin:1.6.2
[DEBUG] Importing foreign packages into class realm extension>kr.motd.maven:os-maven-plugin:1.6.2
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm extension>kr.motd.maven:os-maven-plugin:1.6.2
[DEBUG]   Included: kr.motd.maven:os-maven-plugin:jar:1.6.2
[DEBUG]   Included: org.apache.commons:commons-lang3:jar:3.5
[DEBUG]   Included: javax.enterprise:cdi-api:jar:1.0
[DEBUG]   Included: javax.annotation:jsr250-api:jar:1.0
[DEBUG]   Included: org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.3
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.1.0
[DEBUG]   Included: com.google.code.findbugs:jsr305:jar:3.0.2
 [ClassRealm[extension>kr.motd.maven:os-maven-plugin:1.6.2, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@6a6824be]]
[DEBUG] Looking up lifecycle mappings for packaging jar from ClassRealm
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for messaging:dataops:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-surefire-plugin @ line 628, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 12.5
[INFO] os.detected.version.major: 12
[INFO] os.detected.version.minor: 5
[INFO] os.detected.classifier: osx-x86_64
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: messaging:dataops:jar:1.0-SNAPSHOT
[DEBUG] Tasks:   [org.openapitools.openapidiff:openapi-diff-maven:2.0.1:diff]
[DEBUG] Style:   Regular
[DEBUG] =======================================================================
[INFO] 
[INFO] ------------------< messaging:dataops >------------------
[INFO] Building dataops 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project:       messaging:dataops:1.0-SNAPSHOT
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): []
[DEBUG] Repositories (dependencies): Few dependencies
[DEBUG] Repositories (plugins)     : plugins repo
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.openapitools.openapidiff:openapi-diff-maven:2.0.1:diff (default-cli)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <failOnChanged default-value="false">${failOnChanged}</failOnChanged>
  <failOnIncompatible default-value="false">${failOnIncompatible}</failOnIncompatible>
  <newSpec>${newSpec}</newSpec>
  <oldSpec>${oldSpec}</oldSpec>
</configuration>
[DEBUG] =======================================================================
[INFO] 
[INFO] --- openapi-diff-maven:2.0.1:diff (default-cli) @ dataops ---
[WARNING] The POM for org.apache.commons:commons-collections4:jar:4.4 is invalid, transitive dependencies (if any) will not be available: 3 problems were encountered while building the effective model for org.apache.commons:commons-collections4:4.4
[ERROR] Invalid packaging for parent POM org.apache.commons:commons-collections4:4.4, must be "pom" but is "jar" @ 
[ERROR] Invalid packaging for parent POM org.apache.commons:commons-collections4:4.4, must be "pom" but is "jar" @ 
[FATAL] The parents form a cycle: org.apache.commons:commons-collections4:4.4 -> org.apache.commons:commons-collections4:4.4 @ 

[DEBUG] Dependency collection stats {ConflictMarker.analyzeTime=325423, ConflictMarker.markTime=180191, ConflictMarker.nodeCount=127, ConflictIdSorter.graphTime=150658, ConflictIdSorter.topsortTime=40568, ConflictIdSorter.conflictIdCount=55, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=3914143, ConflictResolver.conflictItemCount=106, DefaultDependencyCollector.collectTime=339091618, DefaultDependencyCollector.transformTime=4722771}
[DEBUG] org.openapitools.openapidiff:openapi-diff-maven:jar:2.0.1
[DEBUG]    org.openapitools.openapidiff:openapi-diff-core:jar:2.0.1:compile
[DEBUG]       io.swagger.parser.v3:swagger-parser-v3:jar:2.0.28:compile (version managed from default)
[DEBUG]          io.swagger.core.v3:swagger-models:jar:2.1.11:compile
[DEBUG]          io.swagger.core.v3:swagger-core:jar:2.1.11:compile
[DEBUG]             jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile
[DEBUG]                jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
[DEBUG]             org.apache.commons:commons-lang3:jar:3.12.0:compile (version managed from default)
[DEBUG]             com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.12.1:compile
[DEBUG]             io.swagger.core.v3:swagger-annotations:jar:2.1.11:compile
[DEBUG]             jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[DEBUG]          io.swagger.parser.v3:swagger-parser-core:jar:2.0.28:compile
[DEBUG]          commons-io:commons-io:jar:2.11.0:compile
[DEBUG]          com.fasterxml.jackson.core:jackson-annotations:jar:2.12.1:compile
[DEBUG]          com.fasterxml.jackson.core:jackson-databind:jar:2.12.1:compile
[DEBUG]             com.fasterxml.jackson.core:jackson-core:jar:2.12.1:compile
[DEBUG]          com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.12.1:compile
[DEBUG]             org.yaml:snakeyaml:jar:1.27:compile
[DEBUG]       io.swagger.parser.v3:swagger-parser:jar:2.0.28:compile (version managed from default)
[DEBUG]       io.swagger.parser.v3:swagger-parser-v2-converter:jar:2.0.28:compile (version managed from default)
[DEBUG]          io.swagger:swagger-core:jar:1.6.3:compile
[DEBUG]             io.swagger:swagger-models:jar:1.6.3:compile
[DEBUG]                io.swagger:swagger-annotations:jar:1.6.3:compile
[DEBUG]             com.google.guava:guava:jar:27.0.1-android:compile
[DEBUG]                com.google.guava:failureaccess:jar:1.0.1:compile
[DEBUG]                com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[DEBUG]                com.google.code.findbugs:jsr305:jar:3.0.2:compile
[DEBUG]                org.checkerframework:checker-compat-qual:jar:2.5.2:compile
[DEBUG]                com.google.errorprone:error_prone_annotations:jar:2.2.0:compile
[DEBUG]                com.google.j2objc:j2objc-annotations:jar:1.1:compile
[DEBUG]                org.codehaus.mojo:animal-sniffer-annotations:jar:1.17:compile
[DEBUG]             javax.validation:validation-api:jar:1.1.0.Final:compile
[DEBUG]          io.swagger:swagger-parser:jar:1.0.56:compile
[DEBUG]          io.swagger:swagger-compat-spec-parser:jar:1.0.56:compile
[DEBUG]             com.github.java-json-tools:json-schema-validator:jar:2.2.14:compile
[DEBUG]                com.github.java-json-tools:jackson-coreutils-equivalence:jar:1.0:compile
[DEBUG]                com.github.java-json-tools:json-schema-core:jar:1.2.14:compile
[DEBUG]                   com.github.java-json-tools:uri-template:jar:0.10:compile
[DEBUG]                   org.mozilla:rhino:jar:1.7.7.2:compile
[DEBUG]                com.sun.mail:mailapi:jar:1.6.2:compile
[DEBUG]                joda-time:joda-time:jar:2.10.5:compile
[DEBUG]                com.googlecode.libphonenumber:libphonenumber:jar:8.11.1:compile
[DEBUG]                net.sf.jopt-simple:jopt-simple:jar:5.0.4:compile
[DEBUG]             com.github.java-json-tools:json-patch:jar:1.13:compile
[DEBUG]                com.github.java-json-tools:msg-simple:jar:1.2:compile
[DEBUG]                   com.github.java-json-tools:btf:jar:1.3:compile
[DEBUG]                com.github.java-json-tools:jackson-coreutils:jar:2.0:compile
[DEBUG]             org.apache.httpcomponents:httpclient:jar:4.5.13:compile
[DEBUG]                org.apache.httpcomponents:httpcore:jar:4.4.13:compile
[DEBUG]       com.j2html:j2html:jar:1.5.0:compile (version managed from default)
[DEBUG]       org.apache.commons:commons-collections4:jar:4.4:compile (version managed from default)
[DEBUG]       org.slf4j:slf4j-api:jar:1.7.32:compile (version managed from default)
[DEBUG]       commons-httpclient:commons-httpclient:jar:3.1:compile (version managed from default)
[DEBUG]          commons-logging:commons-logging:jar:1.0.4:compile
[DEBUG]          commons-codec:commons-codec:jar:1.2:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:1.1:runtime
[DEBUG] Created new class realm plugin>org.openapitools.openapidiff:openapi-diff-maven:2.0.1
[DEBUG] Importing foreign packages into class realm plugin>org.openapitools.openapidiff:openapi-diff-maven:2.0.1
[DEBUG]   Imported:  < project>messaging:dataops:1.0-SNAPSHOT
[DEBUG] Populating class realm plugin>org.openapitools.openapidiff:openapi-diff-maven:2.0.1
[DEBUG]   Included: org.openapitools.openapidiff:openapi-diff-maven:jar:2.0.1
[DEBUG]   Included: org.openapitools.openapidiff:openapi-diff-core:jar:2.0.1
[DEBUG]   Included: io.swagger.parser.v3:swagger-parser-v3:jar:2.0.28
[DEBUG]   Included: io.swagger.core.v3:swagger-models:jar:2.1.11
[DEBUG]   Included: io.swagger.core.v3:swagger-core:jar:2.1.11
[DEBUG]   Included: jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2
[DEBUG]   Included: jakarta.activation:jakarta.activation-api:jar:1.2.1
[DEBUG]   Included: org.apache.commons:commons-lang3:jar:3.12.0
[DEBUG]   Included: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.12.1
[DEBUG]   Included: io.swagger.core.v3:swagger-annotations:jar:2.1.11
[DEBUG]   Included: jakarta.validation:jakarta.validation-api:jar:2.0.2
[DEBUG]   Included: io.swagger.parser.v3:swagger-parser-core:jar:2.0.28
[DEBUG]   Included: commons-io:commons-io:jar:2.11.0
[DEBUG]   Included: com.fasterxml.jackson.core:jackson-annotations:jar:2.12.1
[DEBUG]   Included: com.fasterxml.jackson.core:jackson-databind:jar:2.12.1
[DEBUG]   Included: com.fasterxml.jackson.core:jackson-core:jar:2.12.1
[DEBUG]   Included: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.12.1
[DEBUG]   Included: org.yaml:snakeyaml:jar:1.27
[DEBUG]   Included: io.swagger.parser.v3:swagger-parser:jar:2.0.28
[DEBUG]   Included: io.swagger.parser.v3:swagger-parser-v2-converter:jar:2.0.28
[DEBUG]   Included: io.swagger:swagger-core:jar:1.6.3
[DEBUG]   Included: io.swagger:swagger-models:jar:1.6.3
[DEBUG]   Included: io.swagger:swagger-annotations:jar:1.6.3
[DEBUG]   Included: com.google.guava:guava:jar:27.0.1-android
[DEBUG]   Included: com.google.guava:failureaccess:jar:1.0.1
[DEBUG]   Included: com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava
[DEBUG]   Included: com.google.code.findbugs:jsr305:jar:3.0.2
[DEBUG]   Included: org.checkerframework:checker-compat-qual:jar:2.5.2
[DEBUG]   Included: com.google.errorprone:error_prone_annotations:jar:2.2.0
[DEBUG]   Included: com.google.j2objc:j2objc-annotations:jar:1.1
[DEBUG]   Included: org.codehaus.mojo:animal-sniffer-annotations:jar:1.17
[DEBUG]   Included: javax.validation:validation-api:jar:1.1.0.Final
[DEBUG]   Included: io.swagger:swagger-parser:jar:1.0.56
[DEBUG]   Included: io.swagger:swagger-compat-spec-parser:jar:1.0.56
[DEBUG]   Included: com.github.java-json-tools:json-schema-validator:jar:2.2.14
[DEBUG]   Included: com.github.java-json-tools:jackson-coreutils-equivalence:jar:1.0
[DEBUG]   Included: com.github.java-json-tools:json-schema-core:jar:1.2.14
[DEBUG]   Included: com.github.java-json-tools:uri-template:jar:0.10
[DEBUG]   Included: org.mozilla:rhino:jar:1.7.7.2
[DEBUG]   Included: com.sun.mail:mailapi:jar:1.6.2
[DEBUG]   Included: joda-time:joda-time:jar:2.10.5
[DEBUG]   Included: com.googlecode.libphonenumber:libphonenumber:jar:8.11.1
[DEBUG]   Included: net.sf.jopt-simple:jopt-simple:jar:5.0.4
[DEBUG]   Included: com.github.java-json-tools:json-patch:jar:1.13
[DEBUG]   Included: com.github.java-json-tools:msg-simple:jar:1.2
[DEBUG]   Included: com.github.java-json-tools:btf:jar:1.3
[DEBUG]   Included: com.github.java-json-tools:jackson-coreutils:jar:2.0
[DEBUG]   Included: org.apache.httpcomponents:httpclient:jar:4.5.13
[DEBUG]   Included: org.apache.httpcomponents:httpcore:jar:4.4.13
[DEBUG]   Included: com.j2html:j2html:jar:1.5.0
[DEBUG]   Included: org.apache.commons:commons-collections4:jar:4.4
[DEBUG]   Included: commons-httpclient:commons-httpclient:jar:3.1
[DEBUG]   Included: commons-logging:commons-logging:jar:1.0.4
[DEBUG]   Included: commons-codec:commons-codec:jar:1.2
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.1
[DEBUG] Configuring mojo org.openapitools.openapidiff:openapi-diff-maven:2.0.1:diff from plugin realm ClassRealm[plugin>org.openapitools.openapidiff:openapi-diff-maven:2.0.1, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@6a6824be]
[DEBUG] Configuring mojo 'org.openapitools.openapidiff:openapi-diff-maven:2.0.1:diff' with basic configurator -->
[DEBUG]   (f) failOnChanged = false
[DEBUG]   (f) failOnIncompatible = false
[DEBUG] -- end configuration --
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.024 s
[INFO] Finished at: 2022-09-13T16:21:29+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openapitools.openapidiff:openapi-diff-maven:2.0.1:diff (default-cli) on project dataops: Unexpected error: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.openapitools.openapidiff:openapi-diff-maven:2.0.1:diff (default-cli) on project dataops: Unexpected error
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:306)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unexpected error
    at org.openapitools.openapidiff.maven.OpenApiDiffMojo.execute (OpenApiDiffMojo.java:42)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: java.lang.NullPointerException
    at io.swagger.v3.parser.OpenAPIV3Parser.readContentFromLocation (OpenAPIV3Parser.java:218)
    at io.swagger.v3.parser.OpenAPIV3Parser.readLocation (OpenAPIV3Parser.java:87)
    at io.swagger.parser.OpenAPIParser.readLocation (OpenAPIParser.java:16)
    at org.openapitools.openapidiff.core.OpenApiCompare.readLocation (OpenApiCompare.java:117)
    at org.openapitools.openapidiff.core.OpenApiCompare.fromLocations (OpenApiCompare.java:91)
    at org.openapitools.openapidiff.core.OpenApiCompare.fromLocations (OpenApiCompare.java:78)
    at org.openapitools.openapidiff.maven.OpenApiDiffMojo.execute (OpenApiDiffMojo.java:31)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Process finished with exit code 1
joschi commented 2 years ago

@P-Shivkumar I'm unable to reproduce your issue with this minimal POM:

<?xml version="1.0"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>test</artifactId>
  <groupId>example</groupId>
  <version>0.0.0-SNAPSHOT</version>
  <build>
    <plugins>
      <plugin>
        <groupId>org.openapitools.openapidiff</groupId>
        <artifactId>openapi-diff-maven</artifactId>
        <version>2.0.1</version>
        <configuration>
          <!-- Reference specification (perhaps your prod schema) -->
          <oldSpec>${project.basedir}/petstore_v2_1.yaml</oldSpec>
          <!-- Specification generated by your project in the compile phase -->
          <newSpec>${project.basedir}/petstore_v2_2.yaml</newSpec>
          <!-- Fail only if API changes broke backward compatibility (default: false) -->
          <failOnIncompatible>true</failOnIncompatible>
          <!-- Fail if API changed (default: false) -->
          <failOnChanged>true</failOnChanged>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

I suspect that there's something in your project's POM file which breaks the plugin (or more specifically the Apache Commons Collections 4.x dependency).

See below for the output of mvn openapi-diff:diff:

Output of `mvn openapi-diff:diff` ```text [INFO] Scanning for projects... [INFO] [INFO] ----------------------------< example:test >---------------------------- [INFO] Building test 0.0.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- openapi-diff-maven:2.0.1:diff (default-cli) @ test --- [INFO] ========================================================================== == API CHANGE LOG == ========================================================================== Swagger Petstore -------------------------------------------------------------------------- -- What's New -- -------------------------------------------------------------------------- - GET /pet/{petId} -------------------------------------------------------------------------- -- What's Deleted -- -------------------------------------------------------------------------- - POST /pet/{petId} -------------------------------------------------------------------------- -- What's Deprecated -- -------------------------------------------------------------------------- - GET /user/logout -------------------------------------------------------------------------- -- What's Changed -- -------------------------------------------------------------------------- - DELETE /pet/{petId} Parameter: - Add newHeaderParam in header - GET /user/login Parameter: - Delete password in query Return Type: - Changed 200 OK Media types: - GET /user/logout - POST /pet/{petId}/uploadImage Parameter: - Changed petId in path - POST /user Request: - Changed application/json Schema: Backward compatible - POST /user/createWithArray Request: - Changed application/json Schema: Backward compatible - POST /user/createWithList Request: - Changed application/json Schema: Backward compatible - GET /user/{username} Return Type: - Changed 200 OK Media types: - Changed application/xml Schema: Broken compatibility Missing property: phone (string) - Changed application/json Schema: Broken compatibility Missing property: phone (string) - PUT /user/{username} Request: - Changed application/json Schema: Broken compatibility Missing property: phone (string) - PUT /pet Request: - Deleted application/xml - Changed application/json Schema: Broken compatibility Missing property: category.name (string) - POST /pet Parameter: - Add tags in query Request: - Changed application/json Schema: Backward compatible - Changed application/xml Schema: Backward compatible - GET /pet/findByStatus Parameter: - Deprecated status in query Return Type: - Changed 200 OK Media types: - Changed application/xml Schema: Broken compatibility Missing property: [n].category.name (string) - Changed application/json Schema: Broken compatibility Missing property: [n].category.name (string) - GET /pet/findByTags Return Type: - Changed 200 OK Media types: - Changed application/xml Schema: Broken compatibility Missing property: [n].category.name (string) - Changed application/json Schema: Broken compatibility Missing property: [n].category.name (string) -------------------------------------------------------------------------- -- Result -- -------------------------------------------------------------------------- API changes broke backward compatibility -------------------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.452 s [INFO] Finished at: 2022-09-16T14:45:36+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.openapitools.openapidiff:openapi-diff-maven:2.0.1:diff (default-cli) on project test: The API changes broke backward compatibility -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ```
anush0247 commented 1 year ago

I am also facing the same error any help on this is much appreciated @joschi

joschi commented 1 year ago

@anush0247 Again, I'm unable to reproduce the issue: https://github.com/OpenAPITools/openapi-diff/issues/408#issuecomment-1249320131

Could you post a minimal example project which reproduces the issue?

joschi commented 1 year ago

Closing due to inactivity of the reporter(s).