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
  • #288289 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] ————————————————————————

    One or more required mojo parameters have not been configured.

    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

    Missing parameters include:

    [INFO] ————————————————————————
    [INFO] For more information, run with the -e flag
    [INFO] ————————————————————————
    [INFO] ————————————————————————
    [INFO] Total time: < 1 second
    [INFO] Finished at: Sun Aug 17 16:20:56 EDT 2008
    [INFO] Final Memory: 4M/107M
    [INFO] ————————————————————————

    #288317 Reply

    You should exclude “-D”. I.e. in your case parameter name is exec.mainClass

    You must be logged in to view attached files.
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Need help Running a goal with parameters in the command line

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