I've got a Maven project that runs perfectly inside Netbeans. How can I execute the application from the command-line (without Netbeans)?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Using the Maven Exec Plugin and its
exec:java
goal as suggested is a first option. And the command suggested is correct, you have to specify-Dexec.mainClass=VALUE
on the command line.Regarding your "classpath problem", well, you didn't describe it very clearly. What is your problem? What are your dependencies exactly? Just in case, there is a
classpathScope
parameter allowing to define the scope of the classpath passed to the plugin. E.g.:As an alternative to the above plugin, there is MOP. What is MOP?
There's a plugin for that: http://www.mojohaus.org/exec-maven-plugin/
Assuming
com.mycompany.App
is you main class.