Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage detail #36

Open
gempain opened this issue Jan 15, 2018 · 6 comments
Open

Usage detail #36

gempain opened this issue Jan 15, 2018 · 6 comments

Comments

@gempain
Copy link

gempain commented Jan 15, 2018

Hello,

I tried using your tool, but found the documentation to be a bit unclear on how to do so. Here's what I did:

  • cloned the repo
  • did a mvn clean install

But I can't find the swagger2puml.jar that is mentioned in the docs.

What am I missing ?

Thanks a lot for your help :)

All the best;

@uLan08
Copy link

uLan08 commented Mar 9, 2018

Agreed on this. I have been struggling to compile these java classes.

@santoshm1188
Copy link
Contributor

The Jar name is swagger2puml-core, I will update the Documentation part. Please try with this name and report me in case of any issues.

@Wykiki
Copy link

Wykiki commented May 15, 2018

Hello,

I've encountered the same problem.

What I've done :

  • cd <root_of_project>
  • mvn clean install
  • java -cp swagger2puml-core com.kicksolutions.swagger.Swagger2PlantUML
  • java -cp swagger2puml-core target.classes.com.kicksolutions.swagger.Swagger2PlantUML
  • java -cp swagger2puml-core/target/swagger-plantuml-core-0.0.1-SNAPSHOT.jar com.kicksolutions.swagger.Swagger2PlantUML

The first 2 java commands output that :

Error: Could not find or load main class target.classes.com.kicksolutions.swagger.Swagger2PlantUML

The last one :

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
	at com.kicksolutions.swagger.Swagger2PlantUML.init(Swagger2PlantUML.java:54)
	at com.kicksolutions.swagger.Swagger2PlantUML.main(Swagger2PlantUML.java:37)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Thank you for for your help !

@smohiddin
Copy link

Struggling to execute , can i request for clear instruction please.

@casperbang
Copy link

Add the following under section of the parent POM file:

			<plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <mainClass>com.kicksolutions.swagger.Swagger2PlantUML</mainClass>
                    </manifest>
                </archive>
                
            </configuration>
        </plugin>

Then issue a "mvn clean install" from parent. It will create 2 /target/ folder (one under parent and one under the core). Copy it out and rename it to something sane:

cp ./swagger2puml-core/target/swagger-plantuml-core-0.0.1-SNAPSHOT-jar-with-dependencies.jar ./swagger2uml.jar

Now invoke it against your Swagger schema:

java -jar swagger2uml.jar -i myschema.json -o .

@greylurk
Copy link

greylurk commented Dec 4, 2019

These changes are actually included in #46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants