[英]exec-maven-plugin not detecting class in src/main/java
I have a project that fails with: 我有一个失败的项目:
Caused by: java.lang.ClassNotFoundException: app.Main
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:283)
at java.lang.Thread.run(Unknown Source)
It's not detecting anything in src/main/java relative to the pom file. 相对于pom文件,它没有在src / main / java中检测到任何东西。 This is in Eclipse.
这是在Eclipse中。 Please help with this.
请帮忙。 I truly have no clue why it is behaving like this.
我真的不知道为什么它会这样。 Other projects execute fine.
其他项目执行良好。 It throws the same error regardless of any class specified in app or without a package.
无论在应用程序中指定的任何类或没有包,它都会引发相同的错误。
There are no classes in src/main/java. src / main / java中没有任何类。 Those go in target/classes.
这些进入目标/班级。 You need to compile before running
exec:java
: 您需要在运行
exec:java
之前进行编译:
mvn compile exec:java -Dexec.mainClass=app.Main
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.