aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Need help building my first maven project in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Need help building my first maven project in Eclipse" Watch "Need help building my first maven project in Eclipse" New topic
Author

Need help building my first maven project in Eclipse

laura mccord
Ranch Hand

Joined: Feb 10, 2009
Posts: 108
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

Joined: May 14, 2008
Posts: 5836
    
    7

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).


JBoss In Action
laura mccord
Ranch Hand

Joined: Feb 10, 2009
Posts: 108
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

Joined: Mar 16, 2011
Posts: 4
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

Joined: May 14, 2008
Posts: 5836
    
    7

Fabrizio, welcome to Java Ranch!

And thank you for the input!
Fabrizio Cappelletti
Greenhorn

Joined: Mar 16, 2011
Posts: 4
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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Need help building my first maven project in Eclipse