wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes maven set up Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "maven set up" Watch "maven set up" New topic
Author

maven set up

Michael Sampson
Ranch Hand

Joined: Sep 24, 2008
Posts: 30
I gave up working with m2eclipse following the suggestion of a bartender and tried using maven from the command line. So I downloaded a maven distribution, unzipped into a folder. Found the server.xml file and put that in the ~/.m2/ and ~/.m2/Repository folder though that is all eclipse stuff I am thinking. Output from mvn -v
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sat Jul 18 02:53:36 GMT 2009
[INFO] Final Memory: 1M/3M
[INFO] ------------------------------------------------------------------------
C:\maven\examples\ch03-simple>mvn -v
Apache Maven 2.2.0 (r788681; 2009-06-26 13:04:01+0000)
Java version: 1.5.0_09
Java home: C:\Sun_15\SDK\jdk\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows nt (unknown)" version: "6.0" arch: "x86" Family: "windows"

So I have to think I've done the set up right. I believe there is a catch about the jre has to be part of a jdk in maven. I had postponed the spring book that originally motivated me to look at maven and started reading an Oreilly maven book. I unzipped their simple examples and tried mvn install. I got error:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile': Unable to load the mojo 'org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile' in the plugin 'org.apache.maven.plugins:maven-compiler-plugin'. A required class is missing: org/codehaus/plexus/compiler/AbstractCompiler
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile': Unable to load the mojo 'org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile' in the plugin 'org.apache.maven.plugins:maven-compiler-plugin'. A required class is missing: org/codehaus/plexus/compiler/AbstractCompiler
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:682)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)

being clever I thought I'd put maven-compiler-plugin-2.0.2.jar in Maven_home/lib. Then I get error:

[INFO] Internal error in the plugin manager getting plugin 'org.apache.maven.plugins:maven-site-plugin': Plugin 'org.apache.maven.plugins:maven-site-plugin:2.0-beta-7' has an invalid descriptor:
1) Plugin's descriptor contains the wrong artifact ID: maven-compiler-plugin
2) Plugin's descriptor contains the wrong version: 2.0.2
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager getting plugin 'org.apache.maven.plugins:maven-site-plugin': Plugin 'org.apache.maven.plugins:maven-site-plugin:2.0-beta-7' has an invalid descriptor:
1) Plugin's descriptor contains the wrong artifact ID: maven-compiler-plugin
2) Plugin's descriptor contains the wrong version: 2.0.2
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1543)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1808)

I guess I thought the simple examples would be easier. I am using windows vista which I doubt is making things easier for me. I'm wondering if there was part of the set up I missed.

Mike
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I've never put *anything* in Maven's lib directory--plugins are updatable and as AFAIK end up in your repository.

I wouldn't tweak the server.xml file until you know what you're doing. Personally I'd blow it and anything else away in your home Maven directory (not the install directory, I mean your personal Maven repo--on Vista it's in your user directory IIRC).

I didn't have any issues running Maven under Vista, so I suspect it's just a setup problem.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5811
    
    7

Do you have a direct network connection or do you go through a proxy?

The first time you ran mvn, did it download a lot of files?


JBoss In Action
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Maven downloads the internet the first time it's run--it has to get its plugins, all the dependencies of itself and the project, etc.

I've gone direct and through a proxy; with a proxy obviously you have to modify your server.xml as described here. You didn't mention that at first so I didn't bring it up.
Edwin Stephens
Greenhorn

Joined: Dec 30, 2008
Posts: 15
Hi Michael,

Here is a maven tutorial website that might help you. It describes setting up maven and how you can use maven with Eclipse via command-line maven commands (which are run as Eclipse External Tool Configurations).

http://www.avajava.com/tutorials/categories/maven

Hope that helps,
Edwin


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: maven set up
 
Similar Threads
how to run a project using maven
Unable to find mojo 'validate'
Maven archtype plugin doesn't exist error
Error in Maven while doing clean install
Not Getting Started with Maven - Archtype plugin Not found