Issues with swagger-codegen for petstore example (windows)

500 views
Skip to first unread message

tw...@chewonki.org

unread,
May 30, 2014, 2:03:06 PM5/30/14
to swagger-sw...@googlegroups.com
(Reposting this here from the issues page on swagger-codegen... sorry about that)

Hi all,

I'm an intern for a company that wants to use swagger and have been failing all week to get the codegen part working.  I'm struggling with following along with the README to generate a sample client.  I installed scala, sbt, java, and maven, ran Hello World type tests on all of these, and can successfully execute sbt assembly without errors, although with some warnings.

When I execute bin\scala-petstore.sh, however, I get:

Welcome to Git (version 1.9.2-preview20140411)

[git stuff]
Error: Could not find or load main class Files
Please set scalaVersion := "" in build.sbt and run ./sbt assembly

(why is git running?)

I get the Error: Could not find or load main class Files part of that even if I just run a simple test shell script containing the following:

TEST=$(scala ./bin/Version.scala) echo $TEST

which doesn't make a lot of sense to me, because just executing scala .\bin\Version.scala correctly prints "2.10"

~~~

UNFORTUNATELY, even if I try to follow the instructions here: https://github.com/wordnik/swagger-codegen/wiki/Workflow-Integration
I get mostly lost.  This line in workflow integration page raises a red flag for me:
"which executes the codegen script under src/main/scala named JavaPetstoreCodegen."
because that script doesn't exist there or in any subdirectories

So of course if I try putting the given pom.xml in the project root, I get 268 errors when I execute 
mvn scala:run -Dlauncher=java-codegen

So, at the very least, that readme should be updated...


But, if I change the sourceDirectory in pom.xml to samples/client/petstore/java (where the JavaPetstoreCodegen script actually lives...) I still get a ton of errors:

---scala-maven-plugin:3.1.0:compile (default) @ client-generator ---
Compiling 14 source files to C:\....\target\classes at ...
[ERROR] C:\...\samples\client\petstore\svala\src\mail\scala\com\wordnik\client\ApiInvoker.scala:4: error: object jersey is not a member of package com.sun
[ERROR] import com.sun.jersey.api.client.Client

although Maven is set up properly (I think...) and I have jersey-core

Any ideas?

If it helps, I'm using: swagger-codegen version 2.0.14, scala version 2.10.2, java 1.7.55, maven 3.2.1, sbt 0.13.2, and windows 8.1

tony tam

unread,
Jun 1, 2014, 7:56:31 PM6/1/14
to swagger-sw...@googlegroups.com
Hi, I replied to your github question
Reply all
Reply to author
Forward
0 new messages