3

from command line I can write

mvn install -Pauto-deploy

Is it possible to store this command in my eclipse maven plugin. I want to execute this command by click.

I see only standart things in maven menu:

build
clean 
install 
test

I want see at this list my_autodeploy_command

I am sure it is possible but I don't know how.

Can you show how?

where can I write mvn install -Pauto-deploy ?

Somewhere here?

enter image description here

UPDDATE

for taringamberini

enter image description here

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710

4 Answers4

4

The dialog is the correct one. Install, the lifecycle phase to run up to, is put into the goals field, your profile (auto-deploy) is put into the Profiles field (without -P):

Run As Dialog

You could also copy the full line (without leading "mvn") into the Goals field

blackbuild
  • 5,026
  • 1
  • 23
  • 35
1

Is it possible to store this command in my eclipse maven plugin.

Yes, it is:

  1. In the Package Explorer view right click your Maven project
  2. choose Run as and Run configurations...
  3. right click on Maven Build (node added by your eclipse maven plugin) and choose New
  4. Compile the filed Name for example with clean_test_install
  5. Compile the field Base directory browsing your maven project directory
  6. Compile the field Goals for example with clean build test install
  7. click Apply and close the Run Configuration window

Now, in the tool bar, if you click on the drop down menu at the right of the Run As ... button you can see the clean_test_install entry.

UPDATE

enter image description here

enter image description here

taringamberini
  • 2,719
  • 21
  • 29
  • Red: I had referred to the ```Run as...``` 's drop down menu in the toolbar while in your update the drop down menu seems the one that apears right clicking on the project in the ```Package Explorer``` view and following ```Run as...```. Too many drop down menu ;-) – taringamberini Mar 14 '14 at 09:33
0

You can do it in maven plugin in eclipse as below. Go to debug configuration eclipse --> New configuration in Maven Build Specify Goals as clean -install and select base directory as project which you want to build. You can also skip test if we want in configuration

Brijesh
  • 191
  • 1
  • 5
  • 11
  • go to debug configuration, and select maven build (double click) it should create new configuration. Now select your base directory i.e project which you want to build by clicking on browse workspace. Enter goals as : clean install deploy (U may need to change as per your requiremnet). – Brijesh Mar 14 '14 at 08:30
0

I had an ugly/complicated maven command which launched my project. And On Windows, I wanted to launch it in eclipse - to see the console, and not under a command prompt - where you can't see the console clear. The Maven command was something like:

mvn -am -pl web package -DskipTests -P link-repo,tomcat-run,local-jive -Dfile.encoding=UTF8

So blackbuild answer: "You could also copy the full line (without leading "mvn") into the Goals field" saved my life!

I just copied the maven command in Goals field and it worked!

razvang
  • 1,055
  • 11
  • 15