Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to "put" maven command line in pom.xml?

Tags:

maven

pom.xml

How can I "put" a command line parameter to be executed from pom.xml. For example I have:

mvn clean install -Dmyparameter

And I wish It to be executed from pom.xml instead from command line.

like image 783
kofucii Avatar asked Jul 13 '12 06:07

kofucii


People also ask

How do I run a Maven project from the command-line?

7. Running a Maven build via the command line. To build a Maven project via the command line, you use the mvn command from the command line. The command must be executed in the directory which contains the relevant pom file.


1 Answers

It depends on which phase you need to use the args. It can be done on plugins by changing the configuration parameter.

<pluginManagement>
    <plugin>
        ......
        ......
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
            <arguments>-Dmaven.test.skip=true -D[other arguments that u need to include]</arguments>
        </configuration>
        ......
        ......
</plugin> </pluginManagement>

Same way in the sure fire plugin u can skip test and so on!!

like image 130
om39a Avatar answered Oct 03 '22 04:10

om39a