简体   繁体   中英

Idea 14 - Maven 3 - pass parameters

I am looking for most efficient way to pass parameters to maven through idea 14 (I have just started working with idea).

When I want to compile and deploy my application through maven itself, I just run this command mvn clean package tomcat7:redeploy -P localhost -Daugage_env=local .

I dont know, how to pass this parameter -Daugage_env=local as default (or how to integrate it with localhost profile, which would be even better).

I did try maven-projects->myproject->lifecycle-> right click on compile and create custom compile where I changed the Command line text to compile -Daugage_env=local , but it does not work.

You can define profile specific properties directly in pom.xml like so:

<profile>
    <id>localhost</id>
    <properties>
        <augage_env>local</augage_env>
    </properti‌​es>
</profile>

More information can be found in Maven documentation for build profiles .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM