Swagger-codegen: swagger codegen maven plugin support for json file as dependency

Created on 21 Apr 2016  路  13Comments  路  Source: swagger-api/swagger-codegen

We are using swagger codegen maven plugin but we want to provide json file as maven dependency to the plugin instead of providing as inputSpec and location of it. Is it possible or planned for future to provide support of json as maven dependency inside maven swagger plugin?

Swagger Codegen Maven Plugin

Most helpful comment

I thought that I had read somewhere that classpath:... was an option. But maybe it was just other wishful thinkers like myself. It should be fairly easy to add that support - I'll look into it and maybe contribute a recommended enhancement.

All 13 comments

Do you receive an error when using a local file path? inputSpec supports URL and local files. I refactored the plugin to work almost identically to the CLI, and that is in the latest release (2.1.6).

Closing this as there's no update.

This issue is still topical. The plugin doesn't find the swagger.json if it's not on file system but on classpath in any dependency. The error is the following:

[INFO] reading from swagger.json
[INFO] reading from swagger.json
[ERROR] failed to read resource listing
java.io.FileNotFoundException: swagger.json (Das System kann die angegebene Datei nicht finden)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
...
at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:74)
at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:419)
...
[WARNING] Directory does not exist, or is inaccessible. No file will be evaluated.
[ERROR] java.lang.RuntimeException: missing swagger input or config!
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:651)

@PAX523 can you provide an example of how your config looks?

Hi @jimschubert! Thanks for your quick response!

My swagger.json is contained by a JAR dependency and not directly on file system but accessible via classpath on: /BOOT-INF/classes/swagger.json

Basically, my config looks like:

  <plugin>
    <groupId>io.swagger</groupId>
    <artifactId>swagger-codegen-maven-plugin</artifactId>
    <version>2.2.2</version>
    <executions>
      <execution>
        <goals>
          <goal>generate</goal>
        </goals>
        <configuration>
          <inputSpec>${project.build.outputDirectory}/BOOT-INF/classes/swagger.json</inputSpec>
          <language>java</language>
          <configOptions>
            <sourceFolder>src/gen/java/main</sourceFolder>
          </configOptions>
          <library>jersey2</library>
        </configuration>
      </execution>
    </executions>
  </plugin>

This works if I unpack this dependency to file system, first. But if I don't, it's not present there. Instead, I tried following variants for inputSpec:

  • <inputSpec>BOOT-INF/classes/swagger.json</inputSpec>
  • <inputSpec>/BOOT-INF/classes/swagger.json</inputSpec>
  • <inputSpec>swagger.json</inputSpec>
  • <inputSpec>/swagger.json</inputSpec>
  • <inputSpec>classpath:BOOT-INF/classes/swagger.json</inputSpec>
  • <inputSpec>classpath:/BOOT-INF/classes/swagger.json</inputSpec>
  • <inputSpec>classpath:swagger.json</inputSpec>
  • <inputSpec>classpath:/swagger.json</inputSpec>

But this doesn't work. I would be glad if you could provide a classpath option.

Did you find a resolution to this? I's struggling with the same problem.

Thanks for bumping this, I don't recall seeing the next to last response.

Only file configs are currently supported. Did you read somewhere that swagger definitions could be pulled from the classpath?

I thought that I had read somewhere that classpath:... was an option. But maybe it was just other wishful thinkers like myself. It should be fairly easy to add that support - I'll look into it and maybe contribute a recommended enhancement.

Since the cli and Maven plugin both use CodegenConfigurator, that may be the best place to start.

+1 for this issue.

I'm presently using Swagger Codegen 2.2.3 as a dependency in my pom.xml.

