Domanda

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

È stato utile?

Soluzione

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

Altri suggerimenti

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

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

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!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top