I've done the same test you did and it works fine (see attached log file).

Manuel

--
Xebia IT Architects
FR : http://blog.xebia.fr
EN : http://blog.xebia.com


On Tue, Jul 29, 2008 at 2:24 AM, Abhishek Sanoujam
<[EMAIL PROTECTED]>wrote:

> Hi all,
>
> I am new to maven and I was trying to run a simple java program from maven.
> But its NOT working and complaining that the plugin does not exist or no
> valid version could be found.
>
> Here is the detailed output:
>
> $ mvn exec:java -Dexec.mainClass=simpleproject.App
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'exec'.
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] The plugin 'org.apache.maven.plugins:maven-exec-plugin' does not
> exist or no valid version could be found
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: < 1 second
> [INFO] Finished at: Tue Jul 29 05:45:32 IST 2008
> [INFO] Final Memory: 1M/2M
> [INFO]
> ------------------------------------------------------------------------
>
> I created a simple project using:
>
> $ mvn archetype:create -DgroupId=simpleproject
> -DartifactId=simpleMavenProject
>
> It contains a default HelloWorld app in simpleproject.App.java which is
> what I am trying to run.
>
> NOTE: If I use the full name of the exec-maven plugin, it is working.
>
> $ mvn org.codehaus.mojo:exec-maven-plugin:1.1:java
> -Dexec.mainClass=simpleproject.App
>
> The above works.
>
> Any reason why "mvn exec:java -Dexec.mainClass=simpleproject.App" is not
> working???
>
> I am using maven-2.0.9
> $ mvn -version
> Maven version: 2.0.9
> Java version: 1.5.0_13
> OS name: "mac os x" version: "10.5.2" arch: "i386" Family: "unix"
>
> Thanks for the help in advance.
>
> Regards,
> Abhishek
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
C:\Temp>mvn archetype:create -DgroupId=simpleproject 
-DartifactId=simpleMavenProject
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [archetype:create] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Setting property: classpath.resource.loader.class => 
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [archetype:create]
[WARNING] This goal is deprecated. Please use mvn archetype:generate instead
[INFO] Defaulting package to group ID: simpleproject
4K downloaded
[INFO] 
----------------------------------------------------------------------------
[INFO] Using following parameters for creating OldArchetype: 
maven-archetype-quickstart:RELEASE
[INFO] 
----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: simpleproject
[INFO] Parameter: packageName, Value: simpleproject
[INFO] Parameter: basedir, Value: C:\Temp
[INFO] Parameter: package, Value: simpleproject
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: artifactId, Value: simpleMavenProject
[INFO] ********************* End of debug info from resources from generated 
POM ***********************
[INFO] OldArchetype created in dir: C:\Temp\simpleMavenProject
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15 seconds
[INFO] Finished at: Tue Jul 29 09:54:54 CEST 2008
[INFO] Final Memory: 8M/14M
[INFO] ------------------------------------------------------------------------

C:\Temp>cd simpleMavenProject

C:\Temp\simpleMavenProject>mvn clean compile exec:java 
-Dexec.mainClass=simpleproject.App
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'exec'.
[INFO] ------------------------------------------------------------------------
[INFO] Building simpleMavenProject
[INFO]    task-segment: [clean, compile, exec:java]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 1 source file to C:\Temp\simpleMavenProject\target\classes
[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[INFO] [exec:java]
Hello World!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Tue Jul 29 09:55:08 CEST 2008
[INFO] Final Memory: 5M/9M
[INFO] ------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to