how can i run a jar file created by maven?
Hi,
I have a Spring project and am trying to run a jar file created by Maven (install) from the terminal but am getting the following errors:
- If I simply run "java -jar name.version.jar ", I get "no main manifest attribute, in name.version.jar"
- If I run "java -cp name.version.jar <main class>", I get ".. java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext"
Any ideas on how I can run the maven generated jar file directly from the terminal?
thanks,
Murat
请先登录再写评论。
I was able to get this to work after some changes:
I feel that I am doing something redundant though. With the install phase, maven is putting my jar file to the maven repository, so I'd expect the dependency to be resolved and thus the dependent jar files to be found when I directly run the maven generated jar file. I should not have to build the artifacts (dependents) I think. Am I missing something or is there a potential enhancement here for the IDE?
thanks,
Murat