I actually converted the JSON to a YAML and still got the issue.
Below a dump of mvn -X package_:

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
Maven home: C:\Tools\apache\maven-3.3.9
Java version: 1.8.0_201, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_201\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: javax.enterprise.inject.* < plexus.core
[DEBUG]   Imported: javax.enterprise.util.* < plexus.core
[DEBUG]   Imported: javax.inject.* < plexus.core
[DEBUG]   Imported: org.apache.maven.* < plexus.core
[DEBUG]   Imported: org.apache.maven.artifact < plexus.core
[DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
[DEBUG]   Imported: org.apache.maven.cli < plexus.core
[DEBUG]   Imported: org.apache.maven.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.exception < plexus.core
[DEBUG]   Imported: org.apache.maven.execution < plexus.core
[DEBUG]   Imported: org.apache.maven.execution.scope < plexus.core
[DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG]   Imported: org.apache.maven.model < plexus.core
[DEBUG]   Imported: org.apache.maven.monitor < plexus.core
[DEBUG]   Imported: org.apache.maven.plugin < plexus.core
[DEBUG]   Imported: org.apache.maven.profiles < plexus.core
[DEBUG]   Imported: org.apache.maven.project < plexus.core
[DEBUG]   Imported: org.apache.maven.reporting < plexus.core
[DEBUG]   Imported: org.apache.maven.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.rtinfo < plexus.core
[DEBUG]   Imported: org.apache.maven.settings < plexus.core
[DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
[DEBUG]   Imported: org.apache.maven.usability < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG]   Imported: org.codehaus.classworlds < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
[DEBUG]   Imported: org.eclipse.aether.* < plexus.core
[DEBUG]   Imported: org.eclipse.aether.artifact < plexus.core
[DEBUG]   Imported: org.eclipse.aether.collection < plexus.core
[DEBUG]   Imported: org.eclipse.aether.deployment < plexus.core
[DEBUG]   Imported: org.eclipse.aether.graph < plexus.core
[DEBUG]   Imported: org.eclipse.aether.impl < plexus.core
[DEBUG]   Imported: org.eclipse.aether.installation < plexus.core
[DEBUG]   Imported: org.eclipse.aether.internal.impl < plexus.core
[DEBUG]   Imported: org.eclipse.aether.metadata < plexus.core
[DEBUG]   Imported: org.eclipse.aether.repository < plexus.core
[DEBUG]   Imported: org.eclipse.aether.resolution < plexus.core
[DEBUG]   Imported: org.eclipse.aether.spi < plexus.core
[DEBUG]   Imported: org.eclipse.aether.transfer < plexus.core
[DEBUG]   Imported: org.eclipse.aether.version < plexus.core
[DEBUG]   Imported: org.slf4j.* < plexus.core
[DEBUG]   Imported: org.slf4j.helpers.* < plexus.core
[DEBUG]   Imported: org.slf4j.spi.* < plexus.core
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from C:\Tools\apache\maven-3.3.9\conf\settings.xml
[DEBUG] Reading user settings from C:\Users\my.user\.m2\settings.xml
[DEBUG] Reading global toolchains from C:\Tools\apache\maven-3.3.9\conf\toolchains.xml
[DEBUG] Reading user toolchains from C:\Users\my.user\.m2\toolchains.xml
[DEBUG] Using local repository at C:\Users\my.user\.m2\repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:\Users\my.user\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project com.mycompany.proj.brokers:rest-polling:war:1.0.0: (none)
[DEBUG] Looking up lifecyle mappings for packaging war from ClassRealm[plexus.core, parent: null]
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: com.mycompany.proj.brokers:rest-polling:war:1.0.0
[DEBUG] Tasks:   [package]
[DEBUG] Style:   Regular
[DEBUG] =======================================================================
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building rest-polling 1.0.0
[INFO] ------------------------------------------------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-so
urces, 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] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-so
urces, 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] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-so
urces, 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] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-so
urces, 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] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-so
urces, 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] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-so
urces, 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] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-so
urces, 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] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-so
urces, 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] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-so
urces, 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:       com.mycompany.proj.brokers:rest-polling:1.0.0
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): [compile, runtime, test]
[DEBUG] Repositories (dependencies): [central (https://artifactory.mycompany.com/libs-releases, default, releases), snapshots (https://artifactory.mycompany.com/libs-sn
apshots, default, releases+snapshots)]
[DEBUG] Repositories (plugins)     : [central (https://artifactory.mycompany.com/plugins-releases, default, releases), snapshots (https://artifactory.mycompany.com/plug
ins-snapshots, default, releases+snapshots)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-antrun-plugin:1.3:run (prepareSwaggerGeneration)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <pluginArtifacts>${plugin.artifacts}</pluginArtifacts>
  <project>${project}</project>
  <sourceRoot>${sourceRoot}</sourceRoot>
  <tasks>
    <echo>C:\Repo\mycompany\projPoc\JavaClients\restpolling\target\swagger</echo>
    <delete dir="C:\Repo\mycompany\projPoc\JavaClients\restpolling\target/swagger"/>
    <mkdir dir="C:\Repo\mycompany\projPoc\JavaClients\restpolling\target/swagger"/>${tasks}</tasks>
  <testSourceRoot>${testSourceRoot}</testSourceRoot>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          io.swagger:swagger-codegen-maven-plugin:2.2.3:generate (default)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <addCompileSourceRoot default-value="true"/>
  <apiPackage>com.mycompany.proj.brokers.provider.apis</apiPackage>
  <configOptions>
    <targetFramework>v4.5</targetFramework>
    <packageVersion>0.0.1</packageVersion>
  </configOptions>
  <generateApiDocumentation>false</generateApiDocumentation>
  <generateApiTests>false</generateApiTests>
  <generateModelDocumentation>false</generateModelDocumentation>
  <inputSpec>C:\Repo\mycompany\projPoc\JavaClients\restpolling\swagger.yaml</inputSpec>
  <language>java</language>
  <modelPackage>com.mycompany.proj.brokers.provider.models</modelPackage>
  <output default-value="${project.build.directory}/generated-sources/swagger">C:\Repo\mycompany\projPoc\JavaClients\restpolling\target\swagger</output>
  <project default-value="${project}"/>
  <skip default-value="false">${codegen.skip}</skip>
  <verbose default-value="false"/>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <buildFilters default-value="${project.build.filters}"/>
  <encoding default-value="${project.build.sourceEncoding}">${encoding}</encoding>
  <escapeString>${maven.resources.escapeString}</escapeString>
  <escapeWindowsPaths default-value="true">${maven.resources.escapeWindowsPaths}</escapeWindowsPaths>
  <includeEmptyDirs default-value="false">${maven.resources.includeEmptyDirs}</includeEmptyDirs>
  <outputDirectory default-value="${project.build.outputDirectory}"/>
  <overwrite default-value="false">${maven.resources.overwrite}</overwrite>
  <project default-value="${project}"/>
  <resources default-value="${project.resources}"/>
  <session default-value="${session}"/>
  <supportMultiLineFiltering default-value="false">${maven.resources.supportMultiLineFiltering}</supportMultiLineFiltering>
  <useBuildFilters default-value="true"/>
  <useDefaultDelimiters default-value="true"/>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <basedir default-value="${basedir}"/>
  <buildDirectory default-value="${project.build.directory}"/>
  <classpathElements default-value="${project.compileClasspathElements}"/>
  <compileSourceRoots default-value="${project.compileSourceRoots}"/>
  <compilerId default-value="javac">${maven.compiler.compilerId}</compilerId>
  <compilerReuseStrategy default-value="${reuseCreated}">${maven.compiler.compilerReuseStrategy}</compilerReuseStrategy>
  <compilerVersion>${maven.compiler.compilerVersion}</compilerVersion>
  <debug default-value="true">${maven.compiler.debug}</debug>
  <debuglevel>${maven.compiler.debuglevel}</debuglevel>
  <encoding default-value="${project.build.sourceEncoding}">${encoding}</encoding>
  <executable>${maven.compiler.executable}</executable>
  <failOnError default-value="true">${maven.compiler.failOnError}</failOnError>
  <forceJavacCompilerUse default-value="false">${maven.compiler.forceJavacCompilerUse}</forceJavacCompilerUse>
  <fork default-value="false">${maven.compiler.fork}</fork>
  <generatedSourcesDirectory default-value="${project.build.directory}/generated-sources/annotations"/>
  <maxmem>${maven.compiler.maxmem}</maxmem>
  <meminitial>${maven.compiler.meminitial}</meminitial>
  <mojoExecution>${mojoExecution}</mojoExecution>
  <optimize default-value="false">${maven.compiler.optimize}</optimize>
  <outputDirectory default-value="${project.build.outputDirectory}"/>
  <projectArtifact default-value="${project.artifact}"/>
  <showDeprecation default-value="false">${maven.compiler.showDeprecation}</showDeprecation>
  <showWarnings default-value="false">${maven.compiler.showWarnings}</showWarnings>
  <skipMain>${maven.main.skip}</skipMain>
  <skipMultiThreadWarning default-value="false">${maven.compiler.skipMultiThreadWarning}</skipMultiThreadWarning>
  <source default-value="1.5">${maven.compiler.source}</source>
  <staleMillis default-value="0">${lastModGranularityMs}</staleMillis>
  <target default-value="1.5">${maven.compiler.target}</target>
  <useIncrementalCompilation default-value="true">${maven.compiler.useIncrementalCompilation}</useIncrementalCompilation>
  <verbose default-value="false">${maven.compiler.verbose}</verbose>
  <mavenSession default-value="${session}"/>
  <session default-value="${session}"/>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-resources-plugin:2.6:testResources (default-testResources)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <buildFilters default-value="${project.build.filters}"/>
  <encoding default-value="${project.build.sourceEncoding}">${encoding}</encoding>
  <escapeString>${maven.resources.escapeString}</escapeString>
  <escapeWindowsPaths default-value="true">${maven.resources.escapeWindowsPaths}</escapeWindowsPaths>
  <includeEmptyDirs default-value="false">${maven.resources.includeEmptyDirs}</includeEmptyDirs>
  <outputDirectory default-value="${project.build.testOutputDirectory}"/>
  <overwrite default-value="false">${maven.resources.overwrite}</overwrite>
  <project default-value="${project}"/>
  <resources default-value="${project.testResources}"/>
  <session default-value="${session}"/>
  <skip>${maven.test.skip}</skip>
  <supportMultiLineFiltering default-value="false">${maven.resources.supportMultiLineFiltering}</supportMultiLineFiltering>
  <useBuildFilters default-value="true"/>
  <useDefaultDelimiters default-value="true"/>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <basedir default-value="${basedir}"/>
  <buildDirectory default-value="${project.build.directory}"/>
  <classpathElements default-value="${project.testClasspathElements}"/>
  <compileSourceRoots default-value="${project.testCompileSourceRoots}"/>
  <compilerId default-value="javac">${maven.compiler.compilerId}</compilerId>
  <compilerReuseStrategy default-value="${reuseCreated}">${maven.compiler.compilerReuseStrategy}</compilerReuseStrategy>
  <compilerVersion>${maven.compiler.compilerVersion}</compilerVersion>
  <debug default-value="true">${maven.compiler.debug}</debug>
  <debuglevel>${maven.compiler.debuglevel}</debuglevel>
  <encoding default-value="${project.build.sourceEncoding}">${encoding}</encoding>
  <executable>${maven.compiler.executable}</executable>
  <failOnError default-value="true">${maven.compiler.failOnError}</failOnError>
  <forceJavacCompilerUse default-value="false">${maven.compiler.forceJavacCompilerUse}</forceJavacCompilerUse>
  <fork default-value="false">${maven.compiler.fork}</fork>
  <generatedTestSourcesDirectory default-value="${project.build.directory}/generated-test-sources/test-annotations"/>
  <maxmem>${maven.compiler.maxmem}</maxmem>
  <meminitial>${maven.compiler.meminitial}</meminitial>
  <mojoExecution>${mojoExecution}</mojoExecution>
  <optimize default-value="false">${maven.compiler.optimize}</optimize>
  <outputDirectory default-value="${project.build.testOutputDirectory}"/>
  <showDeprecation default-value="false">${maven.compiler.showDeprecation}</showDeprecation>
  <showWarnings default-value="false">${maven.compiler.showWarnings}</showWarnings>
  <skip>${maven.test.skip}</skip>
  <skipMultiThreadWarning default-value="false">${maven.compiler.skipMultiThreadWarning}</skipMultiThreadWarning>
  <source default-value="1.5">${maven.compiler.source}</source>
  <staleMillis default-value="0">${lastModGranularityMs}</staleMillis>
  <target default-value="1.5">${maven.compiler.target}</target>
  <testSource>${maven.compiler.testSource}</testSource>
  <testTarget>${maven.compiler.testTarget}</testTarget>
  <useIncrementalCompilation default-value="true">${maven.compiler.useIncrementalCompilation}</useIncrementalCompilation>
  <verbose default-value="false">${maven.compiler.verbose}</verbose>
  <mavenSession default-value="${session}"/>
  <session default-value="${session}"/>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <argLine>${argLine}</argLine>
  <basedir default-value="${basedir}"/>
  <childDelegation default-value="false">${childDelegation}</childDelegation>
  <classesDirectory default-value="${project.build.outputDirectory}"/>
  <debugForkedProcess>${maven.surefire.debug}</debugForkedProcess>
  <disableXmlReport default-value="false">${disableXmlReport}</disableXmlReport>
  <enableAssertions default-value="true">${enableAssertions}</enableAssertions>
  <excludedGroups>${excludedGroups}</excludedGroups>
  <failIfNoSpecifiedTests>${surefire.failIfNoSpecifiedTests}</failIfNoSpecifiedTests>
  <failIfNoTests>${failIfNoTests}</failIfNoTests>
  <forkMode default-value="once">${forkMode}</forkMode>
  <forkedProcessTimeoutInSeconds>${surefire.timeout}</forkedProcessTimeoutInSeconds>
  <groups>${groups}</groups>
  <junitArtifactName default-value="junit:junit">${junitArtifactName}</junitArtifactName>
  <jvm>${jvm}</jvm>
  <localRepository default-value="${localRepository}"/>
  <objectFactory>${objectFactory}</objectFactory>
  <parallel>${parallel}</parallel>
  <parallelMavenExecution default-value="${session.parallel}"/>
  <perCoreThreadCount default-value="true">${perCoreThreadCount}</perCoreThreadCount>
  <pluginArtifactMap>${plugin.artifactMap}</pluginArtifactMap>
  <pluginDescriptor default-value="${plugin}"/>
  <printSummary default-value="true">${surefire.printSummary}</printSummary>
  <projectArtifactMap>${project.artifactMap}</projectArtifactMap>
  <redirectTestOutputToFile default-value="false">${maven.test.redirectTestOutputToFile}</redirectTestOutputToFile>
  <remoteRepositories default-value="${project.pluginArtifactRepositories}"/>
  <reportFormat default-value="brief">${surefire.reportFormat}</reportFormat>
  <reportNameSuffix default-value="">${surefire.reportNameSuffix}</reportNameSuffix>
  <reportsDirectory default-value="${project.build.directory}/surefire-reports"/>
  <runOrder default-value="filesystem"/>
  <skip default-value="false">${maven.test.skip}</skip>
  <skipExec>${maven.test.skip.exec}</skipExec>
  <skipTests default-value="false">${skipTests}</skipTests>
  <test>${test}</test>
  <testClassesDirectory default-value="${project.build.testOutputDirectory}"/>
  <testFailureIgnore default-value="false">${maven.test.failure.ignore}</testFailureIgnore>
  <testNGArtifactName default-value="org.testng:testng">${testNGArtifactName}</testNGArtifactName>
  <testSourceDirectory default-value="${project.build.testSourceDirectory}"/>
  <threadCount>${threadCount}</threadCount>
  <trimStackTrace default-value="true">${trimStackTrace}</trimStackTrace>
  <useFile default-value="true">${surefire.useFile}</useFile>
  <useManifestOnlyJar default-value="true">${surefire.useManifestOnlyJar}</useManifestOnlyJar>
  <useSystemClassLoader default-value="true">${surefire.useSystemClassLoader}</useSystemClassLoader>
  <useUnlimitedThreads default-value="false">${useUnlimitedThreads}</useUnlimitedThreads>
  <workingDirectory>${basedir}</workingDirectory>
  <project default-value="${project}"/>
  <session default-value="${session}"/>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <archiveClasses default-value="false">${archiveClasses}</archiveClasses>
  <attachClasses default-value="false"/>
  <cacheFile default-value="${project.build.directory}/war/work/webapp-cache.xml"/>
  <classesClassifier default-value="classes"/>
  <classesDirectory default-value="${project.build.outputDirectory}"/>
  <containerConfigXML>${maven.war.containerConfigXML}</containerConfigXML>
  <escapeString>${maven.war.escapeString}</escapeString>
  <escapedBackslashesInFilePath default-value="false">${maven.war.escapedBackslashesInFilePath}</escapedBackslashesInFilePath>
  <failOnMissingWebXml default-value="true">${failOnMissingWebXml}</failOnMissingWebXml>
  <filteringDeploymentDescriptors default-value="false">${maven.war.filteringDeploymentDescriptors}</filteringDeploymentDescriptors>
  <outputDirectory default-value="${project.build.directory}"/>
  <primaryArtifact default-value="true">${primaryArtifact}</primaryArtifact>
  <project default-value="${project}"/>
  <session default-value="${session}"/>
  <useCache default-value="false">${useCache}</useCache>
  <warName default-value="${project.build.finalName}"/>
  <warSourceDirectory default-value="${basedir}/src/main/webapp"/>
  <warSourceIncludes default-value="**"/>
  <webXml>${maven.war.webxml}</webXml>
  <webappDirectory default-value="${project.build.directory}/${project.build.finalName}"/>
  <workDirectory default-value="${project.build.directory}/war/work"/>
</configuration>
[DEBUG] =======================================================================
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=1, ConflictMarker.markTime=2, ConflictMarker.nodeCount=37, ConflictIdSorter.graphTime=1, ConflictIdSort
er.topsortTime=1, ConflictIdSorter.conflictIdCount=20, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=11, ConflictResolver.conflictItemCount=34, De
faultDependencyCollector.collectTime=379, DefaultDependencyCollector.transformTime=19}
[DEBUG] com.mycompany.proj.brokers:rest-polling:war:1.0.0
[DEBUG]    io.swagger.core.v3:swagger-jaxrs2:jar:2.0.0:compile
[DEBUG]       com.fasterxml.jackson.core:jackson-databind:jar:2.9.4:compile
[DEBUG]          com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[DEBUG]          com.fasterxml.jackson.core:jackson-core:jar:2.9.4:compile
[DEBUG]       org.reflections:reflections:jar:0.9.11:compile
[DEBUG]          com.google.guava:guava:jar:20.0:compile
[DEBUG]       org.javassist:javassist:jar:3.21.0-GA:compile
[DEBUG]       io.swagger.core.v3:swagger-models:jar:2.0.0:compile
[DEBUG]       io.swagger.core.v3:swagger-annotations:jar:2.0.0:compile
[DEBUG]       io.swagger.core.v3:swagger-integration:jar:2.0.0:compile
[DEBUG]          io.swagger.core.v3:swagger-core:jar:2.0.0:compile
[DEBUG]             org.apache.commons:commons-lang3:jar:3.7:compile
[DEBUG]             org.slf4j:slf4j-api:jar:1.7.25:compile
[DEBUG]             com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.9.4:compile
[DEBUG]                org.yaml:snakeyaml:jar:1.18:compile
[DEBUG]             javax.validation:validation-api:jar:1.1.0.Final:compile
[DEBUG]       com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.9.1:compile
[DEBUG]          com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.9.1:compile
[DEBUG]          com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.9.1:compile
[DEBUG]    io.swagger.core.v3:swagger-jaxrs2-servlet-initializer:jar:2.0.0:compile
[INFO]
[INFO] --- maven-antrun-plugin:1.3:run (prepareSwaggerGeneration) @ rest-polling ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=1, ConflictMarker.nodeCount=31, ConflictIdSorter.graphTime=0, ConflictIdSort
er.topsortTime=0, ConflictIdSorter.conflictIdCount=15, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=7, ConflictResolver.conflictItemCount=31, Def
aultDependencyCollector.collectTime=112, DefaultDependencyCollector.transformTime=8}
[DEBUG] org.apache.maven.plugins:maven-antrun-plugin:jar:1.3:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.4:compile
[DEBUG]    org.apache.maven:maven-project:jar:2.0.4:compile
[DEBUG]       org.apache.maven:maven-settings:jar:2.0.4:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.0.4:compile
[DEBUG]       org.apache.maven:maven-model:jar:2.0.4:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.0.4:compile
[DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.0.4:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9:compile
[DEBUG]          junit:junit:jar:3.8.1:compile
[DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG]    org.apache.maven:maven-artifact:jar:2.0.4:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:1.5.6:compile
[DEBUG]    org.apache.ant:ant-launcher:jar:1.7.1:runtime
[DEBUG]    org.apache.ant:ant:jar:1.7.1:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-antrun-plugin:1.3
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-antrun-plugin:1.3
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-antrun-plugin:1.3
[DEBUG]   Included: org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
[DEBUG]   Included: junit:junit:jar:3.8.1
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.5.6
[DEBUG]   Included: org.apache.ant:ant-launcher:jar:1.7.1
[DEBUG]   Included: org.apache.ant:ant:jar:1.7.1
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-antrun-plugin:1.3:run from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-antrun-plugin:1.3, pare
nt: sun.misc.Launcher$AppClassLoader@4e25154f]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-antrun-plugin:1.3:run' with override configurator -->
[DEBUG]   (f) pluginArtifacts = [org.apache.maven.plugins:maven-antrun-plugin:maven-plugin:1.3:, org.apache.maven:maven-plugin-api:jar:2.0.4:compile, org.apache.maven:m
aven-project:jar:2.0.4:compile, org.apache.maven:maven-settings:jar:2.0.4:compile, org.apache.maven:maven-profile:jar:2.0.4:compile, org.apache.maven:maven-model:jar:2.
0.4:compile, org.apache.maven:maven-artifact-manager:jar:2.0.4:compile, org.apache.maven:maven-repository-metadata:jar:2.0.4:compile, org.codehaus.plexus:plexus-contain
er-default:jar:1.0-alpha-9:compile, junit:junit:jar:3.8.1:compile, classworlds:classworlds:jar:1.1-alpha-2:compile, org.apache.maven:maven-artifact:jar:2.0.4:compile, o
rg.codehaus.plexus:plexus-utils:jar:1.5.6:compile, org.apache.ant:ant-launcher:jar:1.7.1:runtime, org.apache.ant:ant:jar:1.7.1:compile]
[DEBUG]   (f) project = MavenProject: com.mycompany.proj.brokers:rest-polling:1.0.0 @ C:\Repo\mycompany\projPoc\JavaClients\restpolling\pom.xml
[DEBUG]   (f) tasks =
[DEBUG] -- end configuration --
[DEBUG] Storing: maven.dependency.io.swagger.core.v3.swagger-jaxrs2.jar.path=C:\Users\my.user\.m2\repository\io\swagger\core\v3\swagger-jaxrs2\2.0.0\swagger-jaxrs2
-2.0.0.jar
[DEBUG] Storing: maven.dependency.com.fasterxml.jackson.core.jackson-databind.jar.path=C:\Users\my.user\.m2\repository\com\fasterxml\jackson\core\jackson-databind\
2.9.4\jackson-databind-2.9.4.jar
[DEBUG] Storing: maven.dependency.com.fasterxml.jackson.core.jackson-annotations.jar.path=C:\Users\my.user\.m2\repository\com\fasterxml\jackson\core\jackson-annota
tions\2.9.0\jackson-annotations-2.9.0.jar
[DEBUG] Storing: maven.dependency.com.fasterxml.jackson.core.jackson-core.jar.path=C:\Users\my.user\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.4\ja
ckson-core-2.9.4.jar
[DEBUG] Storing: maven.dependency.org.reflections.reflections.jar.path=C:\Users\my.user\.m2\repository\org\reflections\reflections\0.9.11\reflections-0.9.11.jar
[DEBUG] Storing: maven.dependency.com.google.guava.guava.jar.path=C:\Users\my.user\.m2\repository\com\google\guava\guava\20.0\guava-20.0.jar
[DEBUG] Storing: maven.dependency.org.javassist.javassist.jar.path=C:\Users\my.user\.m2\repository\org\javassist\javassist\3.21.0-GA\javassist-3.21.0-GA.jar
[DEBUG] Storing: maven.dependency.io.swagger.core.v3.swagger-models.jar.path=C:\Users\my.user\.m2\repository\io\swagger\core\v3\swagger-models\2.0.0\swagger-models
-2.0.0.jar
[DEBUG] Storing: maven.dependency.io.swagger.core.v3.swagger-annotations.jar.path=C:\Users\my.user\.m2\repository\io\swagger\core\v3\swagger-annotations\2.0.0\swag
ger-annotations-2.0.0.jar
[DEBUG] Storing: maven.dependency.io.swagger.core.v3.swagger-integration.jar.path=C:\Users\my.user\.m2\repository\io\swagger\core\v3\swagger-integration\2.0.0\swag
ger-integration-2.0.0.jar
[DEBUG] Storing: maven.dependency.io.swagger.core.v3.swagger-core.jar.path=C:\Users\my.user\.m2\repository\io\swagger\core\v3\swagger-core\2.0.0\swagger-core-2.0.0
.jar
[DEBUG] Storing: maven.dependency.org.apache.commons.commons-lang3.jar.path=C:\Users\my.user\.m2\repository\org\apache\commons\commons-lang3\3.7\commons-lang3-3.7.
jar
[DEBUG] Storing: maven.dependency.org.slf4j.slf4j-api.jar.path=C:\Users\my.user\.m2\repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar
[DEBUG] Storing: maven.dependency.com.fasterxml.jackson.dataformat.jackson-dataformat-yaml.jar.path=C:\Users\my.user\.m2\repository\com\fasterxml\jackson\dataforma
t\jackson-dataformat-yaml\2.9.4\jackson-dataformat-yaml-2.9.4.jar
[DEBUG] Storing: maven.dependency.org.yaml.snakeyaml.jar.path=C:\Users\my.user\.m2\repository\org\yaml\snakeyaml\1.18\snakeyaml-1.18.jar
[DEBUG] Storing: maven.dependency.javax.validation.validation-api.jar.path=C:\Users\my.user\.m2\repository\javax\validation\validation-api\1.1.0.Final\validation-a
pi-1.1.0.Final.jar
[DEBUG] Storing: maven.dependency.com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider.jar.path=C:\Users\my.user\.m2\repository\com\fasterxml\jackson\jaxrs\jack
son-jaxrs-json-provider\2.9.1\jackson-jaxrs-json-provider-2.9.1.jar
[DEBUG] Storing: maven.dependency.com.fasterxml.jackson.jaxrs.jackson-jaxrs-base.jar.path=C:\Users\my.user\.m2\repository\com\fasterxml\jackson\jaxrs\jackson-jaxrs
-base\2.9.1\jackson-jaxrs-base-2.9.1.jar
[DEBUG] Storing: maven.dependency.com.fasterxml.jackson.module.jackson-module-jaxb-annotations.jar.path=C:\Users\my.user\.m2\repository\com\fasterxml\jackson\modul
e\jackson-module-jaxb-annotations\2.9.1\jackson-module-jaxb-annotations-2.9.1.jar
[DEBUG] Storing: maven.dependency.io.swagger.core.v3.swagger-jaxrs2-servlet-initializer.jar.path=C:\Users\my.user\.m2\repository\io\swagger\core\v3\swagger-jaxrs2-
servlet-initializer\2.0.0\swagger-jaxrs2-servlet-initializer-2.0.0.jar
Project base dir set to: C:\Repo\mycompany\projPoc\JavaClients\restpolling
Adding reference: maven.dependency.classpath
Adding reference: maven.compile.classpath
Adding reference: maven.runtime.classpath
Adding reference: maven.test.classpath
Adding reference: maven.plugin.classpath
[INFO] Executing tasks
[DEBUG] getProperty(ns=null, name=ant.reuse.loader, user=false)
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
     [echo] C:\Repo\mycompany\projPoc\JavaClients\restpolling\target\swagger
   [delete] Deleting directory C:\Repo\mycompany\projPoc\JavaClients\restpolling\target\swagger
   [delete] Deleting directory C:\Repo\mycompany\projPoc\JavaClients\restpolling\target\swagger
    [mkdir] Created dir: C:\Repo\mycompany\projPoc\JavaClients\restpolling\target\swagger
