maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Gold <>
Subject Re: Maven profiles question
Date Wed, 16 Oct 2013 00:55:32 GMT
Do you mean that you always want to run this program whenever you build it? Or you only want
to run it when you activate the profile? Unless you do something unusual, "install" will always
cause the jar to be created and installed in your local repository.

You might try adding to your pom something like:


You can then build and run the program with:

	mvn install -Prun

BTW, (ahem) my video course on maven, linked below, has received some good reviews, if you're
looking for more information. And I do cover profiles and the execution element.

- Russ

On Oct 15, 2013, at 7:50 PM, Jvsrvcs <> wrote:

> I really do not understand any of the documentation related to the
> <execution> plugin.
> If I do something like:
>  $mvn -P deploy
> I need to:
> 1. build the project (meaning I just want target/myproj.jar to exist
> 2. Run a java program like:   $java -jar target/myproj.jar <some_options>
> so I want to create a profile that will do both.  I realize that simply $mvn
> install will build the target/myproj.jar but how would I add that to a maven
> profile so that it does both the mvn install and runs $java -jar
> target/myproj.jar <opts>
> ?
> Any help would be appreciated, all of the documentation and examples I have
> tried are not leading me to a solution.
> --
> View this message in context:
> Sent from the Maven - Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Author, Getting Started with Apache Maven <>

Come read my webnovel, Take a Lemon <>, 
and listen to the Misfile radio play <>!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message