8

I want to run maven-install-plugin before dependency check. How can I do that? The plugin configuration:

    <artifactId>maven-install-plugin</artifactId>
    <executions>
        <execution>
            <id>install-library</id>
            <phase>process-resources</phase>
            <goals>
                <goal>install-file</goal>
            </goals>
            <configuration>
                <groupId>my.assets</groupId>
                <artifactId>myAsset</artifactId>
                <version>0.1-SNAPSHOT</version>
                <packaging>swc</packaging>
                <file>libs/asset.swc</file>
            </configuration>
        </execution>
    </executions>
Kirill Trofimov
  • 1,218
  • 1
  • 14
  • 26

1 Answers1

6

I usually do it in the "clean" phase.

Upside: always runs before everything else

Downside: Have to run "clean" (mvn clean compile, mvn clean install etc)

pap
  • 27,064
  • 6
  • 41
  • 46
  • Sathesh you need to trigger Clean only. If you click "Clean and Build" it will not work. This works for me in Netbeans if I right-click the project and click "Clean" – Asu Mar 02 '19 at 00:31
  • Is there a way to do this without have to run ```clean``` and ```install``` independently of each other? – rhowell Dec 21 '20 at 15:38
  • You can call clean in a Jenkins pre step. – weberjn Feb 08 '22 at 11:27