Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7498

Problem running cxf-java2swagger-plugin:3.2.0-SNAPSHOT:java2swagger

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.2.1
    • JAX-RS, Tooling
    • None
    • Unknown

    Description

      I'm running org.apache.cxf:cxf-java2swagger-plugin:3.2.0-SNAPSHOT:java2swagger and I'm getting this error:

      [ERROR] Failed to execute goal org.apache.cxf:cxf-java2swagger-plugin:3.2.0-SNAPSHOT:java2swagger (process-classes) on project cxf-rest: Execution process-classes of goal org.apache.cxf:cxf-java2swagger-plugin:3.2.0-SNAPSHOT:java2swagger failed: An API incompatibility was encountered while executing org.apache.cxf:cxf-java2swagger-plugin:3.2.0-SNAPSHOT:java2swagger: java.lang.NoSuchMethodError: com.google.common.collect.Sets$SetView.iterator()Lcom/google/common/collect/UnmodifiableIterator;
      [ERROR] -----------------------------------------------------
      [ERROR] realm =    plugin>org.apache.cxf:cxf-java2swagger-plugin:3.2.0-SNAPSHOT
      [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
      file:/data/java/javase/jdk1.8.0_144/jre/../lib/tools.jar
      file:/home/ggrzybek/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar
      file:/home/ggrzybek/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.8.10/jackson-annotations-2.8.10.jar
      file:/home/ggrzybek/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.8.10/jackson-core-2.8.10.jar
      file:/home/ggrzybek/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.8.10/jackson-databind-2.8.10.jar
      file:/home/ggrzybek/.m2/repository/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.8.10/jackson-dataformat-yaml-2.8.10.jar
      file:/home/ggrzybek/.m2/repository/com/fasterxml/woodstox/woodstox-core/5.0.3/woodstox-core-5.0.3.jar
      file:/home/ggrzybek/.m2/repository/com/google/guava/guava/20.0/guava-20.0.jar
      file:/home/ggrzybek/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar
      file:/home/ggrzybek/.m2/repository/commons-chain/commons-chain/1.1/commons-chain-1.1.jar
      file:/home/ggrzybek/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar
      file:/home/ggrzybek/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar
      file:/home/ggrzybek/.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar
      file:/home/ggrzybek/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.jar
      file:/home/ggrzybek/.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar
      file:/home/ggrzybek/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
      file:/home/ggrzybek/.m2/repository/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar
      file:/home/ggrzybek/.m2/repository/com/sun/xml/bind/jaxb-core/2.2.11/jaxb-core-2.2.11.jar
      file:/home/ggrzybek/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.11/jaxb-impl-2.2.11.jar
      file:/home/ggrzybek/.m2/repository/com/sun/xml/bind/jaxb-xjc/2.2.11/jaxb-xjc-2.2.11.jar
      file:/home/ggrzybek/.m2/repository/com/thoughtworks/qdox/qdox/1.12.1/qdox-1.12.1.jar
      file:/home/ggrzybek/.m2/repository/dom4j/dom4j/1.1/dom4j-1.1.jar
      file:/home/ggrzybek/.m2/repository/io/swagger/swagger-annotations/1.5.16/swagger-annotations-1.5.16.jar
      file:/home/ggrzybek/.m2/repository/io/swagger/swagger-core/1.5.16/swagger-core-1.5.16.jar
      file:/home/ggrzybek/.m2/repository/io/swagger/swagger-jaxrs/1.5.16/swagger-jaxrs-1.5.16.jar
      file:/home/ggrzybek/.m2/repository/io/swagger/swagger-models/1.5.16/swagger-models-1.5.16.jar
      file:/home/ggrzybek/.m2/repository/javax/annotation/javax.annotation-api/1.3/javax.annotation-api-1.3.jar
      file:/home/ggrzybek/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar
      file:/home/ggrzybek/.m2/repository/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.jar
      file:/home/ggrzybek/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar
      file:/home/ggrzybek/.m2/repository/org/apache/ant/ant/1.10.1/ant-1.10.1.jar
      file:/home/ggrzybek/.m2/repository/org/apache/ant/ant-launcher/1.10.1/ant-launcher-1.10.1.jar
      file:/home/ggrzybek/.m2/repository/org/apache/ant/ant-nodeps/1.8.1/ant-nodeps-1.8.1.jar
      file:/home/ggrzybek/.m2/repository/org/apache/commons/commons-lang3/3.6/commons-lang3-3.6.jar
      file:/home/ggrzybek/.m2/repository/org/apache/cxf/cxf-core/3.2.0-SNAPSHOT/cxf-core-3.2.0-SNAPSHOT.jar
      file:/home/ggrzybek/.m2/repository/org/apache/cxf/cxf-java2swagger-plugin/3.2.0-SNAPSHOT/cxf-java2swagger-plugin-3.2.0-SNAPSHOT.jar
      file:/home/ggrzybek/.m2/repository/org/apache/cxf/cxf-rt-frontend-jaxrs/3.2.0-SNAPSHOT/cxf-rt-frontend-jaxrs-3.2.0-SNAPSHOT.jar
      file:/home/ggrzybek/.m2/repository/org/apache/cxf/cxf-rt-rs-service-description/3.2.0-SNAPSHOT/cxf-rt-rs-service-description-3.2.0-SNAPSHOT.jar
      file:/home/ggrzybek/.m2/repository/org/apache/cxf/cxf-rt-rs-service-description-swagger/3.2.0-SNAPSHOT/cxf-rt-rs-service-description-swagger-3.2.0-SNAPSHOT.jar
      file:/home/ggrzybek/.m2/repository/org/apache/cxf/cxf-rt-transports-http/3.2.0-SNAPSHOT/cxf-rt-transports-http-3.2.0-SNAPSHOT.jar
      file:/home/ggrzybek/.m2/repository/org/apache/cxf/cxf-tools-common/3.2.0-SNAPSHOT/cxf-tools-common-3.2.0-SNAPSHOT.jar
      file:/home/ggrzybek/.m2/repository/org/apache/cxf/cxf-tools-wadlto-jaxrs/3.2.0-SNAPSHOT/cxf-tools-wadlto-jaxrs-3.2.0-SNAPSHOT.jar
      file:/home/ggrzybek/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar
      file:/home/ggrzybek/.m2/repository/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/doxia/doxia-core/1.4/doxia-core-1.4.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/doxia/doxia-decoration-model/1.4/doxia-decoration-model-1.4.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.4/doxia-logging-api-1.4.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/doxia/doxia-module-fml/1.4/doxia-module-fml-1.4.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/doxia/doxia-module-xhtml/1.4/doxia-module-xhtml-1.4.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.4/doxia-sink-api-1.4.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/doxia/doxia-site-renderer/1.4/doxia-site-renderer-1.4.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/plugins/maven-javadoc-plugin/2.10.3/maven-javadoc-plugin-2.10.3.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/shared/maven-artifact-resolver/1.0/maven-artifact-resolver-1.0.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.jar
      file:/home/ggrzybek/.m2/repository/org/apache/maven/shared/maven-invoker/2.0.9/maven-invoker-2.0.9.jar
      file:/home/ggrzybek/.m2/repository/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar
      file:/home/ggrzybek/.m2/repository/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar
      file:/home/ggrzybek/.m2/repository/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar
      file:/home/ggrzybek/.m2/repository/org/apache/velocity/velocity/1.5/velocity-1.5.jar
      file:/home/ggrzybek/.m2/repository/org/apache/velocity/velocity-engine-core/2.0/velocity-engine-core-2.0.jar
      file:/home/ggrzybek/.m2/repository/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar
      file:/home/ggrzybek/.m2/repository/org/apache/ws/xmlschema/xmlschema-core/2.2.2/xmlschema-core-2.2.2.jar
      file:/home/ggrzybek/.m2/repository/org/codehaus/plexus/plexus-archiver/1.2/plexus-archiver-1.2.jar
      file:/home/ggrzybek/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
      file:/home/ggrzybek/.m2/repository/org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
      file:/home/ggrzybek/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
      file:/home/ggrzybek/.m2/repository/org/codehaus/plexus/plexus-io/1.0.1/plexus-io-1.0.1.jar
      file:/home/ggrzybek/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
      file:/home/ggrzybek/.m2/repository/org/codehaus/plexus/plexus-velocity/1.1.7/plexus-velocity-1.1.7.jar
      file:/home/ggrzybek/.m2/repository/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar
      file:/home/ggrzybek/.m2/repository/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA.jar
      file:/home/ggrzybek/.m2/repository/org/reflections/reflections/0.9.11/reflections-0.9.11.jar
      file:/home/ggrzybek/.m2/repository/org/sonatype/sisu/sisu-guava/0.9.9/sisu-guava-0.9.9.jar
      file:/home/ggrzybek/.m2/repository/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-no_aop.jar
      file:/home/ggrzybek/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.3.0/sisu-inject-bean-2.3.0.jar
      file:/home/ggrzybek/.m2/repository/org/springframework/spring-aop/4.3.10.RELEASE/spring-aop-4.3.10.RELEASE.jar
      file:/home/ggrzybek/.m2/repository/org/springframework/spring-beans/4.3.10.RELEASE/spring-beans-4.3.10.RELEASE.jar
      file:/home/ggrzybek/.m2/repository/org/springframework/spring-context/4.3.10.RELEASE/spring-context-4.3.10.RELEASE.jar
      file:/home/ggrzybek/.m2/repository/org/springframework/spring-core/4.3.10.RELEASE/spring-core-4.3.10.RELEASE.jar
      file:/home/ggrzybek/.m2/repository/org/springframework/spring-expression/4.3.10.RELEASE/spring-expression-4.3.10.RELEASE.jar
      file:/home/ggrzybek/.m2/repository/org/yaml/snakeyaml/1.18/snakeyaml-1.18.jar
      file:/home/ggrzybek/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
      file:/home/ggrzybek/.m2/repository/sslext/sslext/1.2-0/sslext-1.2-0.jar
      file:/home/ggrzybek/.m2/repository/wsdl4j/wsdl4j/1.6.3/wsdl4j-1.6.3.jar
      file:/home/ggrzybek/.m2/repository/xerces/xercesImpl/2.11.0/xercesImpl-2.11.0.jar
      file:/home/ggrzybek/.m2/repository/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar
      file:/home/ggrzybek/.m2/repository/xml-resolver/xml-resolver/1.2/xml-resolver-1.2.jar
      [ERROR] Number of foreign imports: 1
      [ERROR] import: Entry[import  from realm ClassRealm[project>org.jboss.fuse.quickstarts:beginner-camel-cbr:7.0.0.redhat-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
      [ERROR] 
      [ERROR] -----------------------------------------------------
      

      using both Maven 3.5.0 and 3.3.9

      After checking dependency:tree, I see:

      [INFO] --- maven-dependency-plugin:3.0.1:tree (default-cli) @ cxf-java2swagger-plugin ---
      [INFO] org.apache.cxf:cxf-java2swagger-plugin:maven-plugin:3.2.1-SNAPSHOT
      [INFO] +- junit:junit:jar:4.12:test
      [INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
      [INFO] +- org.apache.maven.shared:maven-artifact-resolver:jar:1.0:compile
      [INFO] +- org.apache.maven:maven-core:jar:3.0.5:provided
      [INFO] |  +- org.apache.maven:maven-model:jar:3.0.5:compile
      [INFO] |  +- org.apache.maven:maven-settings:jar:3.0.5:compile
      [INFO] |  +- org.apache.maven:maven-settings-builder:jar:3.0.5:provided
      [INFO] |  +- org.apache.maven:maven-repository-metadata:jar:3.0.5:provided
      [INFO] |  +- org.apache.maven:maven-model-builder:jar:3.0.5:compile
      [INFO] |  +- org.apache.maven:maven-aether-provider:jar:3.0.5:provided
      [INFO] |  |  \- org.sonatype.aether:aether-spi:jar:1.13.1:provided
      [INFO] |  +- org.sonatype.aether:aether-impl:jar:1.13.1:provided
      [INFO] |  +- org.sonatype.aether:aether-api:jar:1.13.1:provided
      [INFO] |  +- org.sonatype.aether:aether-util:jar:1.13.1:provided
      [INFO] |  +- org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile
      [INFO] |  |  \- org.sonatype.sisu:sisu-inject-bean:jar:2.3.0:compile
      [INFO] |  |     \- org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile
      [INFO] |  |        \- org.sonatype.sisu:sisu-guava:jar:0.9.9:compile
      ...
      [INFO] +- com.sun:tools:jar:1.7.0:system
      [INFO] \- org.apache.cxf:cxf-rt-rs-service-description-swagger:jar:3.2.1-SNAPSHOT:compile
      [INFO]    +- org.apache.cxf:cxf-rt-frontend-jaxrs:jar:3.2.1-SNAPSHOT:compile
      [INFO]    |  +- javax.ws.rs:javax.ws.rs-api:jar:2.1:compile
      [INFO]    |  +- javax.annotation:javax.annotation-api:jar:1.3:compile
      [INFO]    |  \- org.apache.cxf:cxf-rt-transports-http:jar:3.2.1-SNAPSHOT:compile
      [INFO]    \- io.swagger:swagger-jaxrs:jar:1.5.16:compile
      [INFO]       +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.10:compile
      [INFO]       |  \- com.fasterxml.jackson.core:jackson-core:jar:2.8.10:compile
      [INFO]       +- io.swagger:swagger-core:jar:1.5.16:compile
      [INFO]       |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.10:compile
      [INFO]       |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.8.10:compile
      [INFO]       |  |  \- org.yaml:snakeyaml:jar:1.18:compile
      [INFO]       |  +- io.swagger:swagger-models:jar:1.5.16:compile
      [INFO]       |  |  \- io.swagger:swagger-annotations:jar:1.5.16:compile
      [INFO]       |  \- javax.validation:validation-api:jar:1.1.0.Final:compile (optional) 
      [INFO]       +- org.reflections:reflections:jar:0.9.11:compile
      [INFO]       |  \- org.javassist:javassist:jar:3.21.0-GA:compile
      [INFO]       \- com.google.guava:guava:jar:20.0:compile
      

      and I believe there's conflict between com.google.guava:guava:jar:20.0:compile and org.sonatype.sisu:sisu-guava:jar:0.9.9:compile.

      This workaround helped:

      <plugin>
          <groupId>org.apache.cxf</groupId>
          <artifactId>cxf-java2swagger-plugin</artifactId>
          <dependencies>
              <dependency>
                  <groupId>org.apache.maven</groupId>
                  <artifactId>maven-core</artifactId>
                  <version>3.5.0</version>
                  <exclusions>
                      <exclusion>
                          <groupId>org.sonatype.sisu</groupId>
                          <artifactId>sisu-guava</artifactId>
                      </exclusion>
                  </exclusions>
              </dependency>
          </dependencies>
      </plugin>
      

      Attachments

        Issue Links

          Activity

            People

              ffang Freeman Yue Fang
              ggrzybek Grzegorz Grzybek
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: