Search code examples
mavenmaven-install-plugin

maven plugin ignored from local pom plugins


I am new to maven, and cannot figure it out.

I have this configuration for the plugin in my pom.xml file, but it looks like mvn does not use my configuration.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<packaging>jar</packaging>
<artifactId>${project.artifactId}</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
<file>
${project.build.directory}/${project.artifactId}-${project.version}.jar
</file>
</configuration>
</execution>
</executions>
</plugin>

I am getting the same error when I comment out this plugin. There are old discussions on the blogs that maven was ignoring configurations inside the execution. Is it still an issue ? How can I make maven to read my plugin declarations instead of something else? What does it run when my dependency is commented out?

Error

 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-    plugin:2.3.1:install-file (default-cli) on project core: The parameters 'file' for goal     org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file are missing or invalid ->     [Help 1]

Solution

  • From the error message and the information above, one possibility is that you are running mvn install:install-file on your project. Run mvn install instead.