aspose file tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven - ClassNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "Maven - ClassNotFoundException" Watch "Maven - ClassNotFoundException" New topic
Author

Maven - ClassNotFoundException

Graeme Byers
Ranch Hand

Joined: Apr 16, 2004
Posts: 127
This may be a simple Java ClassNotFoundException rather than Maven but I can't spot it.

Thank you for any help.

I'm following 'Maven - The Definitive Guide' page 54.

Step 1 :



Step 2 :



Step 3 :


Step 4 :





Graeme Byers
Ranch Hand

Joined: Apr 16, 2004
Posts: 127
Forgot to mention : %CLASSPATH% contains C:\ch-custom\simple-weather\target\classes
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5532

You are using the Exec plugin. You need to post the entire definition of that plugin from your pom.xml file (Maven - The Definitive Guide, page 54, doesn't show the Exec plugin being used). Apparently, you didn't set the classpath, or you used the wrong target (you should be using exec:java, not exec:exec).

Also, "The Definitive Guide" has be superceeded by "The Complete Reference": http://www.sonatype.com/books/mvnref-book/reference/


JBoss In Action
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5532

Graeme Byers wrote:Forgot to mention : %CLASSPATH% contains C:\ch-custom\simple-weather\target\classes

Never set CLASSPATH, that's a sure way to get yourself into trouble because you will at some point accidentally pick up the wrong class file. Besides, you should not have to do that when using Maven.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Maven - ClassNotFoundException
 
Similar Threads
linking my own application jar file to my maven build.
maven java:compile
Maven error: Failed to collect dependencies
Could not resolve dependencies for maven project
maven set up