I have to install a custom jar during build time, I don't have choice to run deploy file to upload custom jar to central nexus.
The custom jar, does not have any dependencies and is pretty simple Here is my pom file.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>install-asjava</id>
<phase>validate</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>com.ibm</groupId>
<artifactId>customjar1</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<file>${basedir}/lib/customjar1.jar</file>
<generatePom>true</generatePom>
</configuration>
</execution>
<execution>
<id>install-unijdbc</id>
<phase>validate</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>com.ibm</groupId>
<artifactId>customjar2</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<file>${basedir}/lib/customjar2.jar</file>
<generatePom>true</generatePom>
</configuration>
</execution>
</executions>
</plugin>
When I run maven validate
, these custom jars get installed locally fine, but I want to run install-plugin during install time, I changed phase to install and it fails with error
[WARNING] The POM for com.ibm:customjar1:jar:1.0.0 is missing, no dependency information available
[WARNING] The POM for com.ibm:customjar2:jar:1.0.0 is missing, no dependency information available
I have to always explicitly run validate
before running install
, I want to get around this problem. Maven documentation says all the phases before a particular gets executed as part of execution cycle, but some how it is not working for me.
Even, this article says the same thing, you need to run validate
explicitly to make sure maven install
work fine.