3

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]
vlr
  • 780
  • 4
  • 16
  • 33

1 Answers1

6

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.

Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • Thanks. Yes, I run "mvn install", and it is working now. Why running "mvn install:install-file" is wrong ? – vlr Feb 08 '12 at 20:01
  • 3
    `mvn install:install-file` is meant to be run outside the context of a pom file - if you want to install a jar into your local repository manually. – Raghuram Feb 09 '12 at 06:07