Using Arguments to maven profile

aem, maven, maven-2, maven-3, maven-profiles

Solution

Yes, you can pass environment variables, like this : `mvn ... -Pdeploy -DdeploymentPort=4322`

Then access the variable in the profile like this:

...
<port>${deploymentPort}</port>
...

Problem

Is there anyway i can pass the argument in the maven profile. Like i want to run the server on specific port if specified otherwise to the default profile. Like when i run mvn clean install -Pdeploy 4322 than the package should deploy to server running on the port 4322 otherwise to 4052.

Original source