maven插件忽略了本地pom插件

vlr*_*vlr 2 maven maven-install-plugin

我是maven的新手,无法弄明白.

我在我的pom.xml文件中有插件的这个配置,但看起来mvn不使用我的配置.

<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>
Run Code Online (Sandbox Code Playgroud)

当我注释掉这个插件时,我收到同样的错误.博客上有一些旧的讨论,认为maven忽略了执行中的配置.它还是个问题吗?我怎样才能让maven读取我的插件声明而不是别的?当我的依赖项被注释掉时它会运行什么?

错误

 [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]
Run Code Online (Sandbox Code Playgroud)

Rag*_*ram 5

从错误消息和上面的信息,一种可能性是您正在运行mvn install:install-file您的项目.mvn install改为奔跑.

  • `mvn install:install-file`意味着在pom文件的上下文之外运行 - 如果你想手动将jar安装到本地存储库中. (3认同)