• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help building my first maven project in Eclipse

 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I downloaded a tutorial (http://blog.springsource.com/2010/01/25/ajax-simplifications-in-spring-3-0/) using SVN within Eclipse and I don't know what to do next.

1) I right-clicked on the pom.xml and selected Maven build.... I got BUILD SUCCESS

2) Next, I assumed that I select Maven Install but I received an error:


[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mvc-ajax 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.4.1:resources (default-resources) @ org.springframework.samples.mvc.ajax ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ org.springframework.samples.mvc.ajax ---
[INFO] Compiling 9 source files to /root/workspace/Eclipse/mvc-ajax/trunk/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.1:testResources (default-testResources) @ org.springframework.samples.mvc.ajax ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ org.springframework.samples.mvc.ajax ---
[INFO] Compiling 1 source file to /root/workspace/Eclipse/mvc-ajax/trunk/target/test-classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.633s
[INFO] Finished at: Mon Mar 29 09:52:14 CDT 2010
[INFO] Final Memory: 3M/9M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:testCompile (default-testCompile) on project org.springframework.samples.mvc.ajax: Compilation failure
/root/workspace/Eclipse/mvc-ajax/trunk/src/test/java/org/springframework/samples/mvc/ajax/account/AccountJsonBindingTests.java:[101,31] cannot find symbol
symbol : constructor String(byte[],java.nio.charset.Charset)
location: class java.lang.String
-> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

I'm new to using SVN within Eclipse and new with Maven, I usually have used Ant. Anyway, I don't know what the errors mean. It sounds like I may be missing a plugin or perhaps a dependency.Can someone help me determine what to do?

Thanks.


 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like the pom.xml is missing a dependency required to compile the unit tests. You should ask Kieth Donald (the blogger) why his pom.xml is incomplete (the blog does allow comments and questions).
 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought maybe it was due to my lack of Maven/Eclipse knowledge and something easy that I overlooked through Eclipse. I'll post a comment on his blog.

Thanks.
 
Fabrizio Cappelletti
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Laura,

you have to use Java 1.6 to accept the String constructor used in that sample application, not a matter of Maven.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fabrizio, welcome to Java Ranch!

And thank you for the input!
 
Fabrizio Cappelletti
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter!

Sorry, in my hurry to reply I forgot the well-manners: I'm an IT consultant working in Milan, Italy, and I love Java
I have appreciated the competence and kindness of JavaRanch people in the past: I'll try to give them back as far as I can

And... Well... Here I am!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic