开发者

How to add class files to a Maven2 project

So I'm working on a java project (an exitsing java project that uses maven2, not mine). Everything works fine. I add a new class to the source directory.

I do mvn compile and get success. I then do `mvn exec:java -Dexec.mainClass="package.NewClass"

and get classNotFoundException.

It does compile the new file, and I can see the NewClass.class in the right directory with the开发者_如何学C other classes. So I don't get the classNotFoundException. Do I need to make any changes to the pom.xml?

Thanks!!


Try

mvn exec:java -Dexec.mainClass="package.NewClass"

Resources :

  • Mojohaus.org - exec plugin see java section.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