How to execute maven plugin from command line?

Is it possible to execute the Maven plugin from the command line? I need to run the dependency plugin:

<executions>
    <execution>
        <id>copy-dependencies</id>
        <phase>package</phase>
        <goals>
            <goal>copy-dependencies</goal>
        </goals>
        <configuration>
            <outputDirectory>${RPTBIN}/.tools/lib</outputDirectory>
            <overWriteReleases>false</overWriteReleases>
            <overWriteSnapshots>false</overWriteSnapshots>
            <overWriteIfNewer>true</overWriteIfNewer>
            <excludeTransitive>true</excludeTransitive>
        </configuration>
    </execution>
</executions>

Is there a way to execute this plugin in the same way that this plugin is executed during Maven build?

+1
source share
3 answers

Yes it is possible. Maven is a Java tool, so Java must be installed to continue. Please view the installation process here .

mvn dependency:copy-dependencies

Example dependency plugin command. By the way, how do you still manage the Maven team?

+2
source

mvn dependency:copy-dependencies -Dparameter=value, .. -DoverWriteReleases=false

+1

. :

mvn {your groupId}: {your artifactId}: { }: { }

, , AbstractMojo.

execute() . , mvn clean install,

0

Source: https://habr.com/ru/post/1660915/


All Articles