title: Need to publish swagger-codegen generated jar file to maven
body: <p>I am facing some issues with the gradle plugin to deploy/publish the jar which is generated by <code>swagger-codegen plugin</code>. </p>
  
  <p>I already looked at <a href="https://stackoverflow.com/questions/39097992/gradle-artifactorypublish-wont-deploy-jar-file-generated-by-spring-boot">this</a> question and my needs are completely different but it is acting like this. It is deploying the jar generated by the <code>spring-boot</code> application instead of the codegen one.</p>
  
  <p>This is my task to generate the source folder:</p>
  
  <pre><code>import io.swagger.codegen.config.CodegenConfigurator
  import io.swagger.codegen.DefaultGenerator
  
  def swaggerSourceFile = "${project.rootDir}/build/generated/swagger-json/swagger.json"
  def swaggerTargetFolder = 'build/generated/java/src/main/java'
  task generateApi {
      inputs.file("$swaggerSourceFile")
      outputs.dir("$projectDir/$swaggerTargetFolder")
      doLast {
          def config = new CodegenConfigurator()
          config.setInputSpec("$swaggerSourceFile")
          config.setOutputDir("$projectDir/$swaggerTargetFolder")
          config.setLang('java')
          config.setAdditionalProperties([
                  'apiPackage'   : 'com.xyz.abc.testmanager.controller',
                  'modelPackage' : 'com.xyz.abc.testmanager.model',
                  'sourceFolder' : swaggerTargetFolder,
                  'groupId'      : 'com.xyz.abc',
                  "artifactId"   : 'testmanager',
                  'pom.version'  : '1.0.' + System.getenv('BUILD_NUMBER')
          ])
          new DefaultGenerator().opts(config.toClientOptInput()).generate()
      }
  }
  
  clean.doFirst {
      delete(swaggerTargetFolder)
  }
  
  configurations {
      generatedCompile
  }
  
  sourceSets {
      generated {
          compileClasspath = configurations.generatedCompile
          java {
              srcDir file("${project.buildDir.path}/swagger/src/main/java")
          }
      }
      main {
          compileClasspath += generated.output
          runtimeClasspath += generated.output
      }
      test {
          compileClasspath += generated.output
          runtimeClasspath += generated.output
      }
  }
  </code></pre>
  
  <p>The upload task is:</p>
  
  <pre><code>def ifJenkins = System.getenv('BUILD_NUMBER') != null ? true : false
  uploadArchives {
      repositories {
          mavenDeployer {
              if(ifJenkins){
                  repository(url: "http://maven.cloud.test:8081/nexus/content/repositories/releases/") {
                      authentication(userName: System.getenv('MAVEN_CREDS'), password: System.getenv('MAVEN_CREDS_PASSWORD'))
                  }
              }
              else
              {
                  repository(url: "http://maven.cloud.test:8081/nexus/content/repositories/releases/") {
                      authentication(userName: 'test', password: 'test')
                  }
              }
  
              if(ifJenkins){
                  pom.version = "1.0." + System.getenv('BUILD_NUMBER')
                  pom.groupId = "com.xyz.abc"
              } else{
                  pom.version = "0.0." + System.currentTimeMillis()
                  pom.groupId = "com.xyz.abc"
              }
              pom.artifactId = jar.baseName
              pom.packaging = "jar"
              pom.name = "Test Manager Client"
          }
      }
  }
  </code></pre>
  
  <p>I am stuck here as I am not sure whether the problem is with the task or something else. </p>
  
  <p><strong>How do I make sure that my <code>pom.xml</code> generated by <code>swagger-codegen</code> is actually generating the jar and upload the same jar to maven?</strong> </p>