java - exec-maven-plugin error, even on working example -


edit5 updated /

i'm using maven 3.3.3.
create new project , added compile , exec plugin, examples on web.
tried execute, got error

[error] failed execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project qnaproject: exception occured while executing java class. com.jadex.qna.qnaproject.app -> [help 1]<br> [error] <br> [error] see full stack trace of errors, re-run maven -e switch.<br> [error] re-run maven using -x switch enable full debug logging.<br> [error] <br> [error] more information errors , possible solutions, please read following articles:<br> [error] [help 1] http://cwiki.apache.org/confluence/display/maven/mojoexecutionexception<br> 

i tried exec-maven-plugin version 1.2.1 , 1.4.0, got same error. here pom.xml

<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">     <modelversion>4.0.0</modelversion>      <groupid>com.jadex.qna</groupid>     <artifactid>qnaproject</artifactid>     <version>0.1</version>     <packaging>jar</packaging>      <name>qnaproject</name>     <url>http://maven.apache.org</url>      <properties>         <project.build.sourceencoding>utf-8</project.build.sourceencoding>     </properties>      <dependencies>         <dependency>             <groupid>junit</groupid>             <artifactid>junit</artifactid>             <version>3.8.1</version>             <scope>test</scope>         </dependency>     </dependencies>      <build>         <plugins>             <plugin>                 <groupid>org.apache.maven.plugins</groupid>                 <artifactid>maven-compiler-plugin</artifactid>                 <version>2.3.2</version>                 <configuration>                     <source>1.6</source>                     <target>1.6</target>                 </configuration>             </plugin>              <plugin>                 <groupid>org.codehaus.mojo</groupid>                 <artifactid>exec-maven-plugin</artifactid>                 <version>1.2.1</version>                 <executions>                     <execution>                         <goals>                             <goal>java</goal>                         </goals>                     </execution>                 </executions>                 <configuration>                     <executable>maven</executable>                     <mainclass>com.jadex.qna.qnaproject.app</mainclass>                 </configuration>             </plugin>         </plugins>     </build> </project> 

i tried working example project several sites,
such as

http://examples.javacodegeeks.com/enterprise-java/maven/create-java-project-with-maven-example/
http://www.mkyong.com/maven/how-to-create-a-java-project-with-maven/

but got same error.

i unzipped maven @ c:\apache-maven-3.3.3 , created environment variable maven_home same path. problem?

====================================

edit: here result

enter image description here

well.. set maven_home, not m2_home because tutorial found said set only...
of course, echo %maven_home% shows

c:\apache-maven-3.3.3

is wrong?

i added %maven_home%\bin path variable, did not work too.
and, i'm using eclipse

=====================================

edit2: here full log. used goal 'clean exec:java -e -x'

it long, uploaded blog here.
, note changed repository folder c:\users.....m2 new local repository folder c:\apache-maven-localrepository

https://arincblossom.wordpress.com/2015/06/15/error-logs/

=======================================

edit3: changed maven-compiler-plugin setting this

        <plugin>             <groupid>org.apache.maven.plugins</groupid>             <artifactid>maven-compiler-plugin</artifactid>             <version>3.3</version>             <configuration>                 <verbose>true</verbose>                 <fork>true</fork>                 <executable>${env.java_home}/bin/javac</executable>                 <compilerversion>1.5</compilerversion>                 <!-- <source>1.8</source>                 <target>1.8</target> -->             </configuration>         </plugin> 

it prevented me having error mvn -e compile exec:java can't run mvn exec:java -dexec.mainclass="com.jadex.qna.qnaproject.app"

=================================

edit4: ok, i'll try bottom, , post again. sincere helps.

======================================

edit5

i reset sequences... re-installed eclipse, maven.. , re-created projects... nothing worked...

i changed eclipse settings fix jdk path installed jdk path, not jre path. found 'mvn -e clean compile exec:java' working, want 'mvn clean exec:java' work. not work @ all.

you can check full source here

https://github.com/arincblossom/maventestproject

this current console message 'mvn -e clean exec:java'

[warning]  [warning] problems encountered while building effective settings [warning] expected start_tag or end_tag not text (position: text seen ...ore artifacts.\n   |\n   | default: ${user.home}/.m2/repository\n  <l... @53:5)  @ c:\apache-maven-3.3.3\conf\settings.xml, line 53, column 5 [warning] expected start_tag or end_tag not text (position: text seen ...ore artifacts.\n   |\n   | default: ${user.home}/.m2/repository\n  <l... @53:5)  @ c:\apache-maven-3.3.3\conf\settings.xml, line 53, column 5 [warning]  [info] scanning projects... [info]                                                                          [info] ------------------------------------------------------------------------ [info] building maventestproject 0.0.1-snapshot [info] ------------------------------------------------------------------------ [info]  [info] --- maven-clean-plugin:2.5:clean (default-clean) @ maventestproject --- [info] deleting c:\users\bonavision_laptop\desktop\project\jadex\maventestproject\maventestproject\target [info]  [info] --- exec-maven-plugin:1.4.0:java (default-cli) @ maventestproject --- [warning]  java.lang.classnotfoundexception: com.jadex.qna.maventestproject.app     @ java.net.urlclassloader.findclass(urlclassloader.java:381)     @ java.lang.classloader.loadclass(classloader.java:424)     @ java.lang.classloader.loadclass(classloader.java:357)     @ org.codehaus.mojo.exec.execjavamojo$1.run(execjavamojo.java:281)     @ java.lang.thread.run(thread.java:745) [info] ------------------------------------------------------------------------ [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 0.900 s [info] finished at: 2015-06-15t17:42:19+09:00 [info] final memory: 8m/153m [info] ------------------------------------------------------------------------ [error] failed execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java (default-cli) on project maventestproject: exception occured while executing java class. com.jadex.qna.maventestproject.app -> [help 1] [error]  [error] see full stack trace of errors, re-run maven -e switch. [error] re-run maven using -x switch enable full debug logging. [error]  [error] more information errors , possible solutions, please read following articles: [error] [help 1] http://cwiki.apache.org/confluence/display/maven/mojoexecutionexception 

the error log posted says following:

java.lang.classnotfoundexception  com.jadex.qna.qnaproject.app 

so clear root source of error is. trying execute main() method of class class file maven cannot find. this article discusses, can try explicitly compiling first, executing after class file has been generated:

mvn -e compile exec:java mvn exec:java -dexec.mainclass="com.jadex.qna.qnaproject.app" 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

php - Find a regex to take part of Email -

javascript - Function overwritting -