• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

maven set up

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!