Issue
I want to add a an external jar to my project. I want to add it inside the pom instead of installing it via the maven command.
This is what I have configured inside my pom:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<repositoryLayout>default</repositoryLayout>
<groupId>org.opencv</groupId>
<artifactId>opencv</artifactId>
<version>3.2.0</version>
<packaging>jar</packaging>
<file>${project.basedir}/../runtime-resources/opencv-dep/opencv-320.jar</file>
<generatePom>true</generatePom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
I'm getting this error:
The POM for org.opencv:opencv:jar:3.2.0 is missing, no dependency information available.
But when running the command, everything is oke:
mvn install:install-file -Dfile={absolute-path-to-jar}/opencv-320.jar -DgroupId=org.opencv
-DartifactId=opencv -Dversion=3.2.0 -Dpackaging=jar
NOTE: This is only the case on Netbeans and not on InteliJ. Netbeans apparently skips the install command and just searches for the dependency online, and ofcourse can't find it. I ran mvn install
mvn install:install
mvn install:install-file
Solution
Answer from this question: Maven Install plugin: parameter file is missing or invalid
Change <phase>install</phase>
to <phase>initialize</phase>
and run with mvn initialize
. And it solved my problem on Netbeans.
Answered By - Yoshua Nahar