问题
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?
UPDDATE
for taringamberini
回答1:
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):
You could also copy the full line (without leading "mvn") into the Goals field
回答2:
Is it possible to store this command in my eclipse maven plugin.
Yes, it is:
- In the
Package Explorer
view right click your Maven project - choose
Run as
andRun configurations...
- right click on
Maven Build
(node added by your eclipse maven plugin) and chooseNew
- Compile the filed
Name
for example withclean_test_install
- Compile the field
Base directory
browsing your maven project directory - Compile the field
Goals
for example withclean build test install
- click
Apply
and close theRun 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
回答3:
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
回答4:
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!
来源:https://stackoverflow.com/questions/22399145/write-custom-maven-command-set-using-eclipse-plugin