maven - Having issues running java project through command line -
i new using maven. have created maven project , exported eclipse. maven automatically created src/test/java
, src/main/java
.
created java script , ran in eclipse. when try running through command line, got error says:
cannot find or load main class.
when checked project directory, there 2 classfile paths: classes
, test-classes
. script running 1 in 'test-classes' not main class. path main class executes not script located.
the command using main classfile is:
java -cp target/test-1.0-snapshot.jar com.mycompany.app
.
the command test classfile :
java -cp target/test-1.0-snapshot.jar com.mycompany.apptest
.
second command gives me error mentioned.
please how around issue?
by convention, in src/test/java
supposed testing only. is, should place test classes in directory. maven run them before building final jar, not include them in it.
if absolutely need jar test classes, have @ how create jar containing test classes.
Comments
Post a Comment