Thanks for trying it out Manuel. But I am still getting error trying to use exec:java

Here is the stack trace that I get when running with mvn -e:

$ mvn -e clean compile exec:java -Dexec.mainClass=simpleproject.App
+ Error stacktraces are turned on.
[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] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: The plugin 'org.apache.maven.plugins:maven-exec-plugin' does not exist or no valid version could be found at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1303) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1542) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:405) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)
   at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
   at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
   at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
   at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
   at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.version.PluginVersionNotFoundException: The plugin 'org.apache.maven.plugins:maven-exec-plugin' does not exist or no valid version could be found at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:229) at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:91) at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:171) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1274)
   ... 14 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Tue Jul 29 13:52:45 IST 2008
[INFO] Final Memory: 1M/2M
[INFO] ------------------------------------------------------------------------


Does it have anything to do with MacOS ? Or any settings in maven installation? I didn't change anything on the maven installation though, using the default one.

Thanks,
Abhishek


Manuel EVENO wrote:
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] <mailto:[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]
    <mailto:[EMAIL PROTECTED]>
    For additional commands, e-mail: [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>


------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to