Need help Running a goal with parameters in the command line

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #288290 Reply


    Hi I have a slight problem with running a maven goal under myeclipse.

    I’m only able to get 1 of these commands to run via myeclipse ide run configuration launcher dialog

    $ mvn install
    $ mvn exec:java -Dexec.mainClass=com.sonatype.maven.weather.Main

    the install command of course is easy. But the second command requires a bit more work to run from what I can tell

    As per the myeclipse maven videos I go to run as .. -> maven build ..

    in the Configuration and launch dialog window I enter the info in the corresponding fields:

    Goals: org.codehaus.mojo:exec-maven-plugin:1.1-beta-1:java
    Parameter Name: -Dexec.mainClass (also tried Dexec.mainClass)
    value: com.sonatype.weather.Main

    I then click apply and then run and this is what I get on the console:

    [INFO] Scanning for projects…
    [INFO] ————————————————————————
    [INFO] Building weather
    [INFO] Id: weather:weather:jar:1.0-SNAPSHOT
    [INFO] task-segment: [org.codehaus.mojo:exec-maven-plugin:1.1-beta-1:java]
    [INFO] ————————————————————————
    [INFO] [exec:java]
    0 INFO YahooRetriever – Retrieving Weather Data
    911 INFO YahooParser – Creating XML Reader
    1092 INFO YahooParser – Parsing XML Response
    1273 INFO WeatherFormatter – Formatting Weather Data

    The following mojo encountered an error while executing:
    Group-Id: org.codehaus.mojo
    Artifact-Id: exec-maven-plugin
    Version: 1.1-beta-1
    Mojo: java
    brought in via: Direct invocation

    While building project:
    Group-Id: weather
    Artifact-Id: weather
    Version: 1.0-SNAPSHOT
    From file: /home/nmatrix9/workspace3/weather/pom.xml
    Reason: null

    [INFO] ————————————————————————
    [INFO] For more information, run with the -e flag
    [INFO] ————————————————————————
    [INFO] ————————————————————————
    [INFO] Total time: 2 seconds
    [INFO] Finished at: Sun Aug 17 17:45:25 EDT 2008
    [INFO] Final Memory: 4M/107M
    [INFO] ————————————————————————

    ****Any insight as to why it’s telling me the build fail would be appreciated.


    #288293 Reply


    Please ignore the previous post, I was able to get this working after a maven clean that was all that was needed to update the changes.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Need help Running a goal with parameters in the command line

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

You must be logged in to post in the forum log in