[INFO] Executed tasks
[INFO]
[INFO] --- swagger-codegen-maven-plugin:2.2.3:generate (default) @ rest-polling ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=1, ConflictMarker.nodeCount=151, ConflictIdSorter.graphTime=0, ConflictIdSor
ter.topsortTime=0, ConflictIdSorter.conflictIdCount=70, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=12, ConflictResolver.conflictItemCount=141,
DefaultDependencyCollector.collectTime=957, DefaultDependencyCollector.transformTime=14}
[DEBUG] io.swagger:swagger-codegen-maven-plugin:jar:2.2.3:
[DEBUG]    org.apache.maven:maven-core:jar:3.2.5:compile
[DEBUG]       org.apache.maven:maven-model:jar:3.2.5:compile
[DEBUG]       org.apache.maven:maven-settings:jar:3.2.5:compile
[DEBUG]       org.apache.maven:maven-settings-builder:jar:3.2.5:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:3.2.5:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:3.2.5:compile
[DEBUG]       org.apache.maven:maven-model-builder:jar:3.2.5:compile
[DEBUG]       org.apache.maven:maven-aether-provider:jar:3.2.5:compile
[DEBUG]          org.eclipse.aether:aether-spi:jar:1.0.0.v20140518:compile
[DEBUG]       org.eclipse.aether:aether-impl:jar:1.0.0.v20140518:compile
[DEBUG]       org.eclipse.aether:aether-api:jar:1.0.0.v20140518:compile
[DEBUG]       org.eclipse.aether:aether-util:jar:1.0.0.v20140518:compile
[DEBUG]       org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.0.M1:compile
[DEBUG]          javax.enterprise:cdi-api:jar:1.0:compile
[DEBUG]             javax.annotation:jsr250-api:jar:1.0:compile
[DEBUG]          org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.0.M1:compile
[DEBUG]       org.sonatype.sisu:sisu-guice:jar:no_aop:3.2.3:compile
[DEBUG]          javax.inject:javax.inject:jar:1:compile
[DEBUG]          aopalliance:aopalliance:jar:1.0:compile
[DEBUG]          com.google.guava:guava:jar:16.0.1:compile
[DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.21:compile
[DEBUG]       org.codehaus.plexus:plexus-utils:jar:3.0.20:compile
[DEBUG]       org.codehaus.plexus:plexus-classworlds:jar:2.5.2:compile
[DEBUG]       org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG]       org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
[DEBUG]          org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[DEBUG]    org.apache.maven:maven-compat:jar:3.2.5:compile
[DEBUG]       org.apache.maven.wagon:wagon-provider-api:jar:2.8:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.2.5:compile
[DEBUG]    org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.4:compile
[DEBUG]    io.swagger:swagger-codegen:jar:2.2.3:compile
[DEBUG]       io.swagger:swagger-parser:jar:1.0.32:compile
[DEBUG]       io.swagger:swagger-compat-spec-parser:jar:1.0.32:compile
[DEBUG]          com.github.java-json-tools:json-schema-validator:jar:2.2.8:compile
[DEBUG]             com.github.java-json-tools:json-schema-core:jar:1.2.8:compile
[DEBUG]                org.mozilla:rhino:jar:1.7R4:compile
[DEBUG]                com.github.fge:uri-template:jar:0.9:compile
[DEBUG]             javax.mail:mailapi:jar:1.4.3:compile
[DEBUG]                javax.activation:activation:jar:1.1:compile
[DEBUG]             joda-time:joda-time:jar:2.9.7:compile
[DEBUG]             com.googlecode.libphonenumber:libphonenumber:jar:8.0.0:compile
[DEBUG]             com.google.code.findbugs:jsr305:jar:3.0.1:compile
[DEBUG]             net.sf.jopt-simple:jopt-simple:jar:5.0.3:compile
[DEBUG]          com.github.fge:json-patch:jar:1.6:compile
[DEBUG]             com.github.fge:jackson-coreutils:jar:1.6:compile
[DEBUG]                com.github.fge:msg-simple:jar:1.1:compile
[DEBUG]                   com.github.fge:btf:jar:1.2:compile
[DEBUG]          org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[DEBUG]             org.apache.httpcomponents:httpcore:jar:4.4.4:compile
[DEBUG]             commons-logging:commons-logging:jar:1.2:compile
[DEBUG]             commons-codec:commons-codec:jar:1.9:compile
[DEBUG]       io.swagger:swagger-core:jar:1.5.16:compile
[DEBUG]          com.fasterxml.jackson.core:jackson-annotations:jar:2.8.9:compile
[DEBUG]          com.fasterxml.jackson.core:jackson-databind:jar:2.8.9:compile
[DEBUG]             com.fasterxml.jackson.core:jackson-core:jar:2.8.9:compile
[DEBUG]          com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.8.9:compile
[DEBUG]             org.yaml:snakeyaml:jar:1.17:compile
[DEBUG]          io.swagger:swagger-models:jar:1.5.16:compile
[DEBUG]             io.swagger:swagger-annotations:jar:1.5.16:compile
[DEBUG]          javax.validation:validation-api:jar:1.1.0.Final:compile
[DEBUG]       com.samskivert:jmustache:jar:1.12:compile
[DEBUG]       commons-io:commons-io:jar:2.4:compile
[DEBUG]       org.slf4j:slf4j-ext:jar:1.7.12:compile
[DEBUG]          ch.qos.cal10n:cal10n-api:jar:0.8.1:compile
[DEBUG]       org.slf4j:slf4j-api:jar:1.7.12:compile
[DEBUG]       org.slf4j:slf4j-simple:jar:1.7.12:compile
[DEBUG]       org.apache.commons:commons-lang3:jar:3.4:compile
[DEBUG]       commons-cli:commons-cli:jar:1.2:compile
[DEBUG]       com.atlassian.commonmark:commonmark:jar:0.9.0:compile
[DEBUG] Created new class realm plugin>io.swagger:swagger-codegen-maven-plugin:2.2.3
[DEBUG] Importing foreign packages into class realm plugin>io.swagger:swagger-codegen-maven-plugin:2.2.3
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>io.swagger:swagger-codegen-maven-plugin:2.2.3
[DEBUG]   Included: io.swagger:swagger-codegen-maven-plugin:jar:2.2.3
[DEBUG]   Included: org.eclipse.aether:aether-util:jar:1.0.0.v20140518
[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.0.M1
[DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:no_aop:3.2.3
[DEBUG]   Included: aopalliance:aopalliance:jar:1.0
[DEBUG]   Included: com.google.guava:guava:jar:16.0.1
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.21
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.20
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
[DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
[DEBUG]   Included: org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.4
[DEBUG]   Included: io.swagger:swagger-codegen:jar:2.2.3
[DEBUG]   Included: io.swagger:swagger-parser:jar:1.0.32
[DEBUG]   Included: io.swagger:swagger-compat-spec-parser:jar:1.0.32
[DEBUG]   Included: com.github.java-json-tools:json-schema-validator:jar:2.2.8
[DEBUG]   Included: com.github.java-json-tools:json-schema-core:jar:1.2.8
[DEBUG]   Included: org.mozilla:rhino:jar:1.7R4
[DEBUG]   Included: com.github.fge:uri-template:jar:0.9
[DEBUG]   Included: javax.mail:mailapi:jar:1.4.3
[DEBUG]   Included: javax.activation:activation:jar:1.1
[DEBUG]   Included: joda-time:joda-time:jar:2.9.7
[DEBUG]   Included: com.googlecode.libphonenumber:libphonenumber:jar:8.0.0
[DEBUG]   Included: com.google.code.findbugs:jsr305:jar:3.0.1
[DEBUG]   Included: net.sf.jopt-simple:jopt-simple:jar:5.0.3
[DEBUG]   Included: com.github.fge:json-patch:jar:1.6
[DEBUG]   Included: com.github.fge:jackson-coreutils:jar:1.6
[DEBUG]   Included: com.github.fge:msg-simple:jar:1.1
[DEBUG]   Included: com.github.fge:btf:jar:1.2
[DEBUG]   Included: org.apache.httpcomponents:httpclient:jar:4.5.2
[DEBUG]   Included: org.apache.httpcomponents:httpcore:jar:4.4.4
[DEBUG]   Included: commons-logging:commons-logging:jar:1.2
[DEBUG]   Included: commons-codec:commons-codec:jar:1.9
[DEBUG]   Included: io.swagger:swagger-core:jar:1.5.16
[DEBUG]   Included: com.fasterxml.jackson.core:jackson-annotations:jar:2.8.9
[DEBUG]   Included: com.fasterxml.jackson.core:jackson-databind:jar:2.8.9
[DEBUG]   Included: com.fasterxml.jackson.core:jackson-core:jar:2.8.9
[DEBUG]   Included: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.8.9
[DEBUG]   Included: org.yaml:snakeyaml:jar:1.17
[DEBUG]   Included: io.swagger:swagger-models:jar:1.5.16
[DEBUG]   Included: io.swagger:swagger-annotations:jar:1.5.16
[DEBUG]   Included: javax.validation:validation-api:jar:1.1.0.Final
[DEBUG]   Included: com.samskivert:jmustache:jar:1.12
[DEBUG]   Included: commons-io:commons-io:jar:2.4
[DEBUG]   Included: org.slf4j:slf4j-ext:jar:1.7.12
[DEBUG]   Included: ch.qos.cal10n:cal10n-api:jar:0.8.1
[DEBUG]   Included: org.slf4j:slf4j-simple:jar:1.7.12
[DEBUG]   Included: org.apache.commons:commons-lang3:jar:3.4
[DEBUG]   Included: commons-cli:commons-cli:jar:1.2
[DEBUG]   Included: com.atlassian.commonmark:commonmark:jar:0.9.0
[DEBUG] Configuring mojo io.swagger:swagger-codegen-maven-plugin:2.2.3:generate from plugin realm ClassRealm[plugin>io.swagger:swagger-codegen-maven-plugin:2.2.3, paren
t: sun.misc.Launcher$AppClassLoader@4e25154f]
[DEBUG] Configuring mojo 'io.swagger:swagger-codegen-maven-plugin:2.2.3:generate' with basic configurator -->
[DEBUG]   (f) addCompileSourceRoot = true
[DEBUG]   (f) apiPackage = com.mycompany.proj.brokers.provider.apis
[DEBUG]   (f) configOptions = {packageVersion=0.0.1, targetFramework=v4.5}
[DEBUG]   (f) generateApiDocumentation = false
[DEBUG]   (f) generateApiTests = false
[DEBUG]   (f) generateModelDocumentation = false
[DEBUG]   (f) inputSpec = C:\Repo\mycompany\projPoc\JavaClients\restpolling\swagger.yaml
[DEBUG]   (f) language = java
[DEBUG]   (f) modelPackage = com.mycompany.proj.brokers.provider.models
[DEBUG]   (f) output = C:\Repo\mycompany\projPoc\JavaClients\restpolling\target\swagger
[DEBUG]   (f) project = MavenProject: com.mycompany.proj.brokers:rest-polling:1.0.0 @ C:\Repo\mycompany\projPoc\JavaClients\restpolling\pom.xml
[DEBUG]   (f) skip = false
[DEBUG]   (f) verbose = false
[DEBUG] -- end configuration --
[INFO] reading from C:/Repo/mycompany/projPoc/JavaClients/restpolling/swagger.yaml
[INFO] reading from C:/Repo/mycompany/projPoc/JavaClients/restpolling/swagger.yaml
[INFO] No .swagger-codegen-ignore file found.
[ERROR]
java.lang.RuntimeException: missing swagger input or config!
        at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:685)
        at io.swagger.codegen.plugin.CodeGenMojo.execute(CodeGenMojo.java:534)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.457 s
[INFO] Finished at: 2019-03-25T10:47:25+00:00
[INFO] Final Memory: 12M/172M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.swagger:swagger-codegen-maven-plugin:2.2.3:generate (default) on project rest-polling: Code generation failed. See above for the full
exception. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.swagger:swagger-codegen-maven-plugin:2.2.3:generate (default) on project rest-polling:
 Code generation failed. See above for the full exception.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Code generation failed. See above for the full exception.
        at io.swagger.codegen.plugin.CodeGenMojo.execute(CodeGenMojo.java:540)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more
[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

Did anyone find a solution for this problem?

@maximevdk I've found this workaround. Probably it's too late for you but maybe someone else finds it useful.

In the snippet below is what I had to add into pom's module where swagger plugin is used for client generation.
Pay attention to "phase" and "goals" of both plugins below. I had to experiment to make sure order is like this:
1) maven-dependency-plugin is fetching json file and copies it into /src/main/resources/ folder.
2) swagger-codegen-maven-plugin is used to generate api client and models from json file created above.



org.apache.maven.plugins
maven-dependency-plugin


resource-dependencies
generate-resources

unpack




YOUR_DEPENDENCY
YOUR_DEPENDENCY_ARTIFACT
VERSION
jar
true
${project.basedir}/src/main/resources/


api/**
${project.build.outputDirectory}



        <!-- Used to generate Api client code -->
        <plugin>
            <groupId>io.swagger.codegen.v3</groupId>
            <artifactId>swagger-codegen-maven-plugin</artifactId>
            <version>3.0.14</version>
            <executions>
                <execution>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <inputSpec>${project.basedir}/src/main/resources/api/myapi.json</inputSpec>
                        <language>java</language>
                        <modelPackage>com.example.myapi.api</modelPackage>
                        <apiPackage>com.example.myapi.api</apiPackage>
                        <invokerPackage>com.example.myapi.api.invoker</invokerPackage>
                        <generateApiTests>false</generateApiTests>
                        <generateApiDocumentation>false</generateApiDocumentation>
                        <configOptions>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>${project.artifactId}</artifactId>
                            <artifactVersion>${project.version}</artifactVersion>
                            <library>resttemplate</library>
                            <java8>true</java8>
                            <dateLibrary>legacy</dateLibrary>
                        </configOptions>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
Was this page helpful?
0 / 5 - 0 ratings