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

Documentation Request: Document how to build and run the tool #520

Open
andrew-otiv opened this issue Sep 12, 2023 · 5 comments
Open

Documentation Request: Document how to build and run the tool #520

andrew-otiv opened this issue Sep 12, 2023 · 5 comments

Comments

@andrew-otiv
Copy link

andrew-otiv commented Sep 12, 2023

This is probably obvious for java devs, but I'm not familiar with java tooling and just want to try running your command line tool.

After building with "mvn compile", there is still no "Schema2Proto" binary as referenced in the README.

I did try googling how to run code using maven, but all the options looked gross, i.e. studying source code to find the base class, checking if it has a main function, adding a couple extra flags to maven, yada yada. I can't imagine you are putting up with that during development; there has to be a simple way I just don't know about.

@andrew-otiv
Copy link
Author

Another search hit said you're supposed to run the .class file... no luck with that either:

java ./schema2proto/schema2proto-lib/target/classes/no/entur/schema2proto/generateproto/Schema2Proto.class
Error: Could not find or load main class ..schema2proto.schema2proto-lib.target.classes.no.entur.schema2proto.generateproto.Schema2Proto.class
Caused by: java.lang.ClassNotFoundException: //schema2proto/schema2proto-lib/target/classes/no/entur/schema2proto/generateproto/Schema2Proto/class

@andrew-otiv
Copy link
Author

Another search hit said you run javac on the .java file... but that's hitting some missing dependencies.

(base) andrew-otiv@evo:~/otiv3/otiv3/modeling/schema2proto$ javac ./schema2proto-lib/src/main/java/no/entur/schema2proto/generateproto/Schema2Proto.java
./schema2proto-lib/src/main/java/no/entur/schema2proto/generateproto/Schema2Proto.java:42: error: package org.apache.commons.cli does not exist

@andrew-otiv
Copy link
Author

Another search hit said you can run "mvn package" to generate a .jar file, and then run java on that... but after running "mvn package" I have no clue which .jar file actually contains the CLI app, among:

(base) andrew-otiv@evo:~/otiv3/otiv3/modeling/schema2proto$ find . -name "*.jar"
./schema2proto-xsdproto/target/schema2proto-xsdproto-1.88-SNAPSHOT.jar
./schema2proto-maven-plugin/target/schema2proto-maven-plugin-1.88-SNAPSHOT.jar
./schema2proto-lib/target/original-schema2proto-lib-1.88-SNAPSHOT.jar
./schema2proto-lib/target/schema2proto-lib-1.88-SNAPSHOT.jar
./schema2proto-xsom/target/schema2proto-xsom-1.88-SNAPSHOT.jar
./schema2proto-xsom/target/dependency/hamcrest-core-1.3.jar
./schema2proto-xsom/target/dependency/relaxng-datatype-4.0.3.jar
./schema2proto-xsom/target/dependency/apiguardian-api-1.1.2.jar
./schema2proto-xsom/target/dependency/junit-4.13.2.jar
./schema2proto-xsom/target/dependency/junit-vintage-engine-5.10.0.jar
./schema2proto-xsom/target/dependency/opentest4j-1.3.0.jar
./schema2proto-xsom/target/dependency/junit-platform-engine-1.10.0.jar
./schema2proto-xsom/target/dependency/junit-platform-commons-1.10.0.jar
./schema2proto-wire/target/schema2proto-wire-1.88-SNAPSHOT.jar

@tanguy-otiv
Copy link

Hello @andrew-otiv,

You can try the following commands to build and run the project:

# Build the project
mvn clean install

# Run the application with help option
java -jar schema2proto-lib/target/schema2proto-lib-1.88-SNAPSHOT.jar --help

These commands will help you build the project and run it with the --help option to get usage information.

@andrew-otiv
Copy link
Author

andrew-otiv commented Sep 21, 2023 via email

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

2 participants